CVE-2026-41645

CVE-2026-41645 is a medium-severity code injection vulnerability in github.com/projectdiscovery/nuclei/v3 (go), affecting versions >= 3.0.0, < 3.8.0. It is fixed in 3.8.0.

Summary

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 / -ev option 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 -ev flag enabled.
  • SDK users who have integrated Nuclei into platforms where EnvironmentVariables is set to true and 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 [email protected]

Impact

Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.

CVE-2026-41645 has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.8.0); upgrading removes the vulnerable code path.

Affected versions

github.com/projectdiscovery/nuclei/v3 (>= 3.0.0, < 3.8.0)

Security releases

github.com/projectdiscovery/nuclei/v3 → 3.8.0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade github.com/projectdiscovery/nuclei/v3 to 3.8.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-41645? CVE-2026-41645 is a medium-severity code injection vulnerability in github.com/projectdiscovery/nuclei/v3 (go), affecting versions >= 3.0.0, < 3.8.0. It is fixed in 3.8.0. Untrusted input is evaluated as executable code within the application's runtime environment.
  2. How severe is CVE-2026-41645? CVE-2026-41645 has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/projectdiscovery/nuclei/v3 are affected by CVE-2026-41645? github.com/projectdiscovery/nuclei/v3 (go) versions >= 3.0.0, < 3.8.0 is affected.
  4. Is there a fix for CVE-2026-41645? Yes. CVE-2026-41645 is fixed in 3.8.0. Upgrade to this version or later.
  5. Is CVE-2026-41645 exploitable, and should I be worried? Whether CVE-2026-41645 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-41645 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-41645? Upgrade github.com/projectdiscovery/nuclei/v3 to 3.8.0 or later.

Other vulnerabilities in github.com/projectdiscovery/nuclei/v3

CVE-2026-41646CVE-2024-43405CVE-2024-40641CVE-2024-27920

Stop the waste.
Protect your environment with Kodem.