In-app reader
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.
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'],
})
);
Discussion
Sign in to join the discussion.
Keep reading
Optional: create a free account to save items, track programs, and sync across web + app. Reading stays free.