CVE-2024-11831

Executive Summary

CVE-2024-11831: The npm-serialize-javascript package fails to sanitize inputs such as regex or other JavaScript object types, allowing attackers to inject malicious code. When serialized data is sent to browsers and later deserialized, the injected code can execute, resulting in XSS attacks. This flaw is critical for any web application that transmits serialized data to clients using this package.


Authoritative CVE Metadata - CVSS Base Score: 5.4 (MEDIUM) - Published: 2025-02-10T16:15:37.080 - Last Modified: 2026-09-06T22:17:19.333

Original Description: A flaw was found in npm-serialize-javascript. The vulnerability occurs because the serialize-javascript module does not properly sanitize certain inputs, such as regex or other JavaScript object types, allowing an attacker to inject malicious code. This code could be executed when deserialized by a web browser, causing Cross-site scripting (XSS) attacks. This issue is critical in environments where serialized data is sent to web clients, potentially compromising the security of the website or web application using this package.

"When fate hands us a lemon, lets try to make lemonade."

— Dale Carnegie
Source: NVD