Low, CVSS 2.1npmAmendedPublished
TeleJSON: DOM XSS via unsanitised constructor name in new Function()
CVE-2026-47099 · GHSA-ccgf-5rwj-j3hv
- Affected
- npm telejson < 6.0.0
- Fixed in
- 6.0.0· Vendor fix available
- Issue
- telejson versions prior to 6.0.0 (released 2022) are vulnerable to DOM-based Cross-Site Scripting (XSS) through unsafe deserialisation. Attacker-controlled input from the constructor-name property in parsed JSON is passed directly to new Function() without sanitisation, allowing arbitrary JavaScript execution. Affected versions | Package | Affected | Fixed | |----------|-----------|----------| | telejson | < 6.0.0 | = 6.0.0 | Details telejson's parse() function uses a custom reviver to reconstruct JavaScript objects from serialised JSON. When processing objects with a constructor-name property, the reviver passes the constructor name directly to new Function() to recreate the object's prototype. In versions prior to 6.0.0, this constructor name is not sanitised. An attacker who can deliver a crafted JSON payload to telejson.parse() (for example, via postMessage in applications that use telejson for cross-frame communication) can inject arbitrary JavaScript into the new…
Recommended action: Upgrade to 6.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.