A 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.
The vulnerability is present in the template signature verification process, specifically in the signer
package.
The 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.
[!NOTE] Code templates are disabled as default, users have to explicitly enable with
-code
option.
id: example-template
info:
name: Example Template
# Other benign content...
# digest: <valid_signature_for_benign_content>
# digest: <another_signature>\r
code:\r
- engine:\r
- sh\r
- bash\r
source: |\r
id\r
If you are unable to upgrade nuclei, disable running custom code templates as workaround.
We would like to thank Guy Goldenberg from Wiz who reported this to us via our security email, security@projectdiscovery.io.
{ "nvd_published_at": "2024-09-04T16:15:06Z", "cwe_ids": [ "CWE-78" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2024-09-04T17:38:24Z" }