Skip to content

fix: disable dangerouslyAllowSVG to prevent SVG-based XSS (#2646) - #2726

Open
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:issue-2646-disable-svg
Open

fix: disable dangerouslyAllowSVG to prevent SVG-based XSS (#2646)#2726
tmdeveloper007 wants to merge 1 commit into
nisshchayarathi:mainfrom
tmdeveloper007:issue-2646-disable-svg

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Description

next.config.js had dangerouslyAllowSVG: true, allowing SVG files to be processed through Next.js's image optimisation pipeline. SVG files can contain embedded JavaScript that may execute in the browser via <img> tags — a known XSS attack vector even with a restrictive CSP header.

Fix

Set dangerouslyAllowSVG to false (the secure default). The existing CSP header (script-src 'none'; sandbox;) provides defence-in-depth.

Files Changed

  • next.config.js

Related Issues

The Next.js image optimisation pipeline had dangerouslyAllowSVG enabled,
which allows SVG files to be processed through Next.js image optimisation.
SVG files can contain embedded JavaScript that may execute in the user's
browser via image tags — a known XSS attack vector.

Fix: set dangerouslyAllowSVG to false (the secure default).
CSP header already present as defence-in-depth (issue nisshchayarathi#2646).
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the gssoc:spam GSSoC: Spam contribution label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ GSSoC Quality Check Failed — PR #2726

Hi @tmdeveloper007! 👋 Your PR has been flagged by our automated GSSoC quality check.

Issues found:

  • 📏 Trivially small change — Only 2 line(s) changed in 1 file. Changes this small are almost never meaningful contributions. Make sure your PR solves a real issue.

✅ How to fix this

  1. Read the issues listed above carefully
  2. Edit your PR title and description to address them
  3. Make sure your PR is linked to an open issue using closes #<issue-number>
  4. Make sure your changes are meaningful and solve a real problem

Once you've fixed these, a maintainer will review and remove the flag. If you believe this is a mistake, please comment below. 🙏

GSSoC'26 automation · Maintainer: @nisshchayarathi

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tmdeveloper007, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b07eb57c-ba80-4700-85e0-3fdacdb7bb5b

📥 Commits

Reviewing files that changed from the base of the PR and between 153f57d and a99c902.

📒 Files selected for processing (1)
  • next.config.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tmdeveloper007

Copy link
Copy Markdown
Contributor Author

CI status note: the failing Lint and Type Check checks are pre-existing failures on the main branch (confirmed by checking recent main-branch workflow runs — they fail with the same errors). This PR does not introduce any new lint or type errors. The Worker Consistency verify failure is also pre-existing on main. These CI gates are blocked by upstream issues unrelated to this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:spam GSSoC: Spam contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: dangerouslyAllowSVG enabled in Next.js image optimization pipeline

1 participant