🔒 Fix Arbitrary Command Execution via OIL_SYSTEM_PREFIX in testing - #237
undivisible wants to merge 1 commit into
Conversation
Replaced `.env_remove("OIL_SYSTEM_PREFIX")` with `.env_clear()` in
`system/oil/src/util/security.rs` when spawning the test executable to
prevent inheriting the parent's environment variables.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5bffd434-51f2-4727-a4cf-edf857c653bd) |
|
Tick the box to add this pull request to the merge queue (same as
|
🎯 What: The
⚠️ Risk: Inheriting environment variables in self-executing tests could lead to unexpected behavior or arbitrary command execution via variables like
resolve_install_dest_without_prefixtest spawned the test executable but only removed theOIL_SYSTEM_PREFIXenvironment variable, allowing it to inherit all other variables.LD_PRELOADor other shell configurations.🛡️ Solution: Modified the test to use
.env_clear()instead of.env_remove("OIL_SYSTEM_PREFIX")to ensure the subprocess starts with a clean environment.PR created automatically by Jules for task 17662094030822357210 started by @undivisible
Note
Low Risk
Test-only change to subprocess environment setup; no production install-path or runtime behavior is modified.
Overview
Hardens the
resolve_install_dest_without_prefixtest when it re-executes the test binary in a subprocess (whenOIL_SYSTEM_PREFIXis set in the parent). The subprocess launcher now uses.env_clear()instead of.env_remove("OIL_SYSTEM_PREFIX"), so the child no longer inherits the full parent environment.That closes a test-only footgun where variables like
LD_PRELOADor other inherited config could alter subprocess behavior or widen arbitrary execution risk during self-spawned test runs.Reviewed by Cursor Bugbot for commit c0a42c4. Configure here.