.. / stage.js
Star Fork

Stage.js is a lightweight and fast 2D rendering and layout library for web and mobile game development.

stage.js
piqnt
...

≤0.8.10 | CVE-2024-53386

<img> @src 🛡️ strict-dynamic ⏱️ before-call
More information

Root Cause

Source: https://github.com/piqnt/stage.js/blob/a1d7da8b8ebccfba4159ff8f986578dfd988a22c/lib/core.js#L155-L206

function getScriptSrc() {
  // HTML5
  if (document.currentScript) {
    return document.currentScript.src;
  }

  // [...]

  return function(url) {
    if (/^\.\//.test(url)) {
      var src = getScriptSrc();
      var base = src.substring(0, src.lastIndexOf('/') + 1);
      url = base + url.substring(2);
      // } else if (/^\.\.\//.test(url)) {
      // url = base + url;
    }
    return url;
  };

Related links:

Found by jackfromeast, ishmeals.


Source | History