CVE-2024-43405: Github.com/projectdiscovery/nuclei/v3 Nuclei Template Signature Verification Bypass Vulnerability
MODERATECVE-2024-43405 is a MODERATE (CVSS 7.4) nuclei template signature verification bypass vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Github.com/projectdiscovery/nuclei/v3 libraries in the Go ecosystem. The issue involves nuclei template signature verification bypass. Remediation is available by upgrading affected packages to version 3.3.2.
CVE-2024-43405 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2024-43405
To remediate this vulnerability, upgrade all affected Github.com/projectdiscovery/nuclei/v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/projectdiscovery/nuclei/v3 to 3.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/projectdiscovery/nuclei/v3
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-43405, inspect your project dependencies for Github.com/projectdiscovery/nuclei/v3:
inspect dependencies for github.com/projectdiscovery/nuclei/v3
Analyze the terminal output to locate any version of Github.com/projectdiscovery/nuclei/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Github.com/projectdiscovery/nuclei/v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-43405 Affected Github.com/projectdiscovery/nuclei/v3 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/projectdiscovery/nuclei/v3
|
Go |
≥ 3.0.0
< 3.3.2
|
3.3.2
|
References
Frequently Asked Questions
What is CVE-2024-43405?
Which Github.com/projectdiscovery/nuclei/v3 versions are affected?
What version fixes CVE-2024-43405?
Is github.com/projectdiscovery/nuclei/v3 affected?
What is the CVSS score of CVE-2024-43405?
What CWE is associated with CVE-2024-43405?
How can I check Go dependencies for CVE-2024-43405?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7h5p-mmpp-hgmm",
"modified" : "2024-10-14T14:19:19Z",
"published" : "2024-09-04T17:38:24Z",
"aliases" : [ "CVE-2024-43405" ],
"summary" : "Nuclei Template Signature Verification Bypass",
"details" : "## Summary\nA vulnerability has been identified in Nuclei's template signature verification system that could allow an attacker to bypass the signature check and possibly execute malicious code via custom code template.\n\n## Affected Component\nThe vulnerability is present in the template signature verification process, specifically in the `signer` package.\n\n## Description\nThe vulnerability stems from a discrepancy between how the signature verification process and the YAML parser handle newline characters, combined with the way multiple signatures are processed. This allows an attacker to inject malicious content into a template while maintaining a valid signature for the benign part of the template.\n\n### Affected Users\n1. **CLI Users:** Those executing **custom code templates** from unverified sources. This includes templates authored by third parties or obtained from unverified repositories.\n2. **SDK Users:** Developers integrating Nuclei into their platforms, particularly if they permit the execution of **custom code templates** by end-users.\n\n> [!NOTE]\n> Code templates are disabled as default, users have to explicitly enable with `-code` option. \n\n## Proof of Concept\n\n```yaml\nid: example-template\ninfo:\n name: Example Template\n# Other benign content...\n# digest: <valid_signature_for_benign_content>\n# digest: <another_signature>\\r\ncode:\\r\n - engine:\\r\n - sh\\r\n - bash\\r\n source: |\\r\n id\\r\n```\n### Patches\n1. The vulnerability is addressed in Nuclei v3.3.2 Users are strongly recommended to update to this version to mitigate the security risk.\n2. Fix reference - https://github.com/projectdiscovery/nuclei/commit/0da993afe6d41b4b1b814e8fad23a2acba13c60a\n\n### Mitigation\n- **Immediate Upgrade**: The primary recommendation is to upgrade to Nuclei v3.2.0, where the vulnerability has been patched.\n- **Avoid Unverified Templates**: As an interim measure, users should refrain from using custom templates if unable to upgrade immediately. Only trusted, [verified templates](https://github.com/projectdiscovery/nuclei-templates) should be executed.\n\n### Workarounds\nIf you are unable to upgrade nuclei, disable running custom code templates as workaround.\n\n## Acknowledgments\n\nWe would like to thank [Guy Goldenberg](https://github.com/GuyGoldenberg) from Wiz who reported this to us via our security email, [security@projectdiscovery.io](mailto:security@projectdiscovery.io).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/projectdiscovery/nuclei/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/projectdiscovery/nuclei/security/advisories/GHSA-7h5p-mmpp-hgmm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-43405"
}, {
"type" : "WEB",
"url" : "https://github.com/projectdiscovery/nuclei/commit/0da993afe6d41b4b1b814e8fad23a2acba13c60a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/projectdiscovery/nuclei"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-3114"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-04T17:38:24Z",
"nvd_published_at" : "2024-09-04T16:15:06Z"
}
}