no-dangerously-allow-svg
Require an explicit hardening policy for Next Image SVG delivery
Why
SVG can contain scripts and other active content. This organizational rule requires a recognized explicit script-blocking sandbox CSP when SVG delivery is enabled, with attachment disposition. It does not establish that framework defaults are missing or that a reported configuration is exploitable.
Fix
Disable dangerouslyAllowSVG, or configure an explicit literal image contentSecurityPolicy such as script-src 'none'; sandbox; and keep attachment disposition. Verify effective headers and defaults against the application's pinned Next version.
Examples
export default { images: { dangerouslyAllowSVG: true } };export default { images: { dangerouslyAllowSVG: false } };export default { images: { dangerouslyAllowSVG: true, contentDispositionType: "attachment", contentSecurityPolicy: "script-src 'unsafe-inline'; script-src 'none'; sandbox;", },};export default { images: { dangerouslyAllowSVG: true, contentDispositionType: "attachment", contentSecurityPolicy: "script-src 'none'; sandbox;", },};