← All writing
Engineering / FIELD NOTES

Your next dependency should not get the keys to everything

A dependency install can become a credential breach. Isolated development environments and smaller secret exposure should be everyday engineering practice.

How much of your laptop can a dependency reach when you install it? On a normal development machine, that can include source code, cloud credentials, registry tokens, and SSH material. Quite a lot of access for an ordinary setup command.

In my opinion, developing inside a deliberately restricted container or VM should be an everyday practice. Give it only the access it needs, so one compromised dependency cannot take your entire working life with it.

What happened this year

We’ve seen the same pattern across package registries and editor extensions:

  • March: Socket reported a GlassWorm wave involving 72 malicious Open VSX extensions, followed by more malicious and sleeper extensions. Some initially harmless extensions became delivery mechanisms through later updates. Socket’s investigation documents that progression.
  • May: TanStack’s maintainers reported 84 malicious versions across 42 packages, published during a six-minute window. The attack chained workflow misconfiguration, cache poisoning, and token extraction. See the TanStack postmortem.
  • May: A malicious Nx Console release reached the Visual Studio Marketplace. The maintainer advisory puts its availability at approximately 18 minutes. The Nx postmortem traces the initial credential theft to a contributor’s earlier installation of a compromised TanStack package.
  • August: Microsoft’s ChainDrop investigation described a self-propagating worm spreading through the npm supply chain and harvesting credentials to extend its reach.

What stands out to me is the connection between TanStack and Nx. A compromised dependency on one developer’s machine gave an attacker access to another project’s distribution channel.

And you know, the malicious release doesn’t need to stay available for very long. The consequences can continue long after it’s gone.

What can the code actually access?

An install script runs with the permissions of the process that started it. If your user can read a credential file, the package doesn’t need administrator access to read it too.

The same goes for editor extensions, build tools, and coding agents. We’re adding executable code to an environment that may also hold the keys to production.

But putting development inside a container only helps if we pay attention to what crosses that boundary. Mount your whole home directory, expose the Docker socket, or pass in production credentials, and malicious code can still reach valuable resources. Forwarded agents and shared credentials give it capabilities too, even if the actual key file stays outside.

The idea is simple: give the environment the project files and permissions it needs, and keep the rest outside.

Six defaults I would start with

  1. Develop inside a restricted container or VM. Mount only the workspace you need, avoid privileged execution, and keep personal files and production credentials out. Also check where your editor extensions and agent tools actually run. Having a terminal in a container doesn’t isolate an extension running on the host.
  2. Disable automatic install scripts by default. For npm, use npm config set ignore-scripts true. Review the build steps you need before enabling them. Some dependencies won’t work without these scripts, and explicitly running a script still executes it. The npm configuration documentation explains the scope of this setting. This setting doesn’t prevent malicious code from running when you later import or execute a package.
  3. Use short-lived, narrowly scoped credentials. Prefer temporary sessions over permanent cloud keys sitting in your home directory. A stolen temporary token can still be used while it’s valid, so its permissions need limits too.
  4. Keep secrets in a vault or password manager. Inject only what a task needs, for as long as it needs it. Once a secret enters a process or environment, code with access can still steal it. A vault helps reduce unnecessary exposure, but it can’t protect a secret we hand to malicious code.
  5. Pin versions and commit lockfiles. Review dependency changes and give ordinary new releases some time for scrutiny. A lockfile makes dependency resolution repeatable; it doesn’t tell you whether a dependency is safe. And apply urgent security fixes promptly. A waiting period shouldn’t become a rule we follow blindly.
  6. Audit editor extensions. Keep fewer of them, check publishers and permissions, and remove tools you no longer use. A familiar name or a clean previous version doesn’t guarantee that the next update is safe.

I see these as ordinary development practices. They won’t give us perfect protection, but they reduce what one compromised tool can reach.

We can’t guarantee that every tool we install is safe. What we can decide is how much access we give it.

Have a different perspective? Let’s compare notes.

Email me ↗