Node.js Users Beware: Manifest Confusion Attack Opens Door to Malware

Share:

The npm registry for the Node.js JavaScript runtime environment is susceptible to what’s called a manifest confusion attack that could potentially allow threat actors to conceal malware in project dependencies or perform arbitrary script execution during installation.

“A npm package’s manifest is published independently from its tarball,” Darcy Clarke, a former GitHub and npm engineering manager, said in a technical write-up published last week. “Manifests are never fully validated against the tarball’s contents.”

“The ecosystem has broadly assumed the contents of the manifest and tarball are consistent,” Clarke added.

The problem, at its core, stems from the fact that the manifest and package metadata are decoupled and that they are never cross-referenced against one another, thereby leading to unexpected behavior and misuse when there is a mismatch.

As a result, a threat actor could exploit this loophole to publish a module with a manifest file (package.json) that contains hidden dependencies as well as run install scripts, which could then pave the way for a supply chain attack and the poisoning of a developer’s environment.

“Manifest confusion becomes problematic in development environments without effective DevSecOps workflows and tooling in place, especially when applications blindly trust application manifests rather than the actual (vulnerable or malicious) files contained within open source packages,” Sonatype researcher and journalist Ax Sharma said.

The finding underscores the fact that metadata contained within package manifest files alone cannot be relied upon when downloading a package from the open-source repository, necessitating that users take steps to scan packages for any anomalous features and exploits.

Manifest Confusion Attack

GitHub, per Clarke, is said to be aware of the problem since at least early November 2022, with the Microsoft subsidiary stating it plans to address it internally as of March 2023. The issue, however, remains unresolved to date.

In the absence of an official fix, security researcher Felix Pankratz has made available a Python script that can be used to test for mismatches between the manifests in npm modules.

The development also comes as developer security company Snyk, in partnership with Redhunt Labs, examined 11,900 repositories from the top 1,000 GitHub organizations for insecure dependencies, uncovering 1,229,601 flaws in 15,584 vulnerable dependency files.

Deserialization of untrusted data was the most prevalent vulnerability type with a whopping 130,831 occurrences in Java repositories, making it 40 percent of the total vulnerabilities identified,” the study said.

In JavaScript-based projects, prototype pollution emerged as the leading shortcoming with 343,332 occurrences. Denial-of-service (DoS) flaws contributed to the most in Python and Ruby projects with 19,652 and 56,331 occurrences, respectively.

“The threat of vulnerable dependencies disrupting the state of security of software supply chains is here to stay,” security researchers Umair Nehri and Vandana Verma Sehgal said. “So, developers must be careful with the dependencies they use in their projects and keep them up-to-date to keep them patched from any known vulnerabilities.”

 

(c) The Hacker News

Leave a Comment

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

loader-image
London, GB
11:12 am, Jul 1, 2025
weather icon 31°C
L: 29° | H: 32°
overcast clouds
Humidity: 51 %
Pressure: 1012 mb
Wind: 5 mph
Wind Gust: 0 mph
UV Index: 0
Precipitation: 0 mm
Clouds: 97%
Rain Chance: 0%
Visibility: 10 km
Sunrise: 4:47 am
Sunset: 9:20 pm
DailyHourly
Daily ForecastHourly Forecast
Today 10:00 pm
weather icon
29° | 32°°C 0 mm 0% 10 mph 61 % 1014 mb 0 mm/h
Tomorrow 10:00 pm
weather icon
18° | 22°°C 1 mm 100% 10 mph 88 % 1023 mb 0 mm/h
Thu Jul 03 10:00 pm
weather icon
13° | 26°°C 0 mm 0% 9 mph 56 % 1029 mb 0 mm/h
Fri Jul 04 10:00 pm
weather icon
15° | 26°°C 0 mm 0% 9 mph 50 % 1028 mb 0 mm/h
Sat Jul 05 10:00 pm
weather icon
16° | 23°°C 1 mm 100% 14 mph 93 % 1021 mb 0 mm/h
Today 1:00 pm
weather icon
29° | 30°°C 0 mm 0% 7 mph 47 % 1013 mb 0 mm/h
Today 4:00 pm
weather icon
32° | 32°°C 0 mm 0% 10 mph 37 % 1012 mb 0 mm/h
Today 7:00 pm
weather icon
31° | 31°°C 0 mm 0% 10 mph 33 % 1012 mb 0 mm/h
Today 10:00 pm
weather icon
23° | 23°°C 0 mm 0% 8 mph 61 % 1014 mb 0 mm/h
Tomorrow 1:00 am
weather icon
20° | 20°°C 0 mm 0% 6 mph 70 % 1015 mb 0 mm/h
Tomorrow 4:00 am
weather icon
19° | 19°°C 0 mm 0% 5 mph 79 % 1016 mb 0 mm/h
Tomorrow 7:00 am
weather icon
18° | 18°°C 0 mm 0% 6 mph 76 % 1016 mb 0 mm/h
Tomorrow 10:00 am
weather icon
22° | 22°°C 0 mm 0% 4 mph 62 % 1016 mb 0 mm/h
Name Price24H (%)
Bitcoin(BTC)
€90,456.75
-0.83%
Ethereum(ETH)
€2,085.61
0.27%
Tether(USDT)
€0.85
0.00%
XRP(XRP)
€1.87
1.43%
Solana(SOL)
€126.47
-0.65%
USDC(USDC)
€0.85
0.00%
Dogecoin(DOGE)
€0.136910
-2.17%
Shiba Inu(SHIB)
€0.000009
-1.80%
Pepe(PEPE)
€0.000008
-3.39%
Scroll to Top