CVE-2024-40641 Unsigned code template execution through workflows in projectdiscovery/nuclei

High 7.4 Published Updated

Attackers can execute arbitrary commands by bypassing signature checks in Nuclei workflows, affecting tools that integrate this scanner.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-40641?

CVE-2024-40641 is a high-severity command injection vulnerability in projectdiscovery nuclei, published on 17 Jul 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Nuclei is a fast and customizable vulnerability scanner based on simple YAML based DSL. In affected versions it a way to execute code template without -code option and signature has been discovered. Some web applications inherit from Nuclei and allow users to edit and execute workflow files. In this case, users can execute arbitrary commands. (Although, as far as I know, most web applications use -t to execute). This issue has been addressed in version 3.3.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-78

Which versions are affected by CVE-2024-40641?

5 open source packages ship an affected version, including github.com/projectdiscovery/nuclei/v3, github.com/projectdiscovery/nuclei and github.com/projectdiscovery/nuclei/v2.

PackageAffectedFixed in
github.com/projectdiscovery/nuclei/v3 GoAll versions3.3.0
github.com/projectdiscovery/nuclei/v3 GoAll versions3.3.0
github.com/projectdiscovery/nuclei/v3 GoAll versions3.3.0
github.com/projectdiscovery/nuclei GoAll versionsNone
github.com/projectdiscovery/nuclei/v2 GoAll versionsNone

How do I fix CVE-2024-40641?

Upgrade github.com/projectdiscovery/nuclei/v3 to 3.3.0 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2024-40641 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-40641 exists.

Sources

Also known as GHSA-c3q9-c27p-cw9h, GO-2024-2989.

Is CVE-2024-40641 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free