Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#130 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
shell, typescript
Lĩnh vực
devtools, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
0
Fork
1
Merge trung bình
2 giờ 5 phút
Pull request đã merge (30 ngày)
61

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của STRML/omp-classifier

Tất cả issue của STRML/omp-classifier

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.