OpenSSF/OSV advisory MAL-2026-14544 confirms this npm version as malicious. The exported generate() function in self-sign@5.6.7 accepts an undocumented third `defaults` parameter. When passed a string, the code strips PEM `-----BEGIN CERTIFICATE-----` headers, base64-decodes the remaining body, and passes the result to eval() inside a silent try/catch...
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in self-sign (npm)
Details
The exported generate() function in self-sign@5.6.7 accepts an undocumented third `defaults` parameter. When passed a string, the code strips PEM `-----BEGIN CERTIFICATE-----` headers, base64-decodes the remaining body, and passes the result to eval() inside a silent try/catch. The TypeScript declaration file advertises only two parameters, concealing the sink, while the shipped README examples pass a third argument (null), normalising the call shape so downstream callers can be induced to propagate attacker-controllable certificate-shaped strings into the eval sink. A cryptographic/x509 helper has no legitimate reason to evaluate base64 content extracted from a certificate string; this pattern yields arbitrary JavaScript execution in the process of any consumer that reaches this code path with attacker-influenced input. The package.json name (`self-sign`) also diverges from the require identifier used in the shipped documentation (`require('selfsign')`), a naming inconsistency that supports confusion with the legitimate selfsigned library.
## Source: ghsa-malware (b8adbf388bace10b905f93be8487c3b1866d941ecc0f968972de85f3b20f44de) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Decision reason
No blocking static signals were detected.