Malicious code in self-sign (npm)
Description
The npm package self-sign contains malicious code in its generate() function in version 5.6.7 and related versions. This function accepts an undocumented third parameter that, when passed a string, strips certificate headers, base64-decodes the content, and evaluates it with eval(), enabling arbitrary JavaScript execution. The package name and require identifier mismatch may cause confusion with a legitimate library. Any system with this package installed should be considered fully compromised, and secrets should be rotated immediately.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The self-sign npm package versions including 5.6.1 through 5.6.9 (specifically =5.6.1, =5.6.2, =5.6.3, =5.6.4, =5.6.5, =5.6.6, =5.6.7, =5.6.8, =5.6.9) contain a malicious code pattern in the exported generate() function. This function accepts an undocumented third parameter 'defaults' which, if passed a string, strips PEM certificate headers and base64-decodes the body, then passes the decoded content to eval() inside a silent try/catch block. This behavior is concealed by the TypeScript declaration file and README examples, allowing downstream callers to unknowingly propagate attacker-controlled input into an eval sink, resulting in arbitrary code execution. The package name differs from the require identifier used in documentation, potentially causing confusion with the legitimate selfsigned library. The presence of this package indicates a fully compromised system.
Potential Impact
Systems with the affected self-sign package installed are considered fully compromised due to arbitrary code execution via the eval() call on attacker-controlled input. This can lead to complete system takeover, exposure of secrets, and unauthorized control. All secrets and keys on affected systems should be rotated immediately from a secure environment. Removing the package alone does not guarantee removal of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is indicated in the provided data. Immediate removal of the self-sign package versions listed is recommended. Treat any system with this package as fully compromised and rotate all secrets and keys from a different, secure system. Investigate for potential persistence or additional malicious software installed as a result of this compromise. Monitor for any unusual activity and consider rebuilding affected systems.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14544
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-9jvg-g3cg-g557"]
- Ecosystems
- ["npm"]
Threat ID: 6a905405acd9273b4969731c
Added to database: 08/27/2026, 15:13:09 UTC
Last enriched: 09/10/2026, 06:37:57 UTC
Last updated: 10/03/2026, 08:44:32 UTC
Views: 24
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.