CVE-2026-115897
Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- Low
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
2.1
Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
- Record
CVE-2026-115897- CVSS 4.0
- 2.1 Low
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 - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2026-109190
2.1
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
- Record
EUVD-2026-109190- CVSS 4.0
- 2.1 Low
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-m5mm-p8h7-m29v
2.1
Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
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.
- Record
GHSA-m5mm-p8h7-m29v- CVSS 4.0
- 2.1 Low
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 - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
2.1
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
- Record
CVE-2026-115897- CVSS 4.0
- 2.1 Low
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVCVE-2026-115754
2.3
serialize-javascript 7.0.1 before 7.1.3 XSS via unescaped </script in function body
serialize-javascript from 7.0.1 before 7.1.3 contains a cross-site scripting vulnerability that allows attackers to break out of HTML script elements by ending serialized function source text with an unescaped </script. Attackers controlling a function's source via a spoofed toString() can combine surrounding output delimiters and later values to inject live markup such as img onerror handlers.
- Record
CVE-2026-115754- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N - Weakness
- CWE-79
- Updated
- 2026-11-06
OSV
2.1
Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
- Record
CVE-2026-115897- CVSS 4.0
- 2.1 Low
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 - Weakness
- CWE-79
- Updated
- 2026-11-06
Show 13 moreShow less
OSVGHSA-m5mm-p8h7-m29v
2.1
Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
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.
- Record
GHSA-m5mm-p8h7-m29v- CVSS 4.0
- 2.1 Low
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 - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVAZL-111404 No score
CVE-2026-115897 affecting package python-tensorboard 2.16.2-6
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.
- Record
AZL-111404- Updated
- 2026-11-05
OSVCLSA-2026-1793098798 No score
TuxCare security update for serialize-javascript (2 CVEs)
TuxCare rebuilt serialize-javascript to address 2 CVEs. Fixed in 7.1.2-tuxcare.1.
- Record
CLSA-2026-1793098798- Updated
- 2026-11-02
OSVCLSA-2026-1793099227 No score
TuxCare security update for serialize-javascript (2 CVEs)
TuxCare rebuilt serialize-javascript to address 2 CVEs. Fixed in 6.0.2-tuxcare.3.
- Record
CLSA-2026-1793099227- Updated
- 2026-11-02
OSVCLSA-2026-1793125688 No score
TuxCare security update for serialize-javascript (2 CVEs)
TuxCare rebuilt serialize-javascript to address 2 CVEs. Fixed in 7.1.1-tuxcare.2.
- Record
CLSA-2026-1793125688- Updated
- 2026-11-02
OSVCLSA-2026-1793180818 No score
TuxCare security update for serialize-javascript (1 CVE)
TuxCare rebuilt serialize-javascript to address 1 CVE. Fixed in 6.0.1-tuxcare.1.
- Record
CLSA-2026-1793180818- Updated
- 2026-11-02
OSVCLSA-2026-1793183866 No score
TuxCare security update for serialize-javascript (1 CVE)
TuxCare rebuilt serialize-javascript to address 1 CVE. Fixed in 6.0.0-tuxcare.1.
- Record
CLSA-2026-1793183866- Updated
- 2026-11-02
OSVCLSA-2026-1793187934 No score
TuxCare security update for serialize-javascript (1 CVE)
TuxCare rebuilt serialize-javascript to address 1 CVE. Fixed in 5.0.1-tuxcare.3.
- Record
CLSA-2026-1793187934- Updated
- 2026-11-02
OSVCLSA-2026-1793207115 No score
TuxCare security update for serialize-javascript (1 CVE)
TuxCare rebuilt serialize-javascript to address 1 CVE. Fixed in 3.1.0-tuxcare.2.
- Record
CLSA-2026-1793207115- Updated
- 2026-11-02
OSVCLSA-2026-1793209309 No score
TuxCare security update for serialize-javascript (1 CVE)
TuxCare rebuilt serialize-javascript to address 1 CVE. Fixed in 2.1.2-tuxcare.2.
- Record
CLSA-2026-1793209309- Updated
- 2026-11-02
OSVCLSA-2026-1793789998 No score
TuxCare security update for serialize-javascript (3 CVEs)
TuxCare rebuilt serialize-javascript to address 3 CVEs. Fixed in 3.0.0-tuxcare.1.
- Record
CLSA-2026-1793789998- Updated
- 2026-11-04
OSVCLSA-2026-1793790235 No score
TuxCare security update for serialize-javascript (2 CVEs)
TuxCare rebuilt serialize-javascript to address 2 CVEs. Fixed in 7.0.7-tuxcare.1.
- Record
CLSA-2026-1793790235- Updated
- 2026-11-07
OSVopenSUSE-SU-2026:12424-1 No score
agama-web-ui-25+475.275dd4727-56.1 on GA media
These are all security issues fixed in the agama-web-ui-25+475.275dd4727-56.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:12424-1- Updated
- 2026-11-06
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
serialize-javascriptnpm |
before 7.1.3 | 7.1.3 |
python-tensorboardAzure Linux:3 |
through 2.16.2-6 | None known |
serialize-javascriptTuxCare:npm From an advisory covering 2 CVEs |
7.1.2-tuxcare.0 up to 7.1.2-tuxcare.1, plus listed versions 7.1.2 |
7.1.2-tuxcare.1 |
serialize-javascriptTuxCare:npm From an advisory covering 2 CVEs |
6.0.2-tuxcare.0 up to 6.0.2-tuxcare.3, plus listed versions 6.0.26.0.2-tuxcare.16.0.2-tuxcare.2 |
6.0.2-tuxcare.3 |
serialize-javascriptTuxCare:npm From an advisory covering 2 CVEs |
7.1.1-tuxcare.0 up to 7.1.1-tuxcare.2, plus listed versions 7.1.17.1.1-tuxcare.1 |
7.1.1-tuxcare.2 |
serialize-javascriptTuxCare:npm |
6.0.1-tuxcare.0 up to 6.0.1-tuxcare.1, plus listed versions 6.0.1 |
6.0.1-tuxcare.1 |
serialize-javascriptTuxCare:npm |
6.0.0-tuxcare.0 up to 6.0.0-tuxcare.1, plus listed versions 6.0.0 |
6.0.0-tuxcare.1 |
serialize-javascriptTuxCare:npm |
5.0.1-tuxcare.0 up to 5.0.1-tuxcare.3, plus listed versions 5.0.15.0.1-tuxcare.15.0.1-tuxcare.2 |
5.0.1-tuxcare.3 |
serialize-javascriptTuxCare:npm |
3.1.0-tuxcare.0 up to 3.1.0-tuxcare.2, plus listed versions 3.1.03.1.0-tuxcare.1 |
3.1.0-tuxcare.2 |
serialize-javascriptTuxCare:npm |
2.1.2-tuxcare.0 up to 2.1.2-tuxcare.2, plus listed versions 2.1.22.1.2-tuxcare.1 |
2.1.2-tuxcare.2 |
Show 4 moreShow less
| Package | Affected | Fixed |
|---|---|---|
serialize-javascriptTuxCare:npm From an advisory covering 2 CVEs |
3.0.0-tuxcare.0 up to 3.0.0-tuxcare.1, plus listed versions 3.0.0 |
3.0.0-tuxcare.1 |
serialize-javascriptTuxCare:npm |
7.0.7-tuxcare.0 up to 7.0.7-tuxcare.1, plus listed versions 7.0.7 |
7.0.7-tuxcare.1 |
serialize-javascriptnpm From an advisory covering 2 CVEs |
before 7.1.3 | 7.1.3 |
agama-web-uiopenSUSE:Tumbleweed From an advisory covering 11 CVEs |
before 25+475.275dd4727-56.1 | 25+475.275dd4727-56.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| affected | OSV | |
| affected, aliases, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-115897 is a low vulnerability (CVSS 2.1) in Yahoo Serialize-javascript, published October 23, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.31%, the 23rd percentile. Fixed in serialize-javascript 7.1.3.
References
github.com/yahoo/serialize-javascript/security/advisories/GHSA-m5mm-p8h7-m29v
github.com/yahoo/serialize-javascript/pull/235
github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61
github.com/yahoo/serialize-javascript/releases/tag/v7.1.3
github.com/advisories/GHSA-m5mm-p8h7-m29v
nvd.nist.gov/vuln/detail/CVE-2026-115897
Show 16 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/115xxx/CVE-2026-115754.json
nvd.nist.gov/vuln/detail/CVE-2026-115754
vulncheck.com/advisories/serialize-javascript-7.0.1-before-7.1.3-xss-via-unescaped-script-in-function-body
github.com/yahoo/serialize-javascript
github.com/CVEProject/cvelistV5/tree/main/cves/2026/115xxx/CVE-2026-115897.json
suse.com/security/cve/CVE-2026-102277
suse.com/security/cve/CVE-2026-110725
suse.com/security/cve/CVE-2026-111181
suse.com/security/cve/CVE-2026-111755
suse.com/security/cve/CVE-2026-111756
suse.com/security/cve/CVE-2026-115754
suse.com/security/cve/CVE-2026-115897
suse.com/security/cve/CVE-2026-116689
suse.com/security/cve/CVE-2026-75899
suse.com/security/cve/CVE-2026-84369
suse.com/security/cve/CVE-2026-86472