Package Managers, Registries, Dependency and Ecosystem Security — DedSec Project
Package Managers, Registries, Dependency and Ecosystem Security Dependency risk is an ecosystem problem involving names, versions, maintainers, registries, resolver behavior, lockfiles…
Dependency risk is an ecosystem problem involving names, versions, maintainers, registries, resolver behavior, lockfiles, mirrors, build scripts, and transitive trust. This module focuses on how to control dependency introduction and detect suspicious changes.
Learning objectives
By the end of this module you should be able to:
- Explain Name and namespace trust and connect it to a concrete trust boundary or security invariant.
- Explain Semantic versioning limits and connect it to a concrete trust boundary or security invariant.
- Explain Lockfiles and connect it to a concrete trust boundary or security invariant.
- Explain Install/build scripts and connect it to a concrete trust boundary or security invariant.
- Explain Transitive dependencies and connect it to a concrete trust boundary or security invariant.
- Explain Maintainer and release trust and connect it to a concrete trust boundary or security invariant.
Deep concepts
1. Name and namespace trust
Typosquatting, namespace confusion, abandoned packages, and internal/public name collisions can redirect developers to unintended code. Reserve important names and define registry precedence.
2. Semantic versioning limits
Version ranges express compatibility intent, not security trust. A syntactically compatible update can still add risky behavior. Know when production builds are pinned and when updates are deliberately refreshed.
3. Lockfiles
Lockfiles make resolved dependency graphs more reproducible, but their integrity and review matter. They should change for explainable reasons and be included in code review.
4. Install/build scripts
Package lifecycle hooks and native builds may execute code during installation. Treat dependency installation as code execution, especially in CI and developer environments.
5. Transitive dependencies
Most projects depend on far more packages than are listed directly. Generate an SBOM/dependency graph, identify critical/transitively privileged packages, and reduce unnecessary depth.
6. Maintainer and release trust
Protect maintainer accounts, use strong MFA, separate release authority, monitor ownership changes, and verify release automation. Package metadata alone does not prove source provenance.
7. Mirrors and proxies
Internal registries can enforce allowlists, caching, provenance, scanning, and namespace policy. They also become high-impact infrastructure that requires backup, access control, and monitoring.
8. Response
When a dependency is compromised, identify affected versions, where they were built/deployed, what execution privileges they had, and whether credentials or build artifacts need rotation/rebuild—not just a version bump.
Authorized exercises
Exercise 1 — Create a dependency inventory for a small harmless Python project and classify direct vs transitive packages
Create a dependency inventory for a small harmless Python project and classify direct vs transitive packages.
Exercise 2 — Compare reproducibility with and without a lockfile or fully pinned requirements in an isolated virtual environment
Compare reproducibility with and without a lockfile or fully pinned requirements in an isolated virtual environment.
Exercise 3 — Write an incident checklist for a compromised package version: identify exposure, builds, credentials, artifacts, and verification steps
Write an incident checklist for a compromised package version: identify exposure, builds, credentials, artifacts, and verification steps.
Knowledge checks
- Explain the most important trust boundary in Package Managers, Registries, Dependency and Ecosystem Security without naming a security tool.
- Give one example where cryptographic or authentication success still does not imply authorization success.
- Describe one stale-state or replay condition relevant to this module.
- Identify one telemetry source that can support a strong conclusion and one blind spot it still leaves.
- Explain how you would turn a discovered weakness into a regression test rather than a one-time finding.