QA
Beginner LevelWeb Security & Cyber Defense

How do Software Supply Chain vulnerabilities occur and how do tools like npm audit help?

❓ Interview Prompt: Explain Software Supply Chain security, transitive dependencies, known CVE vulnerabilities, lockfiles, and `npm audit` / Snyk.

Modern web applications rely on hundreds of open-source third-party libraries ('node_modules'). Software Supply Chain attacks exploit vulnerabilities hidden in these dependencies:

Defensive Workflow:

1
Lockfile Enforcement: Commit 'package-lock.json' to guarantee reproducible builds.
2
Automated Vulnerability Scanning: Run 'npm audit' or Snyk in CI/CD pipelines to scan dependencies against known CVE databases.
3
Dependabot Updates: Automatically apply security patch updates for vulnerable dependencies.

Code Implementation Example

bash
# Execute automated dependency security audit in CI/CD:
npm audit --audit-level=high
💡Running automated dependency vulnerability scans with npm audit.
🎯 Interview Key Takeaway

Audit third-party dependencies regularly in CI/CD pipelines using npm audit or Snyk to fix known CVE vulnerabilities.

#Supply Chain#npm audit#Dependencies#Beginner
Back to all Web Security & Cyber Defense Questions→

More Web Security & Cyber Defense Interview Questions

Beginner LevelSecurity & Web Security

Explain OWASP Top 10 vulnerabilities (XSS, CSRF, SQL Injection) and their defenses.

Beginner LevelSecurity & Web Security

What are the 3 types of XSS (Stored, Reflected, DOM-based) and how do they differ?

Beginner LevelSecurity & Web Security

How do Parameterized Queries (Prepared Statements) prevent SQL Injection attacks?