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
- 1Migrate the front-end dependencies to npm and a bundler, and delete bower_components.
- 2Until then, identify the versions actually loaded and check each against an advisory database.
- 3Stop serving the directory itself; reference specific built files from your own output path.
Code examples
See what versions are actually installed
for f in bower_components/*/bower.json; do
echo "$f: $(node -e "console.log(require('./$f').version)")"
doneDeny the directory while migrating
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.
More supply chain checks
- Mediumnpm/yarn Lock File Exposed
- MediumPython Requirements File Exposed
- MediumRuby Gemfile or Gemfile.lock Exposed
- MediumExternal CDN Script Without SRI Hash
- HighHTTP Script Loaded on HTTPS Page
- MediumPHP composer.json or composer.lock Exposed
- HighDockerfile or docker-compose.yml Exposed
- Critical.env File Exposed at Public URL
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.