Short answer
A software supply chain attack compromises an app through something it depends on, such as an npm package, a build tool, a CI action or a vendor’s update, instead of attacking the app directly. AI-built apps pull in many packages that nobody chose by hand, so they inherit this risk. Keep a lockfile, install with npm ci, review new dependencies, limit install scripts and watch for advisories.
Ask an AI about this page:ChatGPTClaude
On this page
A software supply chain attack compromises an application through something it depends on, such as a package, a build tool, a CI step or a vendor’s update, rather than by attacking the application itself. MITRE ATT&CK describes it as tampering with dependencies and development tools before they reach the final user. OWASP made “Software Supply Chain Failures” category A03 of its Top 10 in 2025, covering direct and transitive dependencies, build systems and distribution.
Supply chain attacks in an AI-built app
Even a fresh Lovable or Vite project has far more packages in node_modules than in package.json, because most of them are pulled in by other packages. Any of them can run code in your build, and some run code the moment you install them. The OWASP entry gives recent examples, including Shai-Hulud, a self-spreading npm worm from 2025 that used install scripts to steal data and spread itself with npm tokens it found on victims’ machines.
Ways the risk enters a vibe-coded project:
- A trusted package is taken over and a malicious version is published.
- A look-alike name is installed by mistake. That is typosquatting; the OWASP npm cheat sheet also mentions AI tools suggesting package names that don’t exist, which attackers then register.
- Versions drift because there is no lockfile, so each install can pull something newer than what you tested.
- CI and tooling: ATT&CK notes that one compromised GitHub Action can spread to many repositories, and it can reach the secrets your workflow uses.
How to check your app
- Make sure
package-lock.json(orbun.lock,pnpm-lock.yaml,yarn.lock) is committed and your build installs from it. - Run
npm auditto see dependencies with published advisories, usually identified by a CVE.npm audit signatureschecks registry signatures and provenance of what you installed. - Open
package.jsonand ask, for each direct dependency: do I know what this does, and is it still used? - Check which GitHub Actions your workflows use and whether they are pinned.
How to fix or prevent it
Most of the defence is habit, taken from the OWASP and ATT&CK guidance: install only from trusted sources, remove what you don’t use, lock versions and install with npm ci in CI, don’t jump on a release the minute it appears, consider --ignore-scripts for packages that don’t need install scripts, pin GitHub Actions to a commit hash, and keep secrets scoped so a compromised build step can’t reach everything. Track advisories for what you ship; OWASP suggests keeping an inventory (an SBOM) and using composition analysis tools, explained under SAST, DAST and SCA.
Frequently asked questions
Is a vulnerable package the same as a supply chain attack?
Not quite. A known vulnerability in a package (a CVE) is an accident that you fix by updating. A supply chain attack is deliberate: someone plants malicious code in a package or tool you trust. OWASP’s 2025 category Software Supply Chain Failures covers both.
Does npm audit protect me from supply chain attacks?
Only partly. npm audit reports packages with known, published vulnerabilities. A freshly planted malicious version may not be known yet. Lockfiles, careful updates and limiting install scripts help with that part.
Are AI-built apps more exposed?
They tend to have many dependencies that nobody reviewed, and the AI may add packages it remembers from training. That raises the number of things you have to trust; it doesn’t make any platform insecure.
Sources
- 1.A03:2025 Software Supply Chain Failures — OWASP Top 10
- 2.Supply Chain Compromise: Compromise Software Dependencies and Development Tools (T1195.001) — MITRE ATT&CK
- 3.NPM Security best practices — OWASP Cheat Sheet Series
- 4.npm-audit — npm Docs