Web Security

Security concepts guides

Developer-focused explanations of race conditions, dependency confusion, trivial packages, and package hijacking.

What these guides cover

These guides explain supply-chain and concurrency failures that show up in application code and in the package graph, not only in a network scan. A race condition is a TOCTOU gap between a check and a write. Dependency confusion is a public package that wins over a private name. A trivial package is a one-liner that an ecosystem later cannot delete safely. Package hijacking is a trusted name that starts serving someone else's code. Each article defines the failure, shows how it is executed, and lists the controls that close it.

Risks

  • Check-then-act gaps on coupons, balances, and inventory
  • Internal package names resolved from a public registry
  • One-line dependencies that become unmaintained attack surface
  • Compromised maintainer accounts, expired domains, and repo jacking

Control priorities

  • Atomic writes, unique constraints, and idempotency keys
  • Scoped registries, lockfiles, and private-package prefixes
  • Native language APIs instead of trivial packages
  • 2FA, domain control, and release automation for publishes

Recommended reading order

Read the four guides as a cluster. Start with the failure that matches your incident: race conditions for concurrent writes, dependency confusion for private registries, trivial packages for dependency bloat, and package hijacking for a compromised publish.

Guides in this collection