image-6

Nuclei flaw allows signature bypass and code execution

Share:

A vulnerability in Nuclei, an open-source vulnerability scanner, could allow attackers to bypass signature checks and execute malicious code.

A high-severity security flaw, tracked as CVE-2024-43405 (CVSS score of 7.4), in the open-source vulnerability scanner ProjectDiscovery’s Nuclei, could allow attackers to bypass signature checks and execute malicious code.

The Wiz’s engineering team discovered the vulnerability.

The vulnerability arises from newline handling discrepancies and multi-signature processing, enabling attackers to inject malicious content into templates.

“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.” reads the advisory published on GitHub. “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.”

The vulnerability impacts all versions of Nuclei later than 3.0.0, it was addressed in version v3.3.2.

The vulnerability scanner has 21,000+ GitHub stars and 2.1M+ downloads, Wiz researchers pointed out that the software is vital for the security community, highlighting the need to address vulnerabilities.

Nuclei

Nuclei’s strength is its flexible YAML-based templates, enabling detection of vulnerabilities and misconfiguration.

Nuclei supports multiple protocols, including HTTP, TCP, DNS, TLS, and Code. The code protocol allows the execution of external code on the host operating system, experts warn that this feature could pose serious risks.

Nuclei templates using the code protocol can assess system security but risk executing malicious code locally, potentially compromising servers or infrastructure.

“The flexibility of Nuclei templates means they can be crafted for legitimate or malicious purposes. For instance, the following template demonstrates how an attacker might exploit the code protocol to exfiltrate sensitive data from the host running the template” reads the report published by Wiz.

Nuclei uses signature verification to ensure template integrity, but its reliance on this single mechanism creates a critical point of failure, highlighting the need for robust validation.

Wis researchers said the issue arises from using regex for signature validation alongside a YAML parser, allowing attackers to exploit parsing conflicts with “\r” characters to bypass verification. Parsing inconsistencies allow attackers to use “\r” to add a second “# digest:” line, bypassing signature verification while being executed by the YAML parser.

This exploit is possible due to the following key weaknesses:

  1. Parser Inconsistencies: Go’s regex-based signature verification treats \\r as part of the same line, while the YAML parser interprets it as a line break. This mismatch allows attackers to inject content that bypasses verification but is executed by the YAML parser.
  2. First-Signature Trust: The verification logic validates only the first # digest: line. Additional # digest: lines are ignored during verification but remain in the content to be parsed and executed by YAML.
  3. Inconsistent Signature Removal: The ReplaceAll function removes all # digest: lines from the hashed content, ensuring only the first line is verified. Malicious content in subsequent lines remains unverified but executable.

An attacker can chain these weaknesses to inject unverified, executable content into Nuclei templates.

“An attack vector for this vulnerability arises when organizations run untrusted or community-contributed templates without proper validation or isolation. Additionally, services that allow users to modify or upload Nuclei templates, such as automated scanning platforms or shared security pipelines, become particularly vulnerable.” concludes the report. “An attacker could exploit this functionality to inject malicious templates, leading to arbitrary command execution, data exfiltration, or system compromise.”

Source

Leave a Comment

Your email address will not be published. Required fields are marked *

loader-image
London, GB
4:23 am, Jun 6, 2025
weather icon 11°C
L: 10° | H: 12°
clear sky
Humidity: 88 %
Pressure: 1004 mb
Wind: 12 mph WSW
Wind Gust: 0 mph
UV Index: 0
Precipitation: 0 mm
Clouds: 9%
Rain Chance: 0%
Visibility: 10 km
Sunrise: 4:45 am
Sunset: 9:12 pm
DailyHourly
Daily ForecastHourly Forecast
Today 10:00 pm
weather icon
10° | 12°°C 1 mm 100% 14 mph 87 % 1009 mb 0 mm/h
Tomorrow 10:00 pm
weather icon
11° | 16°°C 1 mm 100% 14 mph 96 % 1009 mb 0 mm/h
Sun Jun 08 10:00 pm
weather icon
8° | 16°°C 0 mm 0% 12 mph 88 % 1023 mb 0 mm/h
Mon Jun 09 10:00 pm
weather icon
10° | 20°°C 0 mm 0% 10 mph 89 % 1025 mb 0 mm/h
Tue Jun 10 10:00 pm
weather icon
12° | 21°°C 0.6 mm 60% 10 mph 85 % 1023 mb 0 mm/h
Today 7:00 am
weather icon
11° | 12°°C 0 mm 0% 9 mph 87 % 1005 mb 0 mm/h
Today 10:00 am
weather icon
15° | 17°°C 0 mm 0% 12 mph 72 % 1006 mb 0 mm/h
Today 1:00 pm
weather icon
20° | 20°°C 1 mm 100% 11 mph 67 % 1008 mb 0 mm/h
Today 4:00 pm
weather icon
20° | 20°°C 0.29 mm 29% 14 mph 33 % 1008 mb 0 mm/h
Today 7:00 pm
weather icon
17° | 17°°C 0 mm 0% 9 mph 46 % 1009 mb 0 mm/h
Today 10:00 pm
weather icon
13° | 13°°C 0 mm 0% 4 mph 65 % 1009 mb 0 mm/h
Tomorrow 1:00 am
weather icon
13° | 13°°C 0 mm 0% 7 mph 75 % 1008 mb 0 mm/h
Tomorrow 4:00 am
weather icon
11° | 11°°C 1 mm 100% 4 mph 96 % 1006 mb 0 mm/h
Name Price24H (%)
Bitcoin(BTC)
€89,182.89
-2.78%
Ethereum(ETH)
€2,122.15
-7.37%
Tether(USDT)
€0.87
-0.01%
XRP(XRP)
€1.84
-4.43%
Solana(SOL)
€127.71
-4.95%
USDC(USDC)
€0.87
0.00%
Dogecoin(DOGE)
€0.150741
-9.16%
Shiba Inu(SHIB)
€0.000010
-6.41%
Pepe(PEPE)
€0.000010
-9.77%
Peanut the Squirrel(PNUT)
€0.233638
-5.20%
Scroll to Top