Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A sourced file can change the cwd the gate reviews against (#121 gate round 5)

クローズ
#130 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
shell, typescript
領域
devtools, security

調査の方向性

Start in shell-cwd.ts around line 550 and review the cwd handling from PR #121, then trace how sourced shell files are represented. Add coverage for the direct source, benign activation, and transitive-source examples in the issue. Done means the gate reads the executed target or refuses with the sourced filename, while preserving the stated benign case.

索引モデルが issue の本文から書いたものです。

説明

bug ready-for-agent

This was generated by AI during triage.

The review gate's round 5 on PR #121 ([P1] A conditional source can move cwd past the directory check):

: && source ./hop.sh; python3 payload.py     # hop.sh runs: cd child

From /repo, bash sources hop.sh in the current shell, so the cd child moves it and the interpreter runs /repo/child/payload.py. The gate's cwd walk does not treat source/. as a directory-changing builtin (shell-cwd.ts:550 in that round), so it keeps /repo, opens /repo/payload.py, and reviews a different file than the one that runs: a benign parent plus a harmful child flips the verdict.

Same class as the other cwd shapes already closed in that PR (cd A || cd B, and a leading cd applied twice to provenance) — an unmodeled way for the shell's directory to change — and the same fix direction: either read the sourced file the way a script operand is read, or fail closed and ask when the target cannot be resolved from the text. A separate, narrower issue lives in the same area: a --config=./relative CLI path resolved against the invocation's directory rather than the command's start directory, which is a path-resolution question, not a cwd mutation.

Scope, which is why this is filed rather than fixed

A sourced file is arbitrary shell: it may itself source another file, call a function defined elsewhere, or change the directory conditionally. Closing the class honestly means either resolving the transitive source graph (a resolver the PR deliberately did not build) or refusing every command that sources a file whose text cannot be read. The second is a behaviour change worth deciding deliberately, since source ./venv/bin/activate && … is a common, benign shape.

Acceptance

  • : && source ./hop.sh; python3 payload.py where hop.sh contains cd child does not review /repo/payload.py: either /repo/child/payload.py is read, or the command is refused with the reason naming the sourced file.
  • A source of a file that provably does not change the directory (no cd, no function call that could) still resolves to the start directory, so the benign activate shape does not become a prompt.
  • A sourced file that itself sources another is either followed or refused; the test pins whichever rule is chosen.
主要言語
TypeScript
スター
0
フォーク
1
平均マージ
2時間 10分
マージ済み PR(30日)
64

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

STRML/omp-classifier のほかの issue

STRML/omp-classifier の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。