CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-CCGF-5RWJ-J3HV

GHSA-ccgf-5rwj-j3hv: DOM XSS via Unsafe Deserialization in TeleJSON

Alon Barad
Alon Barad
Software Engineer

Apr 3, 2026·6 min read·44 visits

Executive Summary (TL;DR)

TeleJSON < 6.0.0 passes unvalidated input from the `_constructor-name_` JSON property into a `new Function()` call during deserialization. This allows attackers to achieve arbitrary code execution via crafted JSON payloads, often delivered through cross-frame messaging.

The telejson package prior to version 6.0.0 contains a DOM-based Cross-Site Scripting (XSS) vulnerability. The package deserializer uses an unsanitized object property, `_constructor-name_`, within a dynamically generated function via `new Function()`. Attackers can supply crafted JSON payloads to achieve arbitrary JavaScript execution in the context of the vulnerable application.

Vulnerability Overview

The telejson library provides serialization and deserialization mechanisms for JavaScript objects, extending standard JSON capabilities to support cyclic references and custom prototypes. This functionality is heavily utilized in frontend development ecosystems, particularly within cross-frame communication channels and complex UI testing frameworks. The vulnerability, identified as GHSA-ccgf-5rwj-j3hv, resides in the deserialization routine where untrusted input dictates dynamic function creation.

By exploiting this flaw, an attacker can achieve Cross-Site Scripting (XSS) via Improper Control of Generation of Code (CWE-94). The application passes unvalidated data from a specific JSON key directly into a new Function() constructor. This pattern circumvents the inherent safety of standard JSON.parse() operations, converting a data-parsing action into arbitrary code execution.

The primary attack surface involves applications processing untrusted messages through window.postMessage using telejson.parse(). Since telejson is a foundational dependency in tools like Storybook, the blast radius encompasses numerous development environments and any production deployments exposing these parsers to untrusted origins.

Root Cause Analysis

The fundamental flaw exists within the reviver function utilized by telejson to reconstruct serialized objects. When the library encounters an object containing the _constructor-name_ property, it attempts to restore the object's original prototype chain. This feature allows the deserializer to yield instances of custom classes rather than plain JavaScript objects.

To achieve this dynamic instantiation, the library extracts the string value associated with _constructor-name_ and uses it to construct an anonymous function. The implementation relies on the new Function() constructor, utilizing a template literal to interpolate the class name into the function body string. The code explicitly expects this string to be a valid, benign JavaScript identifier.

The application lacks any input validation or sanitization prior to this interpolation. Because the attacker controls the complete string value of the _constructor-name_ property, they can inject arbitrary JavaScript syntax. The JavaScript engine parses the manipulated string as the body of the dynamically generated function, allowing the injected code to alter the control flow.

The vulnerability manifests precisely at the moment the new Function(...)() call is evaluated. The trailing parentheses immediately invoke the newly created function within the execution context of the hosting application, granting the attacker immediate code execution.

Code Analysis

The vulnerable logic in telejson versions prior to 6.0.0 is isolated within the core deserialization module located in src/index.ts. The code checks for the presence of the _constructor-name_ property and proceeds to execute the vulnerable interpolation block if the value differs from the default Object type.

if (isObject<ValueContainer>(value) && value['_constructor-name_']) {
  const name = value['_constructor-name_'];
  if (name !== 'Object') {
    const Fn = new Function(`return function ${name}(){}`)();
    Object.setPrototypeOf(value, new Fn());
  }
}

In the snippet above, the variable name receives the unsanitized attacker payload. If the attacker supplies a payload containing function-terminating syntax followed by separate statements, the template string evaluation generates a compound script block, circumventing the intended function definition.

The patch introduced in version 6.0.0 implements a two-fold defense mechanism, combining strict sanitization with an explicit opt-in requirement. The library now requires developers to explicitly pass an allowFunction flag in the options object to enable prototype reconstruction.

if (isObject<ValueContainer>(value) && value['_constructor-name_'] && options.allowFunction) {
  const name = value['_constructor-name_'];
  if (name !== 'Object') {
    const Fn = new Function(`return function ${name.replace(/[\W_]+/g, '')}(){}`)();
    Object.setPrototypeOf(value, new Fn());
  }
}

The remediation strips all non-alphanumeric characters from the input string using the regex /[\W_]+/g before passing it to the new Function() constructor. This completely neutralizes the injection vector, as attackers can no longer introduce the parentheses, semicolons, or whitespace necessary to break out of the function definition context.

Exploitation Vector

Exploitation requires the attacker to submit a carefully crafted JSON payload to an endpoint or event listener that subsequently processes the data using telejson.parse(). The attack vector is predominantly client-side, targeting applications that accept messages via window.postMessage from arbitrary or poorly validated origins.

The payload structure leverages the _constructor-name_ key to inject the attack string. A successful exploit payload must close the intended function declaration, inject the malicious statements, and effectively handle the trailing syntax generated by the template literal.

{
  "_constructor-name_": "Exploit(){}; alert(document.domain); //"
}

When the deserializer processes this object, the new Function() constructor evaluates the interpolated string return function Exploit(){}; alert(document.domain); //(){}. The JavaScript engine interprets this as a function returning a distinct, empty function, followed immediately by the execution of alert(document.domain). The // neutralizes the trailing (){} syntax that would otherwise cause a syntax error.

Impact Assessment

The vulnerability results in a direct Cross-Site Scripting (XSS) condition, operating entirely within the Document Object Model (DOM). Successful exploitation grants the attacker arbitrary JavaScript execution capabilities within the security context of the victim's application.

An attacker leveraging this flaw can access all data available to the compromised origin. This includes reading document.cookie for non-HttpOnly session tokens, accessing HTML5 storage mechanisms, and interacting with the DOM to extract sensitive user data. The attacker can also forge requests to backend APIs, assuming the identity and privileges of the authenticated user.

The CVSS v4.0 vector (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N) reflects the specific prerequisites and scope of the flaw. The Attack Requirements (AT:P) metric emphasizes that exploitation depends on the target application explicitly implementing telejson to parse untrusted, attacker-controlled input.

Despite the specific scores assigned by the context of DOM-based XSS, the practical risk is significant for applications handling sensitive session data or administrative interfaces. In contexts like shared developer environments or administrative dashboards, the flaw facilitates credential theft and extensive lateral movement within the application ecosystem.

Remediation and Mitigation

The primary remediation for this vulnerability requires upgrading the telejson package to version 6.0.0 or later. The patch completely eliminates the underlying injection vector via regex-based sanitization and establishes a secure default posture by disabling dynamic function evaluation entirely.

Developers must explicitly opt-in to prototype reconstruction by setting the allowFunction parameter to true. This architectural change ensures that only applications strictly requiring dynamic prototype deserialization are exposed to the associated complexity, reducing the attack surface for all other use cases.

If upgrading the library is immediately unfeasible, organizations must implement stringent origin validation on all inter-frame communication. Event listeners utilizing window.postMessage must strictly verify the event.origin property against a hardcoded whitelist of trusted domains before passing the event.data to telejson.parse().

Additionally, employing strict Content Security Policy (CSP) headers mitigates the impact of successful exploitation. A CSP that explicitly omits the unsafe-eval directive prevents the JavaScript engine from evaluating strings passed to new Function(), serving as a robust compensating control against this and similar deserialization vulnerabilities.

Technical Appendix

CVSS Score
5.1/ 10

Affected Systems

Frontend applications utilizing the telejson library.Storybook instances and custom addons communicating via window.postMessage.

Affected Versions Detail

Product
Affected Versions
Fixed Version
telejson
storybookjs
< 6.0.06.0.0
AttributeDetail
Vulnerability TypeDOM-based Cross-Site Scripting (XSS)
CWE IDCWE-79, CWE-94
Attack VectorNetwork
Privileges RequiredNone
CVSS v4.0 VectorCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Primary MitigationUpgrade to telejson >= 6.0.0

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-94
Improper Control of Generation of Code ('Code Injection')

The application does not adequately neutralize user-controlled input before utilizing it to dynamically generate code, allowing attackers to execute arbitrary JavaScript.

Vulnerability Timeline

Vulnerability fixed in version 6.0.0 of telejson.
2022-01-01
Vulnerability formally published in the GitHub Advisory Database.
2026-04-02

References & Sources

  • [1]GitHub Security Advisory: GHSA-ccgf-5rwj-j3hv
  • [2]Official Repository: storybookjs/telejson
  • [3]Vulnerable Code Reference (v5.3.3)
  • [4]Fixed Code Reference (v6.0.0)

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-71322
4.3

CVE-2026-71322: Missing Authorization Check in Netflix Lemur Certificate Export

Netflix Lemur, a TLS/SSL certificate management framework, contains a missing authorization check in its certificate export endpoint. Prior to version 1.9.3, the validation logic verifying whether a user had permission to export a certificate was incorrectly placed inside a block that executed only if the selected plugin required a private key. When an authenticated user attempted to export a certificate using a plugin that did not require the private key, the authorization check was bypassed, allowing unauthorized access to the public portions of the certificate and producing misleading audit logs.

Alon Barad
Alon Barad
0 views•6 min read
•about 1 hour ago•GHSA-JF24-8G2H-2WG7
7.2

GHSA-JF24-8G2H-2WG7: Remote Code Execution in LibreNMS AboutController via Binary Path Substitution

A critical security flaw in LibreNMS allows authenticated administrators to execute arbitrary commands by modifying the configured binary path for snmpget and accessing the About page. This occurs due to insufficient verification of the executable file's identity and integrity prior to executing it with shell_exec.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 2 hours ago•GHSA-7CJ5-V4PP-V632
4.8

GHSA-7cj5-v4pp-v632: Stored Cross-Site Scripting in LibreNMS Graph Descriptions

LibreNMS versions prior to 26.7.0 are vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. An authenticated administrator can inject arbitrary HTML or JavaScript into graph descriptions via specific administrative configuration endpoints. When another authenticated user views the affected graph, the unescaped payload executes within their browser context.

Alon Barad
Alon Barad
1 views•5 min read
•about 3 hours ago•GHSA-7GWW-X7FH-JF9J
8.1

GHSA-7GWW-X7FH-JF9J: SSRF-Driven Stored Cross-Site Scripting in LibreNMS Oxidized Integration

An injection vulnerability in LibreNMS's Oxidized integration component allows administrative or network-positioned attackers to achieve stored cross-site scripting (XSS). By setting a malicious oxidized.url endpoint, the server makes outbound queries and processes returned JSON fields containing malicious HTML or JavaScript. These payloads are outputted directly in the web UI without appropriate output encoding.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 4 hours ago•CVE-2026-17106
7.1

CVE-2026-17106: Container-to-Host Arbitrary File Write in moby/go-archive (CopyEscape)

CVE-2026-17106 (CopyEscape) is a container-to-host arbitrary file-write vulnerability within Docker's archiving and extraction library moby/go-archive. By utilizing a Time-of-Check to Time-of-Use (TOCTOU) race condition during the file-walking stage inside a running container, a malicious container process can force the host engine to produce a compromised tar stream. During client-side extraction, the Docker CLI resolves directory entries through absolute symbolic links, resulting in arbitrary file creation or modification on the host system.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 5 hours ago•CVE-2026-73974
5.5

CVE-2026-73974: Local Path Traversal and Privilege Escalation in Linuxfabrik Monitoring Plugins

CVE-2026-73974 is a local path traversal vulnerability in linuxfabrik-lib and Linuxfabrik Monitoring Plugins. Under standard monitoring configurations running with elevated privileges via sudo, this flaw can be exploited by an unprivileged local user to read arbitrary root-only files, resulting in local privilege escalation.

Alon Barad
Alon Barad
4 views•5 min read