Skip to content

chore(deps): update dependency serialize-javascript to v7.1.3 [security] - #526

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-serialize-javascript-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-serialize-javascript-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
serialize-javascript 7.1.2 → 7.1.3 age confidence

Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body

CVE-2026-115897 / GHSA-m5mm-p8h7-m29v

More information

Details

Impact

serialize-javascript escapes its output so it is safe to embed inside a
<script> element. Before 7.1.3 that guarantee did not hold for a function
value whose source ends in a bare </script
.

Each function body is escaped on its own, and a bare </script was only
neutralized when followed — within the same body — by a character the HTML
tokenizer treats as ending the tag name (TAB, LF, FF, CR, SPACE, / or >).
A body ending exactly at </script has no following character, so it was
emitted unescaped. The delimiter is then supplied by the surrounding output
(for example the newline the space option emits after the value), and a
later serialized value can supply the closing > followed by markup:

const serialize = require('serialize-javascript');
function f() {} f.toString = () => 'function f(){ return 1 }//</script';
function g() {} g.toString = () => 'function g(x){ return x } > <img src=x onerror=alert(1)>';
serialize({ a: { f }, g }, { space: 2 });
// {
//   "a": {
//     "f": function f(){ return 1 }//</script
//   },
//   "g": function g(x){ return x } > <img src=x onerror=alert(1)>
// }

Embedded in a <script> element, the script ends at the injected tag and the
<img> becomes a live element in the page.

Exploitation requires an attacker to control the source text of a
serialized function, in practice through a spoofed toString(). Real
functions always end in }, so ordinary function values are not affected,
and non-function values (including strings containing </script) are
escaped correctly.

Patches

Fixed in 7.1.3 (#​235). The bare </script form is now also matched at
the end of the function body, so it is escaped regardless of what follows it
in the output.

Workarounds

Upgrade to 7.1.3. If you cannot upgrade, do not serialize function values
whose source text (or toString()) can be influenced by an attacker.

Credits

Reported by ha_kr25 via the Yahoo bug bounty program.

Severity

  • CVSS Score: 2.1 / 10 (Low)
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

yahoo/serialize-javascript (serialize-javascript)

v7.1.3

Compare Source

See: GHSA-m5mm-p8h7-m29v

What's Changed

Note on ignoreFunction

With ignoreFunction: true, function values are now omitted the same way JSON.stringify omits them, without deleting them from the input object. Functions inside arrays are emitted as null (previously this produced Array.prototype.slice.call(...) output).

New Contributors

Full Changelog: yahoo/serialize-javascript@v7.1.2...v7.1.3


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate using a curated preset maintained by Sanity. View repository job log here

@renovate
renovate Bot requested a review from a team as a code owner November 9, 2026 13:19
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astro-cinema Ready Ready Preview Nov 9, 2026 1:20pm UTC
astro-minimal Ready Ready Preview Nov 9, 2026 1:20pm UTC
sanity-astro-example Ready Ready Preview Nov 9, 2026 1:20pm UTC
sanity-astro-example-ssr Ready Ready Preview Nov 9, 2026 1:20pm UTC
sanity-astro-movies Ready Ready Preview Nov 9, 2026 1:20pm UTC
sanity-astro-observatory Ready Ready Preview Nov 9, 2026 1:20pm UTC
sanity-astro-observatory-studio Ready Ready Preview Nov 9, 2026 1:20pm UTC

Request Review

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​serialize-javascript@​7.1.2 ⏵ 7.1.3100100 +110092 -1100

View full report

This branch was successfully deployed

5 active deployments
Preview – sanity-astro-movies — ca5b16f3 Deployed Nov 9, 2026 by vercel[bot]
Preview – sanity-astro-example — ca5b16f3 Deployed Nov 9, 2026 by vercel[bot]
Preview – sanity-astro-example-ssr — ca5b16f3 Deployed Nov 9, 2026 by vercel[bot]
Preview – astro-cinema — ca5b16f3 Deployed Nov 9, 2026 by vercel[bot]
Preview – astro-minimal — ca5b16f3 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants