LWA-2026-2827 MAL-2026-5242 ↗ confirmed malware

creditcard.js@2.1.8

Malicious code in creditcard.js (npm)

T1140 · Deobfuscate/Decode Files or InformationT1027 · Obfuscated Files or Information

Analysis

This is a compromised/trojanized build of the popular creditcard.js credit-card validation library. The legitimate package ships only its dist/ bundle, but this version adds an extra package-root index.js containing a heavily obfuscated payload. The payload is hidden behind two layers of obfuscation: an outer Caesar-cipher decoder fed a roughly 600k-element character-code array, and inner AES-128-GCM-encrypted blobs decrypted at load time with hardcoded keys and IVs via node:crypto. Once decoded, the payload uses node:child_process to silently download the Bun JavaScript runtime from a GitHub releases URL (curl), unzip it into a temporary directory, and chmod it executable. This stages a separate runtime so a follow-on payload can run outside Node, bypassing Node-based security tooling. None of this behaviour relates to credit-card validation; it is an obfuscated dropper injected into a trusted package name.

analyzed by
Leitwacht
first seen
Jun 7, 2026, 09:27 PM
analyzed
Jun 28, 2026, 06:10 AM
weekly installs
10,691

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.