Description
Gitleaks prior to 8.30.1 contains a template injection vulnerability that allows attackers who can supply or influence report templates to read arbitrary environment variables and exfiltrate sensitive data by leveraging non-hermetic Sprig template functions. Attackers can craft malicious report templates using the env, expandenv, and getHostByName functions to extract credentials, tokens, and API keys from the host process and exfiltrate them through DNS queries, including secrets discovered during the scan itself.
Severity (CVSS)
| Base score | 8.1 |
|---|---|
| Severity | High |
| Version | CVSS 4.0 |
| Vector | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N |
| Provided by | CNA |
Weaknesses
- CWE-1336 — Improper Neutralization of Special Elements Used in a Template Engine
Affected products
| Vendor | Product | Versions |
|---|---|---|
| gitleaks | gitleaks | 0 to <8.30.1 |
References
- https://github.com/gitleaks/gitleaks (product)
- https://github.com/gitleaks/gitleaks/commit/83d9cd684c87d95d656c1458ef04895a7f1cbd8e (patch)
- https://fatihhcelik.github.io/posts/gitleaks-abusing-sprig-for-exfiltration/#the-fix
- https://www.vulncheck.com/advisories/gitleaks-secret-exfiltration-via-non-hermetic-sprig-template-functions-in-report-template-feature (third-party-advisory)
Generated from the official CVE List on 21 Jul 2026 07:01 UTC.