Malicious Code Detected in ts-tweetnacl Package - npm Vulnerability Alert
Summary
MAL-2026-247: Malicious code in ts-tweetnacl (npm). Affects ts-tweetnacl versions 0.1.3. 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 ts-tweetnacl package, version 0.1.3, is an npm library that is intended for cryptographic operations. It is built on the TweetNaCl cryptographic library, which is known for its simplicity and performance. However, this specific version has been flagged for malicious activity, as it communicates with a domain associated with harmful operations, potentially compromising user data and application integrity.
Vulnerability Detail
The vulnerability in the ts-tweetnacl package arises from its ability to communicate with a malicious domain. This behavior can lead to data exfiltration, unauthorized access, and other security risks. The OpenSSF Package Analysis project identified this issue, emphasizing the importance of scrutinizing package dependencies for malicious behavior. Users of this package should be aware that using this version may expose their applications to significant security threats.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall ts-tweetnacl
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, you can remove the ts-tweetnacl package from your project if it is not essential. You can do this by executing the command: 'npm uninstall ts-tweetnacl'. Additionally, consider using alternative libraries that provide similar functionality without the associated risks.
Conclusion
The ts-tweetnacl package has been identified as malicious due to its communication with harmful domains. It is crucial for developers to stay vigilant and regularly update their dependencies to mitigate security risks. Utilizing tools like Vulert can help in monitoring and identifying vulnerabilities in real-time.
See every vulnerability recorded for ts-tweetnacl →
FAQ
The ts-tweetnacl package is used for cryptographic operations, leveraging the TweetNaCl library for secure data handling.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit the Vulert playground at Vulert Scanner to check your application without any signup.
Using the compromised version can lead to data breaches, unauthorized access, and potential exploitation of your application by malicious actors.
Regularly audit your dependencies, use tools like Vulert for monitoring, and stay updated on security advisories related to the packages you use.
If immediate updates are not possible, consider removing the package or using alternative libraries until a secure version is available.