Advisory

GHSA-gx5p-jg67-6x7h

Also known as: CVE-2026-44580

Summary

Next.js has cross-site scripting in beforeInteractive scripts with untrusted input

Details

Impact

Applications that use beforeInteractive scripts together with untrusted content can be vulnerable to cross-site scripting. In affected versions, serialized script content was not escaped safely before being embedded into the document, which could allow attacker-controlled input to break out of the intended script context and execute arbitrary JavaScript in a visitor's browser.

Fix

We now HTML-escape serialized beforeInteractive script content before embedding it into the page, preventing attacker-controlled content from breaking out of the inline script boundary.

Workarounds

If you cannot upgrade immediately, do not pass untrusted data into beforeInteractive scripts. If that pattern is unavoidable, sanitize or escape the content before embedding it.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-05-11 15:56 UTC
Modified
2026-09-10 03:51 UTC

Affected packages and fixes

next

npm · All systems

Affected

  • introduced 13.0.0, fixed 15.5.16 (semver)

Fixed versions

15.5.16

Fix

next

npm · All systems

Affected

  • introduced 16.0.0, fixed 16.2.5 (semver)

Fixed versions

16.2.5

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences