A developer’s laptop often holds more privileged access than a production server: cloud keys, package registry tokens, SSH keys, signing keys and a browser logged in to source control.
Attackers have noticed. This guide explains why developer workstation security has become a supply chain issue, how current attacks reach dev machines, and which controls reduce the blast radius without slowing engineers down.
You will find an attack chain walkthrough, a hardening checklist mapped to CIS Controls v8 and NIST CSF 2.0, and detection logic you can adapt for your EDR or SIEM.
Compromising one maintainer’s machine can push malicious code to thousands of downstream users. When the self-replicating Shai-Hulud worm hit npm in September 2025, CISA reported that it compromised more than 500 packages.
It harvested GitHub personal access tokens and AWS, GCP and Azure keys from infected environments, then used stolen npm credentials to publish poisoned versions of the victim’s other packages.
Later variants, covered in reporting on Shai-Hulud stealing npm, GitHub, AWS and Kubernetes secrets, kept the same core loop.
The secrets themselves are often easy to find. GitGuardian counted 23.8 million secrets leaked on public GitHub in 2024, a 25% rise year on year, and found that 70% of secrets leaked in 2022 were still valid. Every one of those started on a developer machine.
MITRE ATT&CK tracks harvesting of these files as Credentials In Files (T1552.001).
Install-time scripts run with the developer’s full user permissions. Typosquats, dependency confusion and hijacked maintainer accounts all use that access.
Earlier research covered malicious npm and PyPI packages that exfiltrated SSH keys, and the pattern has only grown since.
This maps to ATT&CK Supply Chain Compromise: Compromise Software Dependencies and Development Tools (T1195.001).
Editor extensions run with the same rights as the editor and are rarely reviewed. Recent incidents include the compromised Nx Console VS Code extension that stole developer and cloud secrets and the breach of GitHub internal repositories via a weaponised VS Code extension on an employee device.
Attackers publish polished repositories for trading bots, CLI utilities or “AI coding” helpers and promote them where developers look for shortcuts.
Interest in AI coding tools has widened the pool of unfamiliar plug-ins and agents that engineers install with little review.
Crypto developers are a favoured target: someone who checks the SOL price between builds may also keep a funded Solana keypair in the project folder, exactly the file a malicious dependency searches for.
Once a token is stolen, an attacker can move from the laptop to pipelines. The GhostAction campaign injected malicious GitHub Actions workflows to exfiltrate CI/CD secrets, showing how a single personal access token can expose every repository it can write to.
The following scenario is illustrative and combines techniques seen in public incidents.
Each step after the first depends on a long-lived credential sitting in plain text. Removing those credentials breaks the chain far more reliably than trying to detect every malicious package.
The controls below are grouped by the asset they protect. Mappings are to CIS Controls v8 and NIST CSF 2.0.
| Area | Control | Mapping |
|---|---|---|
| Secrets | Replace static cloud keys with short-lived SSO credentials (for example aws sso login, workload identity federation) | CIS 6.x; CSF PR.AA |
| Secrets | Load app secrets from a secrets manager or a password manager CLI at runtime rather than .env files | CIS 3.11; CSF PR.DS |
| Source control | Fine-grained, expiring tokens; phishing-resistant MFA on GitHub and registry accounts; pre-commit secret scanning | CIS 6.5, 16.x; CSF PR.AA |
| SSH | Hardware-backed keys (ed25519-sk) or keys held in an agent; short-lived SSH certificates | CIS 6.x; CSF PR.AA |
| Packages | Lockfiles, pinned versions, install scripts disabled by default, internal registry proxy with quarantine for new versions | CIS 16.4; CSF GV.SC |
| IDE | Extension allow-list managed centrally; block side-loaded VSIX files | CIS 2.5; CSF PR.PS |
| Isolation | Run untrusted code in dev containers or cloud workspaces without access to the host home directory | CIS 4.x; CSF PR.IR |
| Endpoint | EDR on dev machines with rules tuned for build tools rather than exclusions for them | CIS 10.x, 13.x; CSF DE.CM |
Disable npm lifecycle scripts by default and allow them only for packages you trust:
# ~/.npmrc
ignore-scripts=true
# then run trusted builds explicitly
npm rebuild –ignore-scripts=false <package>
Generate a hardware-backed SSH key that requires a physical touch for each use:
ssh-keygen -t ed25519-sk -O resident -O verify-required -C “dev-laptop”
Add a pre-commit secret scan so secrets are caught before they reach a remote:
# .pre-commit-config.yaml
repos:
– repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4 # pin to the version your team has approved
hooks:
– id: gitleaks
Developer machines generate noisy process trees, which is why many teams exclude build tools from EDR.
That is exactly where attackers hide. Instead of broad exclusions, write narrow detections for behaviour that legitimate builds rarely show.
This KQL-style query looks for package manager child processes reading credential files. Adapt table and field names to your EDR.
DeviceFileEvents
| where InitiatingProcessParentFileName in~ (“node”,”npm”,”npx”,”pnpm”,”yarn”,”python”,”pip”)
| where FolderPath has_any (“.aws”, “.ssh”, “.npmrc”, “.kube”, “.config/gcloud”, “id.json”)
or FileName endswith “.env”
| where ActionType in (“FileRead”,”FileAccessed”)
| summarize Files = make_set(FileName), Count = count()
by DeviceName, InitiatingProcessCommandLine, bin(Timestamp, 10m)
| where Count > 3
Controls that slow builds get bypassed. Ship them as defaults in a managed dev image or bootstrap script, so a new laptop arrives with short-lived cloud login, the npm and pip settings above, the pre-commit hooks and the approved extension list already in place.
Track exceptions in the same ticketing system as other security risks and review them quarterly, so a temporary allowance for one package does not become permanent.
Remove static keys where possible by using SSO-based short-lived credentials, load remaining secrets at runtime from a secrets manager, and run pre-commit secret scanning.
They usually use install-time lifecycle scripts that run with your user permissions, read files such as .npmrc, .env and cloud credential files, and send them to an attacker server.
Yes, at minimum. Better still, use hardware-backed keys such as ed25519-sk or short-lived SSH certificates so a copied key file is useless on its own.
They can be. Extensions run with the editor’s permissions and have been used to steal secrets, so organisations should allow-list approved extensions and block side-loading.
Every credential the machine could access: cloud keys, package registry tokens, source control tokens, SSH keys, signing keys and any secrets in local .env files.
OpenAI has launched GPT-6 Cyber, a security-focused AI model that found 81 new high-severity Firefox…
Shopify is making IP allowlisting mandatory for public apps that call its Admin API, adding…
Microsoft’s Windows Paint vulnerability, CVE-2026-83844, could allow an unauthenticated attacker to execute code over a…
Melbourne, Florida, November 5th, 2026, CyberNewswire OpenMatter Network, a pioneer in decentralized infrastructure for agentic…
A new Android bug named GhostMap can leave a phone stuck in a crash loop…
A China-aligned hacking group is abusing Sogou Input Method, one of the most popular Chinese…