actions/setup-node is used to setup a node environment. It supports a cache flag which calls npm or yarn under the hood in order to cache dependencies.
I haven't fully analyzed this, but have validated the yarn case on a disclosure that is currently in progress.
If an attacker sees a workflow that checks out PR code and has the following:
Description of the LOTP tool
actions/setup-node
is used to setup a node environment. It supports acache
flag which calls npm or yarn under the hood in order to cache dependencies.I haven't fully analyzed this, but have validated the yarn case on a disclosure that is currently in progress.
If an attacker sees a workflow that checks out PR code and has the following:
Then they can simply set the
yarnPath
config field in the.yarnrc.yml
file from their fork and point it to a simple payload javascript file, like so:Configuration files
Documentation
https://yarnpkg.com/configuration/yarnrc
Real-world example
Pending :)