Summary
Togoder Security scanned the npm package lightningcss@1.32.0 on Oct 6, 2026. An AI review of 5 source files produced 1 medium, 3 low severity findings. The overall verdict is medium: the findings flag risky but common patterns (dynamic code, unsafe defaults, broad file or network access) rather than confirmed malware.
Findings 4
Dynamic import with computed module name
NPS-6C18DD52DEF4
The code constructs a module name dynamically using platform, architecture, and libc detection (e.g., 'lightningcss-linux-x64-gnu') and attempts to require it. While this appears to be a legitimate pattern for loading platform-specific native binaries, the dynamic require could potentially be exploited if an attacker can influence the resolved module path or if a malicious package with a matching name exists in the registry.
Top-level code execution on import
NPS-A66B9D5EFD9D
The file executes platform detection and native module loading immediately when imported, including calling detect-libc's familySync() and attempting to load native binaries. This is typical for wrapper packages but does involve top-level filesystem access and native code loading.
Dynamic module loading with fallback
NPS-31BCA9F590D3
The try/catch attempts to require a native .node file from the parent directory if the scoped package fails. This fallback mechanism could potentially load unexpected native code if the package structure is manipulated.
Function wrapping and option modification
NPS-C1E902D1FCB9
The wrap function modifies the options object by replacing the visitor function and injecting dependency tracking. This is benign in this context but represents code that intercepts and modifies user-provided callbacks.
Files reviewed
| File | Verdict | What the reviewer saw |
|---|---|---|
| node/index.js | medium | The code appears to be a legitimate native module loader for lightningcss with platform detection, but uses dynamic require patterns and top-level execution that warrant caution. |
| node/browserslistToTargets.js | safe | Cleared by Jev triage; no further analysis needed |
| node/composeVisitors.js | safe | Cleared by Jev triage; no further analysis needed |
| node/flags.js | safe | No malicious patterns detected |
| node/index.mjs | safe | Cleared by Jev triage; no further analysis needed |
Affected version ranges
None of the 2 scanned versions of lightningcss are flagged high or critical. The latest scanned version, 1.33.0, is medium risk. Only versions we have scanned are listed; unscanned versions between them are not covered.
| Versions | Verdict | Count | Range | Top findings |
|---|---|---|---|---|
| 1.32.0 โ 1.33.0 | Needs review | 2 | >=1.32.0 <=1.33.0 | Dynamic import with computed module name |
| 1.27.0 | Not scanned | 1 | 1.27.0 |
Full list, including published versions not scanned yet: version ranges API.
Scanned versions of lightningcss
Frequently asked questions
Is lightningcss safe to use?
No confirmed malware was found in lightningcss@1.32.0, but the review flagged 1 medium, 3 low severity findings for risky patterns worth checking before you rely on it.
Does lightningcss contain malware?
No malware was identified in lightningcss@1.32.0 when Togoder Security scanned it on Oct 6, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.
How was lightningcss checked?
Togoder Security downloaded the published npm package and had an AI model read its 5 source files, looking for install scripts, credential access, network exfiltration, obfuscation, backdoors and crypto-wallet theft. The results are cached by file hash and shown here.
How do I scan lightningcss together with the rest of my dependencies?
Upload your lockfile at https://security.togoder.click/scan or call the API documented at https://security.togoder.click/api-docs. Files that have already been scanned, like the ones in lightningcss@1.32.0, cost nothing.