You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pi launch does not clear LD_* loader variables after sourcing .env #7580
bugcomponent/sandboxOpenShell sandbox environmentpriority/highSignificant impact, address soonsecuritySecurity threat model and related concernstriagedTriaged but awaiting human prioritization
Confirmed by comparing the two launch builders directly: codex's post-.env hygiene (codex_run.go:326) clears LD_PRELOAD LD_LIBRARY_PATH LD_AUDIT alongside the module-loader variables, with an explicit rationale that these can load code into any dynamically linked binary the run starts before its main runs. pi's equivalent (piLoaderEnvNames / piLoaderEnvUnset) does not include them, so a value set via the agent-writable .env in one iteration is never cleared for pi and persists into the next launch.
One thing worth calling out: the proposed fix is correctly scoped to just the three LD_* names — PYTHON* is not needed here, since pi's hook adapter is a JS extension rather than a Python interpreter like codex's, so that particular hole (documented in codex's comment) doesn't apply to pi's launch.
There's an existing test, TestBuildPiRunCommand_LoaderEnvHygiene in pi_run_test.go, that already pins the ordering of the loader-env unset relative to . .env across every provider path — that's a direct template to extend with the three new names, per the issue's own suggestion.
A related but distinct gap exists in issue #3373 (sandbox credential-key blocklist parity), which is not a duplicate of this one — that issue is about env.sandbox credential keys, this one is about launch-time dynamic-linker hygiene.
Labels: This is a security-relevant sandbox/runtime hygiene gap in the pi launch path, matching the security + component/sandbox + priority/high pattern used on comparable loader/env-hygiene issues in this repo (e.g. #3373, #6920).
Next steps:
/fs-code — agent creates a PR to implement this issue
/fs-code <your instruction> — agent implements with your specific guidance
Hi @waynesun09 , I’m interested in contributing to this issue.
I noticed the newer #8498, which covers the broader problem of not sourcing the agent-writable .env as shell across runtimes. Its triage comment describes #7580 as related but not a duplicate, and #8498 is currently blocked by PR #8261.
Would you prefer a focused fix for #7580 now - adding the missing LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT cleanup to Pi and extending TestBuildPiRunCommand_LoaderEnvHygiene - or should this wait and be incorporated into the broader #8498 work?
I also saw the references to #6959, #7927, and #7988, but I understand those are related runtime/security work rather than direct implementations of this issue.
Thanks for the careful read, @Aliciapet11. We're starting #8498 now, and it rewrites the same .env handling in pi_run.go. To avoid two PRs on the same lines, we've folded the LD_* cleanup into that work, and #7580 will close when it lands. Since you've already traced this code path, we'd welcome your review on the #8498 PR once the code agent opens it. I'll tag you there.
bugcomponent/sandboxOpenShell sandbox environmentpriority/highSignificant impact, address soonsecuritySecurity threat model and related concernstriagedTriaged but awaiting human prioritization
Activity
fullsend-ai-triage commentedon Sep 23, 2026
🤖 Finished Triage · ✅ Success · Started 1:13 AM UTC · Completed 1:17 AM UTC
Commit:
e64cf64· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.41
fullsend-ai-triage commentedon Sep 23, 2026
Confirmed by comparing the two launch builders directly: codex's post-
.envhygiene (codex_run.go:326) clearsLD_PRELOAD LD_LIBRARY_PATH LD_AUDITalongside the module-loader variables, with an explicit rationale that these can load code into any dynamically linked binary the run starts before itsmainruns. pi's equivalent (piLoaderEnvNames/piLoaderEnvUnset) does not include them, so a value set via the agent-writable.envin one iteration is never cleared for pi and persists into the next launch.One thing worth calling out: the proposed fix is correctly scoped to just the three
LD_*names —PYTHON*is not needed here, since pi's hook adapter is a JS extension rather than a Python interpreter like codex's, so that particular hole (documented in codex's comment) doesn't apply to pi's launch.There's an existing test,
TestBuildPiRunCommand_LoaderEnvHygieneinpi_run_test.go, that already pins the ordering of the loader-env unset relative to. .envacross every provider path — that's a direct template to extend with the three new names, per the issue's own suggestion.A related but distinct gap exists in issue #3373 (sandbox credential-key blocklist parity), which is not a duplicate of this one — that issue is about
env.sandboxcredential keys, this one is about launch-time dynamic-linker hygiene.Labels: This is a security-relevant sandbox/runtime hygiene gap in the pi launch path, matching the security + component/sandbox + priority/high pattern used on comparable loader/env-hygiene issues in this repo (e.g. #3373, #6920).
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidanceAliciapet11 commentedon Oct 19, 2026
Hi @waynesun09 , I’m interested in contributing to this issue.
I noticed the newer #8498, which covers the broader problem of not sourcing the agent-writable .env as shell across runtimes. Its triage comment describes #7580 as related but not a duplicate, and #8498 is currently blocked by PR #8261.
Would you prefer a focused fix for #7580 now - adding the missing LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT cleanup to Pi and extending TestBuildPiRunCommand_LoaderEnvHygiene - or should this wait and be incorporated into the broader #8498 work?
I also saw the references to #6959, #7927, and #7988, but I understand those are related runtime/security work rather than direct implementations of this issue.
waynesun09 commentedon Oct 19, 2026
Thanks for the careful read, @Aliciapet11. We're starting #8498 now, and it rewrites the same
.envhandling inpi_run.go. To avoid two PRs on the same lines, we've folded theLD_*cleanup into that work, and #7580 will close when it lands. Since you've already traced this code path, we'd welcome your review on the #8498 PR once the code agent opens it. I'll tag you there.fix(#8498)!: read the agent-writable .env as data at launch