element for this file (classic script) const script = document.currentScript; // Get the src of <script> and retrieve the JS base path const baseUrl = new URL(script.src).pathname; // Load and execute the related JS file import(`${baseUrl}related.js`) .then((moduleNS) => {/* */}); 2
element for this file (classic script) const script = document.currentScript; // Check if script is actually a <script> element if (script.tagName.toUpperCase() !== "SCRIPT") { throw new Error("DOM clobbering!"); } // Get the src of <script> and retrieve the JS base path const baseUrl = new URL(script.src).pathname; // Load and execute the related JS file import(`${baseUrl}related.js`) 3 .then((moduleNS) => {/* */});
file (classic script) const script = document.currentScript; // Check if script is actually a <script> element if (script.tagName.toUpperCase() !== "SCRIPT") { throw new Error("DOM clobbering!"); } // Get the src of <script> and retrieve the JS base path const baseUrl = new URL(script.src).pathname; // Load and execute the related JS file import(`${baseUrl}related.js`) 8 .then((moduleNS) => {/* */});
[[Prototype]] internal slot • Object.freeze for prototype pollution fixes is risky due to Assignment Override Mistake ◦ Fixing the Assignment Override Mistake itself is a breaking change and cannot be resolved 29
own asynchronous interfaces • To resolve inconsistencies, the community created a spec treating the "then" method specially • https://promisesaplus.com/ 40
optimization • Handling side effects when accessing the "then" property adds complexity, which could lead to memory layout bugs and vulnerabilities ◦ CVE-2024-43357 44
a vulnerability occurring at the boundary between DOM and JS • Likely suppress getters or Proxy-based thenables, specifically for WebIDL • Keep Promise.resolve/await unchanged for compatibility (expose as Promise.safeResolve?) 47
linked to networks and sold commercially in the EU ◦ Might also include PWA / Native Web Apps • Major incidents must be reported to ENISA SRP starting yesterday (2026/9/11) 56