Cross-Site Scripting in lazysizesGHSA-w4vp-3mq7-7v82
GHSA-w4vp-3mq7-7v82 is a security vulnerability in lazysizes. A fix is available for lazysizes — see the affected versions and patch details below.
Real-World Exposure
lazysizesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
Versions of lazysizes prior to 5.2.1-rc1 are vulnerable to Cross-Site Scripting. The video-embed plugin fails to sanitize the following attributes: data-vimeo, data-vimeoparams, data-youtube and data-ytparams. This allows attackers to execute arbitrary JavaScript in a victim's browser if the attacker has control over the vulnerable attributes.
Recommendation
Upgrade to version 5.2.1-rc1 or later.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | lazysizes | all versions | 5.2.1-rc1npm install lazysizes@5.2.1-rc1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for lazysizes, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update lazysizes to 5.2.1-rc1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-w4vp-3mq7-7v82 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-w4vp-3mq7-7v82 in your dependencies?
Find it across npm, including transitive dependencies.