Join our Newsletter — 33% off our NHI Course
Home FAQ Cyber Security Why do malicious packages matter if a dependency…
Cyber Security

Why do malicious packages matter if a dependency scanner is already in place?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated August 20, 2026 Domain: Cyber Security

Dependency scanners mainly detect known CVEs, but malicious packages often have no published vulnerability record. They may use typosquatting, dependency confusion, or post-install scripts to run harmful code before any database can flag them. Behavioural analysis is what closes that gap and catches intent, not just known defects.

Why This Matters for Security Teams

A dependency scanner is useful, but it is only one layer of supply chain defence. Scanners are strongest when the risk is already known: a published CVE, a matching package name, or a recognised version range. Malicious packages exploit the blind spots outside that model, especially when the code is intentionally harmful at first install or activated only under certain conditions. NIST’s NIST SP 800-53 Rev 5 Security and Privacy Controls is a useful anchor here because it treats software acquisition, integrity, and monitoring as separate control concerns, not a single scan result.

The real issue is trust. A package can be “clean” from a CVE perspective and still be malicious through typosquatting, dependency confusion, credential theft, or hidden post-install behaviour. That means security teams need to think beyond vulnerability management and into provenance, publisher trust, build-time execution, and runtime observation. The question is not whether the package has a known flaw, but whether the package itself is the threat.

In practice, many security teams encounter malicious packages only after the build pipeline has already executed them, rather than through intentional pre-install review.

How It Works in Practice

Malicious packages usually succeed because they blend into normal software delivery. A scanner that checks package metadata or compares version numbers against vulnerability databases may see nothing suspicious. The package can still execute code during installation, import time, or first use. That is why package risk assessment needs to combine static checks with behavioural and provenance-focused controls.

At a practical level, teams should treat dependency security as a chain of decisions, not a single verdict. Useful controls include:

  • Verifying package sources and publisher identity before approval.
  • Restricting direct access to public registries through allowlists or internal mirrors.
  • Blocking or reviewing install scripts, especially for packages with elevated build permissions.
  • Monitoring for unusual network calls, file changes, token access, or process spawning during CI and test runs.
  • Scanning for dependency confusion risk by comparing private namespace patterns with public registry naming.

Guidance from the OWASP Software Supply Chain Security Cheat Sheet and the CISA secure software development resources points in the same direction: trust the package less, and inspect the behaviour more. Behavioural analysis is especially important when build systems run with broad secrets access, because a single compromised install step can expose tokens, signing keys, or cloud credentials before any alert fires.

For higher assurance, organisations should also preserve package provenance through signed artefacts, reproducible builds where possible, and SBOM-based inventory that ties dependencies to source and build outputs. That gives incident responders a way to answer not only “what version was used” but also “what exactly ran during the build.” These controls tend to break down in fast-moving CI environments with ephemeral runners and broad write access, because install-time execution happens faster than review can be applied.

Common Variations and Edge Cases

Tighter package controls often increase developer friction and build overhead, requiring organisations to balance delivery speed against supply chain assurance. That tradeoff becomes sharper in polyglot environments, where one application may pull from npm, PyPI, Maven, NuGet, and container registries at once. There is no universal standard for package trust scoring yet, so current guidance suggests combining policy, provenance, and runtime detection rather than relying on a single gate.

Edge cases matter. Internal packages can be just as dangerous as public ones if publishing controls are weak or namespace ownership is unclear. Open source mirrors can also create false confidence if they replicate malicious content without additional validation. In AI-adjacent pipelines, the same problem extends to model artefacts, plugin ecosystems, and tool connectors, where a dependency scanner may miss harmful logic packaged as a benign integration.

The safest pattern is to define which package events are allowed to execute automatically, which require human approval, and which must be sandboxed. Teams should also distinguish between “known vulnerable” and “untrusted by design.” That distinction is what turns dependency scanning from a compliance checkbox into a practical control. Where organisations assume internal package registries are inherently safe, malicious packages often slip through because trust was granted to the source, not earned by the artefact.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while NIST CSF 2.0, NIST AI RMF and NIST AI 600-1 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.DS-6Supply chain integrity depends on protecting software and artefact trust.
NIST AI RMFBehavioural validation and provenance checking reduce model and toolchain risk.
OWASP Agentic AI Top 10Agents can execute untrusted package or tool actions through delegated access.
MITRE ATLASAdversarial supply chain tactics mirror attacker techniques in software ecosystems.
NIST AI 600-1GenAI systems also inherit dependency and plugin trust risks.

Limit agent tool execution and require approval for risky package-triggered actions.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on August 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org