← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Supply Chain Attack

Security CWE-1357 OWASP A6:2021 CVSS 9.0 PHP 5.0+ Advanced
debt(d7/e7/b5/t7)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7), slightly better. Tools like composer-audit, snyk, dependabot, and trufflehog exist and are listed, but they only catch known-vulnerable or known-malicious packages. Novel attacks — account compromise of a maintainer, a freshly uploaded malicious package, dependency confusion with a private package name — are invisible to automated tools until signatures/advisories are published. Detection is therefore largely after-the-fact or requires deep manual review, landing near d7.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix describes a multi-step programme: pinning composer.lock, verifying checksums, adding roave/security-advisories, and auditing every dependency. Remediating a supply chain compromise after the fact requires identifying affected packages, rotating secrets, auditing all post-install scripts, and potentially redeploying from a clean state — a cross-cutting effort touching CI configuration, dependency manifests, deployment pipelines, and potentially application code.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). Supply chain hygiene applies to all contexts listed (web, api, cli) and imposes ongoing overhead: every new dependency must be audited, composer.lock must be maintained and committed, CI pipelines must run audits, and developers must review post-install scripts. This slows many work streams but does not fully define the system's architecture, placing it at b5.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap — contradicts how a similar concept works elsewhere' (t7). The misconception field states explicitly: 'Pinning dependency versions fully prevents supply chain attacks.' This is a well-documented and very common wrong belief — developers who know about version pinning naturally assume they are protected, but pinning does not guard against maintainer account compromise, dependency confusion, or malicious code already present in the pinned version. This contradicts the intuitive mental model of version control as a safety guarantee, scoring t7.

About DEBT scoring →

Also Known As

dependency confusion typosquatting attack build pipeline attack

TL;DR

An attacker compromises a trusted third-party dependency, build tool, or package to inject malicious code into downstream applications.

Explanation

Supply chain attacks target the weakest link in the software delivery pipeline — a compromised open-source package, a hijacked build server, or a malicious code commit to a widely-used library can affect thousands of downstream applications simultaneously. Mitigations include pinning dependency versions with integrity hashes (composer.lock with hash verification), auditing packages before adoption, using tools like composer audit, and monitoring for unexpected outbound network connections.

Common Misconception

Pinning dependency versions fully prevents supply chain attacks. Version pinning prevents unexpected upgrades but not account compromise of the original maintainer, dependency confusion attacks using higher-versioned private package names, or malicious code in the pinned version itself.

Why It Matters

Attackers target the build tools and dependencies of popular projects — a single compromised package can affect thousands of downstream applications simultaneously.

Common Mistakes

  • Not committing composer.lock to version control — running composer install without it installs unpinned latest versions.
  • Not running composer audit or npm audit in CI pipelines to catch known vulnerable dependencies.
  • Installing packages from unverified sources or using package name typosquatting targets.
  • Running post-install scripts from packages without reviewing them — a common malware vector.

Avoid When

  • Never use composer update in production deployments — use composer install --no-dev from the locked file.
  • Do not install packages from unknown vendors without reviewing the package source and history on packagist.org.

When To Use

  • Pin exact dependency versions in composer.lock and commit it — ensures repeatable builds.
  • Run composer audit in CI to catch known-vulnerable dependencies before deployment.

Code Examples

✗ Vulnerable
// No version pinning — installs whatever is current
"require": {"acme/payment": "*"}
✓ Fixed
// Pin versions + commit composer.lock
"require": {"acme/payment": "^2.4.1"}

// Audit on every CI run:
$ composer audit

// Block known-vulnerable packages automatically:
$ composer require --dev roave/security-advisories:dev-latest

// Review before adding new dependencies:
$ composer show acme/payment  // inspect maintainers, abandoned status

// Verify signatures (Composer 2.4+):
$ composer config audit.abandoned report

Added 15 Mar 2026
Edited 31 Mar 2026
Views 64
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 1 ping W 0 pings T 1 ping F 3 pings S 3 pings S 2 pings M 1 ping T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 10 Perplexity 9 Scrapy 9 SEMrush 5 Ahrefs 4 Google 4 Unknown AI 2 Bing 2 ChatGPT 2 PetalBot 2 Claude 1 Meta AI 1
crawler 47 crawler_json 4
DEV INTEL Tools & Severity
🔴 Critical ⚙ Fix effort: Medium
⚡ Quick Fix
Pin exact versions in composer.lock, verify package checksums, use roave/security-advisories, and audit new dependencies before adding
📦 Applies To
PHP 5.0+ web api cli
🔗 Prerequisites
🔍 Detection Hints
No composer.lock committed; packages without version pinning; unreviewed new dependencies
Auto-detectable: ✓ Yes composer-audit snyk dependabot trufflehog
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Medium ✗ Manual fix Fix: High Context: File
CWE-829 CWE-494


✓ schema.org compliant