Malicious code in self-certificates (npm)
Description
The npm package 'self-certificates', advertised as a self-signed TLS certificate generator, contains malicious code embedded within a fake RSA private key file (test/key.pem). This file's base64-decoded content is JavaScript that fetches data from a remote URL and executes it via a detached, hidden Python process. The package uses a PEM wrapper to smuggle JavaScript code that is then executed by a dependency, effectively acting as a multi-stage dropper for arbitrary attacker-controlled code on the installer's machine. Installation or use of this package can lead to full system compromise.
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-certificates' npm package includes a malicious payload disguised as a self-signed TLS certificate. The key.pem file contains base64-encoded JavaScript that, when decoded and executed by the 'self-sign' dependency, fetches remote code from 'https://aptupdate.org/settings/privacy.php' and executes it in a hidden Python3 process. This technique uses a PEM format wrapper to smuggle and execute arbitrary code, resulting in a multi-stage dropper that compromises the host system upon installation or execution of the package.
Potential Impact
Any system with this package installed or running is considered fully compromised. The attacker gains arbitrary code execution capabilities, potentially leading to complete control over the affected machine. All secrets and keys stored on the compromised system should be considered exposed and must be rotated immediately from a secure, unaffected 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 available data. Immediate removal of the 'self-certificates' package is recommended. Due to the high likelihood of full system compromise, all credentials and keys stored on the affected system should be rotated from a different, secure machine. Conduct a thorough investigation and system remediation to ensure no persistent malicious code remains.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14543
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-rwg4-cx82-h5hq"]
- Ecosystems
- ["npm"]
Threat ID: 6a905405acd9273b4969731e
Added to database: 08/27/2026, 15:13:09 UTC
Last enriched: 09/10/2026, 06:25:04 UTC
Last updated: 10/01/2026, 22:11:15 UTC
Views: 85
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.