5.3medium
Nuclei: Environment variable disclosure via Response-Derived DSL Expressions
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.44% (higher than 30% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jm34-66cf-qpvrGO-2026-5473
Description
Nuclei is a vulnerability scanner built on a simple YAML-based DSL. From version 3.0.0 to before version 3.8.0, a vulnerability in Nuclei's expression evaluation engine makes it possible for a malicious target server to inject and execute supported DSL expressions. This happens when HTTP response data containing helper/function syntax gets reused by multi-step templates. If the -env-vars / -ev option is explicitly enabled, this can expose host environment variables. That option is off by default, so standard configurations are not affected by the information disclosure risk. This issue has been patched in version 3.8.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| projectdiscovery nuclei | >= 3.0.0, < 3.8.0, from 3.0.0 before 3.8.0 | CVE List, NVD |
| github.com/projectdiscovery/nuclei/v3 (Go) | from 3.0.0 before 3.8.0 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/projectdiscovery/nuclei (Go) | all versions | Go Vulnerability Database |
| github.com/projectdiscovery/nuclei/v2 (Go) | all versions | Go Vulnerability Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Nuclei is a vulnerability scanner built on a simple YAML-based DSL. From version 3.0.0 to before version 3.8.0, a vulnerability in Nuclei's expression evaluation engine makes it possible for a malicious target server to inject and execute supported DSL expressions. This happens when HTTP response data containing helper/function syntax gets reused by multi-step templates. If the -env-vars / -ev option is explicitly enabled, this can expose host environment variables. That option is off by default, so standard configurations are not affected by the information disclosure risk. This issue has been patched in version 3.8.0.
GitHub Advisory Database
A vulnerability in Nuclei's expression evaluation engine makes it possible for a malicious target server to inject and execute supported DSL expressions. This happens when HTTP response data containing helper/function syntax gets reused by multi-step templates. If the -env-vars / -ev option is explicitly enabled, this can expose host environment variables. That option is off by default, so standard configurations are not affected by the information disclosure risk.
Affected Component
The issue lives in expressions.Evaluate() at pkg/protocols/common/expressions/ and in the unresolved-variable validation path (hasLiteralsOnly()).
Description
expressions.Evaluate() replaces placeholders first, then scans the substituted output for expressions. Because of this two-pass approach, response-derived values (including extractor output and response body content) can be reinterpreted as DSL/helper syntax on the second pass.
When -env-vars (-ev) is enabled, environment variables get merged into the template variable map. A malicious target can return response data containing expressions like {{env_var_name}} which, when reused in a subsequent template request, resolve to actual environment variable values. This can expose sensitive host data like API keys, credentials, and tokens.
Without -ev enabled (the default), injected DSL expressions may still trigger helper functions such as {{md5("test")}}, but this has no meaningful security impact beyond unexpected behavior.
There is also a separate issue in hasLiteralsOnly(): it was evaluating helper expressions while deciding whether {{...}} contained unresolved variables, which caused validation logic to run side-effectful helpers even when the final request kept the value as a literal.
[!NOTE] The
-env-vars/-evoption is off by default. Users who have not explicitly turned it on are not affected by the information disclosure aspect of this vulnerability.
Affected Users
- CLI users running multi-step templates (with extractors or flow-based request chaining) that reuse response-derived values against untrusted or attacker-controlled targets, with the
-evflag enabled. - SDK users who have integrated Nuclei into platforms where
EnvironmentVariablesis set totrueand scan targets are not fully trusted.
Patches
- The vulnerability is fixed in Nuclei v3.8.0. Upgrading to this version is strongly recommended.
- Relevant fix references: #7221, #7321.
Mitigation
Upgrade to Nuclei v3.8.0. The updated evaluation logic now collects expressions from the original template text before placeholder substitution and only evaluates those template-authored expressions.
If you have -ev enabled, disable it when scanning untrusted targets to avoid environment variable disclosure.
Workarounds
If upgrading is not an option right now, make sure -env-vars / -ev is not enabled when running multi-step templates against untrusted targets.
Acknowledgments
Nuclei thanks @gnuletik for reporting this issue through responsible disclosure via security@projectdiscovery.io
Go Vulnerability Database
Nuclei: Environment variable disclosure via Response-Derived DSL Expressions in github.com/projectdiscovery/nuclei
NVD (es)
Nuclei es un escáner de vulnerabilidades construido sobre un DSL simple basado en YAML. Desde la versión 3.0.0 hasta antes de la versión 3.8.0, una vulnerabilidad en el motor de evaluación de expresiones de Nuclei permite que un servidor objetivo malicioso inyecte y ejecute expresiones DSL compatibles. Esto ocurre cuando los datos de respuesta HTTP que contienen sintaxis de ayudante/función son reutilizados por plantillas de varios pasos. Si la opción -env-vars / -ev está explícitamente habilitada, esto puede exponer variables de entorno del host. Esa opción está desactivada por defecto, por lo que las configuraciones estándar no se ven afectadas por el riesgo de revelación de información. Este problema ha sido parcheado en la versión 3.8.0.
References
| https://github.com/projectdiscovery/nuclei/security/advisories/GHSA-jm34-66cf-qpvr | advisory, mitigation, patch, vendor-advisory, web | |
| https://github.com/projectdiscovery/nuclei/pull/7221 | fix, issue-tracking, patch, web | |
| https://github.com/projectdiscovery/nuclei/pull/7321 | fix, issue-tracking, patch, web | |
| https://github.com/projectdiscovery/nuclei/commit/6c803c74d193f85f8a6d9803ce493fd302cad0eb | fix, patch, web | |
| https://github.com/projectdiscovery/nuclei/commit/d2217320162d5782ca7cb95bef9dda17063818f3 | fix, patch, web | |
| https://github.com/projectdiscovery/nuclei/releases/tag/v3.8.0 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-41645 | advisory | |
| https://github.com/projectdiscovery/nuclei | package | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41645 changed 2026-05-11 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jm34-66cf-qpvr changed 2026-07-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5473 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2026-41645 changed 2026-10-26 | Public domain |