Malicious Code Detected in csp-presets-pack: A Critical Security Alert
Summary
MAL-2025-17783: Malicious code in csp-presets-pack (npm). Affected versions are not published. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The csp-presets-pack is an npm package designed to provide preset configurations for Content Security Policy (CSP) headers, enhancing web application security by mitigating risks such as cross-site scripting (XSS). However, recent findings have revealed that this package contains malicious code, posing significant risks to applications that utilize it.
Vulnerability Detail
The vulnerability in csp-presets-pack stems from the inclusion of malicious code that can compromise the security of applications using this package. This code may lead to unauthorized access, data breaches, or other malicious activities. The issue was introduced in version 0 and affects all subsequent versions, making it imperative for developers to take immediate action to safeguard their applications.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall csp-presets-pack
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, consider using alternative packages that provide similar functionality without the associated risks. Always review the security status of any package before integrating it into your project.
Conclusion
The discovery of malicious code in the csp-presets-pack package highlights the importance of vigilance in managing open-source dependencies. Developers should act swiftly to remove this package and explore safer alternatives to protect their applications from potential threats.
See every vulnerability recorded for csp-presets-pack →
FAQ
csp-presets-pack is an npm package that offers preset configurations for Content Security Policy headers to enhance web application security.
The malicious code can lead to unauthorized access and data breaches, posing serious security risks to applications that use this package.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Simply upload your package-lock.json file to the Vulert playground at Vulert Scanner to check for vulnerabilities.
Currently, there is no patched version available. It is recommended to uninstall the package until a secure alternative is found.
Immediately uninstall the package using 'npm uninstall csp-presets-pack' and consider using alternative packages that do not have known vulnerabilities.