test new accepts parent-directory names and creates files outside supabase/tests
メンテナーはふだん 1 日以内に返信
@7ttp がすでに取り組んでいます。
2026年9月23日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 2.4k
- フォーク
- 523
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 293
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
supabase/cli のほかの issue
-
✨ Feature supabase/cli
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
bug supabase/cli
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug supabase/cli
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Go conserva el fallo de orden de versiones corregido en TypeScript por #6038対応中かも @7ttp が 5 日前に担当しました。 オープン🐛 Bug supabase/cli
メンテナーはふだん 1 日以内に返信
-
config diff always reports auth.sms.twilio.enabled on a project with phone sign-in off, and no config.toml can clear it対応中かも @7ttp が 6 日前に担当しました。 オープン🐛 Bug supabase/cli
メンテナーはふだん 1 日以内に返信
似ている issue
-
ADD openalgoオープンtemplate
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
bug Needs: Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/fluentui-contrib#671 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sveltejs/acorn-typescript#150 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100