CVE-2024-53384
JavaScript vulnerability analysis and mitigation

Overview

A DOM Clobbering vulnerability was discovered in tsup version 8.3.4, identified as CVE-2024-53384. The vulnerability allows attackers to execute arbitrary code via a crafted script by manipulating the import.meta.url to document.currentScript in cjs_shims.js components (NVD).

Technical details

The vulnerability exists in the cjs_shims.js file where tsup translates import.meta.url to document.currentScript to determine the URL of the current script. The vulnerable code fails to properly verify that document.currentScript is a legitimate script element, allowing attackers to inject HTML elements that can be referenced as document.currentScript, thereby controlling the importMetaUrl value. The vulnerability has received a CVSS 3.1 Base Score of 5.1 (MEDIUM) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N (GitHub POC).

Impact

When successfully exploited, this vulnerability allows attackers to perform cross-site scripting (XSS) attacks in web pages where scriptless attacker-controlled HTML elements are present. The impact is particularly significant due to tsup's popularity among JavaScript projects (GitHub POC).

Mitigation and workarounds

A recommended fix involves verifying that document.currentScript is specifically a script element by checking the tagName property. The patch should include adding a condition: document.currentScript.tagName.toUpperCase() === 'SCRIPT' before accepting the currentScript value (GitHub POC).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • tar
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management