Skip to content

fix(shell): block dangerous environment variables#429

Merged
mangelajo merged 1 commit into
mainfrom
fix/shell-driver-block-dangerous-env-vars
Apr 8, 2026
Merged

fix(shell): block dangerous environment variables#429
mangelajo merged 1 commit into
mainfrom
fix/shell-driver-block-dangerous-env-vars

Conversation

@ambient-code

@ambient-code ambient-code Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a blocklist of security-sensitive environment variables (LD_PRELOAD, LD_LIBRARY_PATH, PATH, PYTHONPATH, BASH_ENV, KUBECONFIG, HOME) and dangerous prefixes (LD_*, BASH_FUNC_*) to the shell driver's _validate_script_params method
  • Rejects any client-supplied env var matching the blocklist with a clear error message
  • Adds 3 new unit tests covering blocked exact names, blocked prefixes, and safe variables still working

Fixes #359

Test plan

  • All 17 shell driver tests pass (14 existing + 3 new)
  • Linting passes with make lint-fix
  • CI pipeline passes

🤖 Generated with Claude Code

Add a blocklist of security-sensitive environment variables (LD_PRELOAD,
PATH, PYTHONPATH, etc.) and dangerous prefixes (LD_*, BASH_FUNC_*) to
prevent privilege escalation through the shell driver's env var passthrough.

Fixes #359

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Apr 8, 2026

Copy link
Copy Markdown

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit a43b846
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69d669dfff75780008d4c8c0
😎 Deploy Preview https://deploy-preview-429--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ambient-code

ambient-code Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

PR Review Status

CI Status: All checks are passing (build, pytest, e2e tests, lint, typos).

Review Comments: No unaddressed review comments found.

Code Review Notes:

  • The blocklist approach for BLOCKED_ENV_VARS and BLOCKED_ENV_PREFIXES is clean and straightforward.
  • The validation integrates correctly into the existing _validate_script_params method, running after the isidentifier() check.
  • The LD_* prefix block covers the exact entries (LD_PRELOAD, LD_LIBRARY_PATH) as well as other dangerous LD variables like LD_AUDIT, LD_DEBUG, etc.
  • The three new tests cover exact-match blocking, prefix-match blocking, and the positive case (safe vars still work).
  • Error messages are clear and actionable.

No code changes needed at this time. The PR looks ready for maintainer review.

🤖 Generated with Claude Code

@mangelajo mangelajo merged commit 331f665 into main Apr 8, 2026
29 checks passed
@raballew raballew deleted the fix/shell-driver-block-dangerous-env-vars branch June 5, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell driver allows setting dangerous environment variables

1 participant