CVE-2026-63728 Gitleaks Secret Exfiltration via Non-Hermetic Sprig Template Functions in Report Template Feature
Attackers can inject malicious templates to read environment variables and exfiltrate secrets via DNS, impacting developers using Gitleaks.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-63728?
CVE-2026-63728 is a high-severity code injection vulnerability in gitleaks, published on 20 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-1336
Which versions are affected by CVE-2026-63728?
How do I fix CVE-2026-63728?
No fix has been published for CVE-2026-63728 yet. Limit exposure of the affected software until one is available.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-63728 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-63728 exists.
Sources
Also known as GHSA-mmh4-9cvr-w4cj.