fix(python): scope env to exported vars only, drop shell-local variable merge#2059
Closed
chaliy wants to merge 1 commit into
Closed
fix(python): scope env to exported vars only, drop shell-local variable merge#2059chaliy wants to merge 1 commit into
chaliy wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent unexported shell-local variables from being visible to embedded Python (so os.getenv() / os.environ reflect exported env only), aligning behavior with bash semantics and reducing information disclosure risk.
Changes:
- Updates the spec-case to distinguish exported vs unexported variable visibility from Python.
- Tightens the integration test
unexported_var_not_leakedto assert the unexported variable is not visible. - (Per PR description) expects the Python builtin to stop merging shell-local variables into the Python environment, but that implementation change is not included in the files changed by this PR.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/bashkit/tests/spec_cases/python/env_leak.test.sh | Adjusts spec coverage to require exported vars visible and unexported vars not visible. |
| crates/bashkit/tests/integration/python_security_tests.rs | Strengthens the regression assertion to require INTERNAL_VAR is not visible from Python. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+615
to
+616
| assert_eq!(r.exit_code, 0); | ||
| assert_eq!(r.stdout.trim(), "none"); |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | e8e283e | Commit Preview URL Branch Preview URL |
Jun 12 2026, 10:04 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #2058 — implementation change and test updates combined into one PR covering both issues #2043 and #2044.