Togoder security

npm package security report

lightningcss npm package: is it safe?

Risky patterns found that deserve a look.

Needs review Version 1.33.0 Files reviewed 5 Size 14.6 KB Scanned

Summary

Togoder Security scanned the npm package lightningcss@1.33.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.

0
critical
0
high
1
medium
3
low

Findings 4

medium

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.

node/index.js:15
low

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.

node/index.js:1
low

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.

node/index.js:15
low

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.

node/index.js:24

Files reviewed

FileVerdictWhat 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.

1.27.01.33.0
VersionsVerdictCountRangeTop 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

VersionVerdictFilesScanned
1.33.0 Needs review 5 Oct 6, 2026
1.32.0 Needs review 5 Oct 6, 2026

Frequently asked questions

Is lightningcss safe to use?

No confirmed malware was found in lightningcss@1.33.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.33.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.33.0, cost nothing.

Related security reports