Poisoned Pipeline / Incidents / AS380

AS380 · 2022-02

Invisible-character npm packages abused .npmrc and .yarnrc to run code

npm

Snyk researchers showed that npm and yarn read project-local configuration
files that can redirect execution: yarnPath in .yarnrc, and git, shell or
script-shell in .npmrc. A repository containing one of those files makes the
package manager execute an attacker-supplied binary in the project directory on
the next install, and --ignore-scripts does not prevent it. The researchers
combined this with invisible Unicode characters so the redirect does not appear
in a normal diff or code review. Recorded as research: the finding is a
technique demonstration rather than a named victim incident, and it is the
mechanism later seen in real packages.

Mapped techniques

supply-chain Invisible-character npm packages abused .npmrc and .yarnrc t

T0151 · Execution · Installation scripts

Package-manager configuration redirected execution at install.

T0176 · Defense Evasion · Disable or misconfigure security measures

The trampoline file hid in plain sight and survived --ignore-scripts.

Sources