Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Trail of Bits 21 min read Research mediumAdept

Package managers have an integrity problem

An experiment across 25 popular package managers tested whether each detects a compromised repository injecting malicious code into legitimate packages. Fewer than half verify lockfile hashes by default, only Go and vcpkg verify every download, and only Go checks signatures by default. The tests used a Docker and mitmproxy harness that simulated a malicious server. Several failures are documented design choices rather than bugs: Pub and older pnpm overwrite mismatched hashes, Conan and CocoaPods use MD5 or SHA-1 identifiers that are never rechecked, Composer trusts GitHub-served ZIPs, and cpanminus still uses plain HTTP. Lockfiles serve many purposes besides integrity, which helps explain the gaps.

Assumes: lockfiles and dependency resolutioncryptographic hashes and signaturessupply-chain attacks

Related posts

  • Securing the Docker MCP Catalog: Commit Pinning, Agentic Auditing, and Publisher Trust Levels

    Docker mediumAdept

    Docker's MCP Registry now pins every Docker-built MCP server to a specific Git commit, enforced in CI and propagated to the org.opencontainers.image.revision label, so builds are deterministic and verifiable with docker inspect or cosign. A nightly workflow bumps pins via per-server PRs, and each incoming change gets an agentic security review by Claude Code and OpenAI Codex. The reviewers are treated as untrusted: they run in a Docker Compose stack with read-only code mounts, no Internet access, a fixed-file output directory, and a reverse proxy that injects API keys so secrets never enter the container. Risk labels map to GitHub status checks (critical blocks merge), and the catalog adds publisher trust indicators distinguishing known publishers from community servers.

  • From single pull requests to full software packages: Detecting malicious code at scale

    Datadog Engineering mediumAdept

    Datadog extended BewAIre, its LLM-based malicious code detector, from pull requests to full dependency packages by stacking a cheap filter model in front of an agentic investigation model. The agent uses GitHub APIs, osv.dev and SCA to check context such as author history and reverted commits. On 690 test diffs the two-stage design raised accuracy from 97.4% to 99.86% by cutting false positives from 17 to 0, and static typosquat-domain checks cover gaps in the filter. For large packages, giving the agent a codemap plus an on-demand ReadFile tool beat both forwarding the flagged chunk and rechunking, reaching 95.2% end-to-end accuracy with no runtime errors. Projected costs are about $0.025 per median package and $0.072 at p90, and a crawler polls npm and PyPI every 10 minutes, caching verdicts by hash and diffing against the previous version.

  • Dependency prefixes are a supply chain risk: let's fix them

    Sourcegraph mediumAdept

    SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install. The recommended controls are to commit lockfiles and install with npm ci, pnpm --frozen-lockfile or yarn --immutable, pin exact versions for high-blast-radius packages such as build tools, auth libraries and native-binding deps, set save-exact defaults, disable install scripts with an allowlist for exceptions, and run audits against the locked tree. To roll this out across hundreds of repositories, a Sourcegraph Batch Changes spec with a Node script rewrites React dependency ranges to approved exact versions and refreshes lockfiles without running scripts.

  • Defending Your Software Supply Chain: What Every Engineering Team Should Do Now

    Docker mediumAdept

    Recent supply chain compromises (the axios npm hijack attributed to Lazarus Group, the TeamPCP campaign via Trivy's GitHub Action, Shai-Hulud, GlassWorm) share one root cause: implicit trust in mutable tags, broad long-lived tokens and unsandboxed runners. The recommended defenses start with pinning Actions to commit SHAs and images to digests, using lock files with npm ci, and applying 3-day cooldowns on new dependency versions, since most malicious releases live only hours. Further layers are short-lived scoped CI credentials, avoiding pull_request_target, artifact proxies and build-time SBOMs, plus canary tokens and credential cleanup on developer machines. AI coding agents should run in microVM sandboxes and MCP servers should be governed. Many recommendations are paired with Docker products such as Hardened Images, Scout, Sandboxes and MCP Gateway.

  • How Software Bill of Materials change the dependency game

    Zalando Engineering mediumAdept

    Zalando generates a Software Bill of Materials from the container image of every deployed application and publishes the dependency data to its data lake, so any engineer can query which apps use a library version, which licenses are in use, and how fast upgrades are adopted. This made CVE and license-change impact analysis (log4j, Akka) take minutes, enabled automated mass pull requests for patches, and exposed waste such as apps bundling the full 200MB+ AWS Java SDK. Their data shows dependency counts rising steeply by language: Python has the fewest, Go roughly 1.4-2x more, JVM 2-3x more than Go, and JavaScript 5-10x more than Java. SBOM quality is uneven: JVM package naming is inconsistent and uber-jars strip the metadata scanners need, so generation should be verified per application.

The quest for software engineering knowledge.

Look:
Layout: