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.
Published: 2026-07-20
Score: 8.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Gitleaks versions prior to 8.30.1 are vulnerable to template injection that permits an attacker who can supply or influence report templates to read arbitrary environment variables. By using the non‑hermetic Sprig template functions such as env, expandenv, and getHostByName, the attacker can extract credentials, tokens, and API keys. The extracted data can then be exfiltrated through DNS queries, including secrets discovered during the scan itself, leading to a confidentiality breach.

Affected Systems

The affected product is the open‑source tool Gitleaks, from the vendor gitleaks, specifically all releases before 8.30.1.

Risk and Exploitability

The CVSS score of 8.1 indicates high severity, while the EPSS score of less than 1% suggests a low probability of exploitation at this time. The vulnerability is not listed in CISA KEV. Attackers would need the ability to supply or modify report templates, likely requiring local or elevated access to the Gitleaks configuration. While the impact is primarily data exfiltration rather than remote code execution, the potential for compromising sensitive secrets makes it a serious concern.

Generated by OpenCVE AI on July 30, 2026 at 18:17 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update Gitleaks to version 8.30.1 or later to eliminate the injection flaw.
  • Disable or restrict the use of user‑supplied report templates in production deployments.
  • Remove or block usage of the env, expandenv, and getHostByName template functions within any report templates to prevent environment variable exposure.
  • Monitor DNS traffic for unusual query patterns that may indicate exfiltration attempts.

Generated by OpenCVE AI on July 30, 2026 at 18:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Gitleaks
Gitleaks gitleaks
Vendors & Products Gitleaks
Gitleaks gitleaks

Wed, 22 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 20 Jul 2026 23:45:00 +0000

Type Values Removed Values Added
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.
Title Gitleaks Secret Exfiltration via Non-Hermetic Sprig Template Functions in Report Template Feature
Weaknesses CWE-1336
References
Metrics cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N'}

cvssV4_0

{'score': 8.1, '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'}


Subscriptions

Gitleaks Gitleaks
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-22T13:55:50.277Z

Reserved: 2026-07-17T21:21:58.625Z

Link: CVE-2026-63728

cve-icon Vulnrichment

Updated: 2026-07-22T13:55:45.360Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T18:30:05Z

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine