test new accepts parent-directory names and creates files outside supabase/tests
Los mantenedores suelen responder en 1 día
@7ttp ya está trabajando en esto.
Desde el 23/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Affected area
Database
Supabase CLI version
v2.118.0-beta.67
Operating system
macOS 15.1 (Darwin 24.1.0)
Installation method
npm (npx)
Command
tmp="$(mktemp -d)"
mkdir -p "$tmp/project"
npx --yes [email protected] -- \
supabase --workdir "$tmp/project" test new ../../../escaped
test -f "$tmp/escaped_test.sql" && echo "created outside supabase/tests"
Actual output
{"path":"../escaped_test.sql","template":"pgtap","message":""}
created outside supabase/tests
The command exits successfully and creates escaped_test.sql outside the configured workdir. The expected supabase/tests directory is not created.
Expected behavior
test new should reject a name whose normalized output path escapes <workdir>/supabase/tests, exit non-zero, and write nothing outside that directory.
Names containing subdirectories should remain valid if their resolved destination stays within supabase/tests.
Steps to reproduce
- Create an empty temporary project directory.
- Run
supabase test newwith../../../escapedas the test name, as shown above. - Observe that the command reports success.
- Observe that the generated file is outside both the configured workdir and
supabase/tests.
Crash report ID
No response
Docker and service versions
Not applicable; this command does not use Docker or local services.
Additional context
The handler constructs the destination with path.join("supabase", "tests", name + "_test.sql"). Parent-directory segments are normalized before the write, but the result is not checked against the intended tests directory:
https://github.com/supabase/cli/blob/develop/apps/cli/src/commands/test/new/new.handler.ts#L24-L29
The command's side-effect contract documents writes only under <workdir>/supabase/tests:
The existing file check prevents overwriting an existing outside file, but the command can create a new file and parent directories outside its documented destination.
supabase migration new already performs an analogous containment check for migration names:
I searched the current and historical issues and pull requests and did not find an existing report or active fix. I would be happy to contribute a focused fix and integration test after maintainer triage if this is labeled open-for-contribution.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.4k
- Forks
- 526
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 293
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de supabase/cli
-
✨ Feature supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
bug supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
🐛 Bug supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Go conserva el fallo de orden de versiones corregido en TypeScript por #6038Posiblemente ocupada @7ttp la tomó hace 6 días. Abierto🐛 Bug supabase/cli
supabase/cli#6682 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
config diff always reports auth.sms.twilio.enabled on a project with phone sign-in off, and no config.toml can clear itPosiblemente ocupada @7ttp la tomó hace 7 días. Abierto🐛 Bug supabase/cli
supabase/cli#6680 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de supabase/cli
Issues similares
-
module-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
appandflow/stim#1604 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
lingdojo/kana-dojo#31060 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
paperclipai/paperclip#14173 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día