In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade next to version 15.5.21, 16.2.11 or higher.
next is a react framework.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity through the detectContentType path in next/dist/server/image-optimizer. An attacker can exhaust CPU in /_next/image by sending a remotely hosted SVG that forces expensive content-type detection during image optimization. The vulnerable code runs when the default image loader optimizes configured remote images, so a malicious SVG in config.images.remotePatterns can make the Image Optimization API spend excessive time parsing the response before serving it. This degrades or stalls image requests for users of self-hosted Next.js deployments that rely on the default optimizer.
Notes
config.images.loader: 'custom', config.images.unoptimized: true, and Vercel-hosted apps are outside the vulnerable deployment pattern.config.images.remotePatterns; only those configured origins can drive the costly SVG content-type detection work.Workarounds
config.experimental.imgOptSkipMetadata: true to avoid the expensive metadata-detection path in /_next/image, which mitigates the CPU-exhaustion attack from malicious remote SVGs.