CVE-2022-23646: Improper CSP in Image Optimization API for Next.js versions between 10.0.0 and 12.1.0
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.79553%
CWE
Published
2/17/2022
Updated
2/3/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
next | npm | >= 10.0.0, < 12.1.0 | 12.1.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the default image optimization handler (imageOptimizer) not applying proper CSP headers for SVG files. The linked GitHub PR #34075 shows modifications to the image-optimizer.ts
file related to response caching and security headers. The vulnerability only exists when using the default loader, as alternative loaders bypass this code path. The function's failure to implement adequate CSP protections for SVGs from user-configured domains directly enables UI misrepresentation attacks.