Skip to main content
LowSupply chainOWASP A06:2021CWE-1104

How to fix: Asset loaded from a Bower install directory

A script or stylesheet on this page loads from a bower_components path. Bower was deprecated in 2017 and its registry stopped accepting new packages.

Why it matters

Bower resolved packages straight from git tags with no integrity checking and no lockfile by default, so what is installed here was never verified and cannot be reproduced. Packages installed this way have not received updates since the registry froze, which means any front-end library in that directory is at least several years behind on security fixes.

The immediate issue is age, not a specific vulnerability: jQuery, Bootstrap, Angular 1.x and Handlebars are the usual residents of a bower_components directory, and each has had XSS or prototype-pollution fixes since. Serving the directory also exposes each package's bower.json and often its full source tree, which gives an exact version for every library present.

How to fix it

  1. 1Migrate the front-end dependencies to npm and a bundler, and delete bower_components.
  2. 2Until then, identify the versions actually loaded and check each against an advisory database.
  3. 3Stop serving the directory itself; reference specific built files from your own output path.

Code examples

See what versions are actually installed

bash
for f in bower_components/*/bower.json; do
  echo "$f: $(node -e "console.log(require('./$f').version)")"
done

Deny the directory while migrating

nginx
location /bower_components/ {
    return 404;
}

References

Detected automatically by VulnRadar. The check id is supply-chain-bower-components-reference, stable across every scan so you can filter or diff on it.

See every supply chain check

Questions

How severe is Asset loaded from a Bower install directory?
VulnRadar rates this low severity in the supply chain category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id supply-chain-bower-components-reference, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Asset loaded from a Bower install directory map to?
It maps to CWE-1104. In the OWASP Top 10 it falls under A06:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for asset loaded from a bower install directory

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Asset loaded from a Bower install directory fix | VulnRadar