Dependencies rules
Checks declared third-party packages for known vulnerabilities through OSV and reviews how dependencies are pinned and sourced.
- Agent id:
dependency - Rules: 12 (source:
dependency.yaml) - Deterministic checks:
manifest_parse,osv_lookup
DEP-001: Dependency with a known vulnerability
- Severity: high
- Languages: all
- References: CWE-1395, OWASP A06:2021, OWASP A03:2025
Report each package version the OSV lookup matches to an advisory, with the advisory id, the CVE alias when there is one, and the first fixed version. Use the advisory's own severity when it gives one (critical, high, moderate as medium, low) and high otherwise. Lower it to low only when the vulnerable function is clearly unused, and say why.
DEP-002: Vulnerable version with no fix available
- Severity: medium
- Languages: all
- References: CWE-1395, OWASP A06:2021, OWASP A03:2025
For an advisory with no fixed version, say so explicitly and name the mitigation the advisory gives, or the alternative package if the project is abandoned. Do not suggest an upgrade that does not exist.
DEP-003: Version range resolves differently from what was checked
- Severity: medium
- Languages: all
Look for ranges (^, ~, >=, *, latest, no version at all) in manifests. The vulnerability lookup checks the version written in the range with its operator removed, so the installed version can differ from the one checked; read the lockfile when it exists to get the real resolved version before reporting. Exact pins and ranges backed by a committed lockfile are not violations.
DEP-004: Application without a lockfile
- Severity: medium
- Languages: all
- References: OWASP A06:2021, OWASP A03:2025
Look for an application (a deployed service, CLI or site, as opposed to a library) that declares dependencies with ranges and commits no lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock, uv.lock, Pipfile.lock, Cargo.lock, go.sum, pubspec.lock, composer.lock, Gemfile.lock). Libraries that publish ranges on purpose are not violations.
DEP-005: Dependency fetched from an untrusted source
- Severity: high
- Languages: all
- References: CWE-829, CWE-494, OWASP A08:2021, OWASP A08:2025
Look for dependencies installed from a raw URL, a Git branch, a personal fork, a tarball over plain HTTP, or an extra package index that could shadow public names (dependency confusion). A Git dependency pinned to a commit hash from the project's own organization is low; a private registry configured as the only index is not a violation.
DEP-006: Install script runs remote code
- Severity: high
- Languages: all
- References: CWE-494, OWASP A08:2021, OWASP A08:2025
Look for postinstall or preinstall scripts, setup.py code, Dockerfile steps or CI steps that pipe a downloaded script into a shell (curl ... | sh) or download a binary without checking a hash or signature. Steps that verify a checksum or use a pinned, signed package are not violations.
DEP-007: Package declared but unused
- Severity: low
- Languages: all
Look for runtime dependencies that no source file imports, and for dev tools listed as runtime dependencies. Plugins loaded by name (pytest plugins, Babel presets, ESLint configs), type stubs and CLI tools invoked from scripts count as used.
DEP-008: Package used but not declared
- Severity: high
- Languages: all
Look for third-party imports in source code that no manifest declares, so the code works only because a transitive dependency happens to pull them in. Standard library modules and packages declared in an optional extra that guards the import are not violations.
DEP-009: Unmaintained or deprecated package
- Severity: medium
- Languages: all
- References: CWE-1104, OWASP A06:2021, OWASP A03:2025
Look for packages the registry marks as deprecated or archived, or that the advisory data describes as unmaintained, and name the replacement the package itself recommends. Do not call a package unmaintained from memory of its release history; only report what the data or the package's own notice says.
DEP-010: Duplicate or conflicting declarations
- Severity: low
- Languages: all
Look for the same package declared twice with different versions, across requirements.txt and pyproject.toml, or across dependencies and devDependencies. Separate manifests for separate deployables in a monorepo are not violations.
DEP-011: Lookup failed or ecosystem unsupported
- Severity: info
- Languages: all
When the OSV lookup returns an error, or a manifest belongs to an ecosystem the check does not parse, report it once with the manifest path so the reader knows those packages were not checked. Never describe unchecked packages as safe.
DEP-012: Unpinned CI action or base image
- Severity: medium
- Languages: all
- References: CWE-829, OWASP A08:2021, OWASP A08:2025
Look for CI steps that use a third-party action by branch (uses: owner/action@main), container base images on latest or with no tag (FROM image:latest), and pull_request_target workflows that check out and run code from the pull request. Actions pinned to a commit SHA and images pinned to a digest or an exact version are not violations.