Skip to main content

Gitleaks CVE-2026-63728

| EUVDEUVD-2026-46134 HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-07-20 VulnCheck GHSA-mmh4-9cvr-w4cj
8.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker contributes malicious report template
  2. Delivery
    Victim runs Gitleaks in CI/CD with that template
  3. Exploit
    Sprig env/expandenv reads host and scan secrets
  4. Execution
    getHostByName encodes secrets into DNS queries
  5. Impact
    Attacker-controlled DNS server captures exfiltrated credentials

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Exploitation requires that Gitleaks be run with the report template (custom output template) feature using a template the attacker can supply or influence, and that the template invoke the non-hermetic Sprig functions env, expandenv, or getHostByName - this specific feature and function usage IS the condition. Limiting factors: the vector is local (AV:L) and requires active user interaction (UI:A) - a victim must actually execute Gitleaks against the malicious template, so it is not remotely self-triggering; value comes only when the host process environment or scan actually contains secrets (typical in CI/CD but not guaranteed); and outbound DNS resolution must be permitted for the getHostByName exfiltration path. It does not apply to installations that never use custom/attacker-influenced report templates.

Impact

The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N, base 8.1) frames this accurately: exploitation is local and requires active user interaction (a victim must run Gitleaks with the attacker-influenced template), but confidentiality impact is high on both the vulnerable system (VC:H) and a subsequent system (SC:H, reflecting exfiltration of scanned/host secrets), with no integrity or availability impact. This is a confidentiality-only, exfiltration-focused issue, not a code-execution flaw. Realistically the interesting exploitation path is supply-chain-style: a poisoned template committed to a repo or shared config runs inside a privileged CI/CD job. No EPSS score, SSVC decision, or KEV entry was provided; a public technique write-up exists but there is no evidence of automated, widespread exploitation. Note a nuance worth verifying: the CVSS vector marks PR:N (no privileges) because the attacker supplies the template, yet the attack still depends on a victim invoking Gitleaks with that template - the UI:A metric, not authentication, is what gates it.

Exploit ScenarioDerived

An attacker submits a pull request to a repository that adds or modifies a Gitleaks report template containing Sprig calls like getHostByName combined with env/expandenv. When the CI/CD pipeline runs Gitleaks on the branch, the template renders inside the runner, reads CI secrets and any secrets found during the scan, and encodes them into DNS queries to an attacker-controlled domain, silently exfiltrating them; a public write-up demonstrates this technique.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 21, 2026

Sensitive data exfiltration in Gitleaks before 8.30.1 lets an attacker who controls the report template read arbitrary host environment variables through non-hermetic Sprig functions (env, expandenv, getHostByName) and smuggle them out via attacker-triggered DNS lookups. Because Gitleaks runs in CI/CD with broad access to credentials, tokens, and API keys - including the very secrets it just discovered during a scan - a malicious template turns the scanner into an exfiltration channel. A detailed public write-up describing the technique and the fix exists; there is no CISA KEV listing, so this reflects a demonstrated technique rather than confirmed active exploitation.

RemediationAI

Upgrade to Gitleaks 8.30.1 or later, which restricts the template engine so non-hermetic Sprig functions can no longer reach host environment variables or perform DNS resolution (Vendor-released patch: 8.30.1; fix in commit 83d9cd684c87d95d656c1458ef04895a7f1cbd8e). Until you can upgrade, treat report templates as untrusted code: do not use, accept, or merge report templates from external contributors or shared/untrusted sources, and pin templates to a reviewed, in-house version stored outside contributor-writable paths - the trade-off is losing the flexibility of per-repo custom templates. As defense in depth for CI/CD runners, scope down the job's environment so it holds only the secrets it strictly needs and add egress filtering that blocks or logs outbound DNS to untrusted resolvers/domains, which neutralizes the getHostByName exfiltration channel at the cost of some monitoring overhead. Consult the VulnCheck advisory (https://www.vulncheck.com/advisories/gitleaks-secret-exfiltration-via-non-hermetic-sprig-template-functions-in-report-template-feature) for details.

Affected VersionsENISA

gitleaks 0 <8.30.1

Affected Packages

euvd gitleaks fix: 8.30.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is Gitleaks' report template feature, which renders output using Go's text/template engine extended with the Sprig function library. Sprig ships 'non-hermetic' helpers - functions that reach outside the template sandbox into the host process, notably env/expandenv (process environment variables) and getHostByName (DNS resolution). The root cause is CWE-1336, Improper Neutralization of Special Elements Used in a Template Engine (server-side template injection): untrusted or attacker-influenced template content is evaluated with a function set that permits host interaction. Combining env-style secret reads with getHostByName provides both the sensitive-data source and a covert egress channel (DNS), so no direct network response to the attacker is needed. The affected package is identified by cpe:2.3:a:gitleaks:gitleaks and all versions prior to 8.30.1 are in scope.

Know when Gitleaks gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.1 HIGH
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
vuln.today AI 6.3 MEDIUM

Local template rendering requires a victim to run Gitleaks (UI:R, AV:L); attacker needs no privileges since they only supply the template (PR:N); reading host env and exfiltrating beyond the tool is scope-changed confidentiality-only (S:C, C:H, I:N, A:N).

3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
SUSE 6.3 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

Gitleaks versions before 8.30.1 contain a vulnerability that allows attackers who control the report template to exfiltrate environment variables, credentials, and API keys from CI/CD pipelines. This transforms a security scanning tool into an attack vector for stealing the very credentials it is meant to protect, affecting organizations that deploy Gitleaks in their CI/CD infrastructure. Publicly available exploit code exists, but no active exploitation has been confirmed at this time.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% exploitable
Prevalence
High
very popular open-source secret scanner, widely embedded in CI/CD pipelines
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy