Web Security & OWASP (50 Qs)•Part 2: OWASP Top 10 & Critical Vulnerability Deep-Dives (11 - 25)
Vulnerable & Outdated Components: Software supply chain security, typosquatting, and automated SCA.
Software Supply Chain Attack Vectors
Modern enterprise applications are composed of over 80% third-party open-source libraries. Attackers target this ecosystem through:
- Typosquatting: Publishing packages with names mimicking popular libraries (e.g.
cross-envvorlodahs). - Account Takeover: Compromising open-source maintainer credentials to publish malicious versions.
- Dependency Confusion: Tricking internal build tools into downloading a public malicious package rather than a private internal company package.
kotlin
Attacker publishes public malicious package: @company/internal-auth:v9.9.9
|
v
Developer / CI runs: npm install @company/internal-auth
NPM resolves highest semantic version (v9.9.9) from public registry!
Malicious postinstall script executes: steals AWS keys and opens reverse shell!
Supply Chain Defense Stack
- Lockfile Enforcement: Always use
npm ci(orpnpm install --frozen-lockfile) to guarantee deterministic package hashes. - Disable
postinstallScripts: Runnpm install --ignore-scriptsfor untrusted dependencies. - Automated SCA in CI/CD: Run Trivy or Snyk on every pull request to block any PR introducing critical CVEs.