Skip to content

πŸ›‘οΈ Sentinel: [security improvement] Fix implicit shell usage in probe capability - #1934

Closed
seonghobae wants to merge 4 commits into
mainfrom
fix/implicit-shell-usage-4100240205001182484
Closed

seonghobae wants to merge 4 commits into
mainfrom
fix/implicit-shell-usage-4100240205001182484

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: scripts/ci/sandboxed_web_e2e.py 파일 λ‚΄ _probe_isolation_capability ν•¨μˆ˜μ˜ subprocess.run ν˜ΈμΆœμ— shell=False μΈμžκ°€ λͺ…μ‹œλ˜μ–΄ μžˆμ§€ μ•Šμ•„, Bandit λ³΄μ•ˆ κ²€μ‚¬μ—μ„œ 잠재적인 암묡적 μ…Έ μ‚¬μš© 취약점(B603)으둜 λ³΄κ³ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
🎯 Impact: ν˜„μž¬ μž…λ ₯값이 ν•˜λ“œμ½”λ”©λ˜μ–΄ μžˆμ–΄ 즉각적인 취약점은 μ—†μœΌλ‚˜, ν–₯ν›„ μ™ΈλΆ€ μž…λ ₯값이 λͺ…λ Ήμ–΄λ‘œ 전달될 경우 μ…Έ μ‚½μž…(Shell Injection) 곡격에 λ…ΈμΆœλ  수 μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: subprocess.run 호좜 μ‹œ shell=False 인자λ₯Ό λͺ…μ‹œμ μœΌλ‘œ μΆ”κ°€ν•˜μ—¬ 암묡적인 μ…Έ 싀행을 λ°©μ§€ν–ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ tests/test_sandboxed_web_e2e.py λ‚΄μ˜ λͺ¨μ˜(Mock) ν•¨μˆ˜μΈ _fake_run이 kwargsλ₯Ό μΊ‘μ²˜ν•˜λ„λ‘ μ—…λ°μ΄νŠΈν•˜κ³ , shell μΈμžκ°€ False둜 μ „λ‹¬λ˜μ—ˆλŠ”μ§€ κ²€μ¦ν•˜λŠ” assertion을 μΆ”κ°€ν•˜μ—¬ λ³΄μ•ˆ 속성을 보μž₯ν•©λ‹ˆλ‹€.
βœ… Verification: 전체 ν…ŒμŠ€νŠΈ 슈트λ₯Ό μ‹€ν–‰ν•˜μ—¬ 100% μ½”λ“œ 컀버리지λ₯Ό μœ μ§€ν•˜κ³  λͺ¨λ“  ν…ŒμŠ€νŠΈκ°€ μ„±κ³΅ν•˜λŠ” 것을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€ (pytest, interrogate).


PR created automatically by Jules for task 4100240205001182484 started by @seonghobae

… capability

`subprocess.run` 호좜 μ‹œ `shell=False` 인자λ₯Ό λͺ…μ‹œμ μœΌλ‘œ μΆ”κ°€ν•˜μ—¬ 잠재적인 λͺ…λ Ήμ–΄ μ‚½μž… 곡격(Command Injection) μœ„ν—˜μ„ λ°©μ§€ν•˜κ³  λ³΄μ•ˆ 검사 도ꡬ(Bandit B603)의 μš”κ΅¬ 사항을 μΆ©μ‘±ν•©λ‹ˆλ‹€. μ—°κ΄€λœ ν…ŒμŠ€νŠΈ 파일의 Mock 객체에도 `shell=False` μΈμžκ°€ μ˜¬λ°”λ₯΄κ²Œ μ „λ‹¬λ˜λŠ”μ§€ ν™•μΈν•˜λŠ” 검증 λ‘œμ§μ„ μΆ”κ°€ν•˜μ—¬ 100% ν…ŒμŠ€νŠΈ 컀버리지λ₯Ό μœ μ§€ν•©λ‹ˆλ‹€.
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Independent verification (host 1 session, 2026-09-05).

Behavior: no change. The call this PR edits (scripts/ci/sandboxed_web_e2e.py:237, _probe_isolation_capability) passes probe_command, a Python list built at :225-235, so subprocess.run already runs with shell=False β€” that is the keyword's default for list argv. Adding it explicitly changes nothing at runtime.

Consistency: yes. The file's two other subprocess call sites already spell it out (:461 in the Popen at :453, :603 in the run at :594), so this makes the third site match the file's own convention. The test extension pins the kwarg (captured["kwargs"].get("shell") is False), which is the right shape for a convention pin.

Scope check: +1/-0 and +2/-0, exactly as described; no other files. Nothing to repair. This is a normal-path PR, not a bypass candidate β€” it should just go through review.

@google-labs-jules

Copy link
Copy Markdown

Independent verification (host 1 session, 2026-09-05).

Behavior: no change. The call this PR edits (scripts/ci/sandboxed_web_e2e.py:237, _probe_isolation_capability) passes probe_command, a Python list built at :225-235, so subprocess.run already runs with shell=False β€” that is the keyword's default for list argv. Adding it explicitly changes nothing at runtime.

Consistency: yes. The file's two other subprocess call sites already spell it out (:461 in the Popen at :453, :603 in the run at :594), so this makes the third site match the file's own convention. The test extension pins the kwarg (captured["kwargs"].get("shell") is False), which is the right shape for a convention pin.

Scope check: +1/-0 and +2/-0, exactly as described; no other files. Nothing to repair. This is a normal-path PR, not a bypass candidate β€” it should just go through review.

Acknowledged. The explicit shell=False is indeed a convention consistency enhancement and matches the behavior at runtime.

… capability

`subprocess.run` 호좜 μ‹œ `shell=False` 인자λ₯Ό λͺ…μ‹œμ μœΌλ‘œ μΆ”κ°€ν•˜μ—¬ 잠재적인 λͺ…λ Ήμ–΄ μ‚½μž… 곡격(Command Injection) μœ„ν—˜μ„ λ°©μ§€ν•˜κ³  λ³΄μ•ˆ 검사 도ꡬ(Bandit B603)의 μš”κ΅¬ 사항을 μΆ©μ‘±ν•©λ‹ˆλ‹€. μ—°κ΄€λœ ν…ŒμŠ€νŠΈ 파일의 Mock 객체에도 `shell=False` μΈμžκ°€ μ˜¬λ°”λ₯΄κ²Œ μ „λ‹¬λ˜λŠ”μ§€ ν™•μΈν•˜λŠ” 검증 λ‘œμ§μ„ μΆ”κ°€ν•˜μ—¬ 100% ν…ŒμŠ€νŠΈ 컀버리지λ₯Ό μœ μ§€ν•©λ‹ˆλ‹€.

Copy link
Copy Markdown
Contributor Author

2026-09-20 protected-base admission correction for 3509d9fdeaf0f3b1b6ced13574adb0ded7a7f790.

GitHub reports this Ready PR mechanically non-mergeable. Exact comparison with protected main is diverged and 365 commits behind; CodeQL is terminal failure and no formal review exists. Historical receipts cannot authorize the current protected-base merge.

Moving the PR to Draft / Proposed preserves every commit, review, thread, and valid delta. This is not closure or abandonment. Reconcile protected main through an ordinary non-force merge, repair valid findings, run terminal exact-head protection, and obtain qualifying independent current-head approval before returning to Ready. No review dismissal, synthetic status, manual rerun, bypass, Force Push, merge, or Close is authorized.

@seonghobae
seonghobae marked this pull request as draft September 19, 2026 17:57
@google-labs-jules

Copy link
Copy Markdown

2026-09-20 protected-base admission correction for 3509d9fdeaf0f3b1b6ced13574adb0ded7a7f790.

GitHub reports this Ready PR mechanically non-mergeable. Exact comparison with protected main is diverged and 365 commits behind; CodeQL is terminal failure and no formal review exists. Historical receipts cannot authorize the current protected-base merge.

Moving the PR to Draft / Proposed preserves every commit, review, thread, and valid delta. This is not closure or abandonment. Reconcile protected main through an ordinary non-force merge, repair valid findings, run terminal exact-head protection, and obtain qualifying independent current-head approval before returning to Ready. No review dismissal, synthetic status, manual rerun, bypass, Force Push, merge, or Close is authorized.

Understood. The PR has diverged significantly from main and is structurally non-mergeable due to missing terminal verdicts and CI failures. Since this is a protected-base admission correction moving the PR to Draft to preserve historical data, I am acknowledging that work on this specific PR instance is superseded by the requirement to sync with main. Stopping work.

The bubblewrap capability probe already passes shell=False, and the
mount-operation test requires that keyword. The PATH-shadow test calls
the same subprocess.run and now requires it too.
@seonghobae

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of the semantic no-op already decided in #1390 (and #2129): subprocess.run/Popen default to shell=False, and _probe_isolation_capability passes an argv list, so adding the keyword changes no behavior or security boundary. start_service/run_shell on main already pass shell=False explicitly. Branch and commits remain recoverable; reopen if a reproduced shell-execution path is found.

@seonghobae seonghobae closed this Sep 28, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as a duplicate of the semantic no-op already decided in #1390 (and #2129): subprocess.run/Popen default to shell=False, and _probe_isolation_capability passes an argv list, so adding the keyword changes no behavior or security boundary. start_service/run_shell on main already pass shell=False explicitly. Branch and commits remain recoverable; reopen if a reproduced shell-execution path is found.

Understood. Acknowledging that this work is a duplicate of a previously decided semantic no-op and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Normal-priority or P2 work type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant