Skip to content

Fix shell escaping in getting current env#53335

Merged
ConradIrwin merged 2 commits intomainfrom
shell-escaping-bug
Apr 8, 2026
Merged

Fix shell escaping in getting current env#53335
ConradIrwin merged 2 commits intomainfrom
shell-escaping-bug

Conversation

@ConradIrwin
Copy link
Copy Markdown
Member

Credit to Dario Weißer for bringing this to our attention.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

  • Fixed a bug where a cleverly crafted directory name could lead to remote code execution

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 7, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Apr 7, 2026
In a few places (notably when getting the current environment) we were not
escaping directory names sufficiently. This could allow shell injection if a
project contained a specially crafted git submodule.

Credit to Dario Weißer for bringing this to our attention.
@ConradIrwin ConradIrwin enabled auto-merge (squash) April 8, 2026 02:40
@ConradIrwin ConradIrwin merged commit ac6117a into main Apr 8, 2026
30 checks passed
@ConradIrwin ConradIrwin deleted the shell-escaping-bug branch April 8, 2026 02:56
@ConradIrwin
Copy link
Copy Markdown
Member Author

/cherry-pick preview

github-actions bot pushed a commit that referenced this pull request Apr 8, 2026
Credit to Dario Weißer for bringing this to our attention.

Self-Review Checklist:

- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Fixed a bug where a cleverly crafted directory name could lead to
remote code execution
zed-zippy bot added a commit that referenced this pull request Apr 8, 2026
…eview) (#53355)

Cherry-pick of #53335 to preview

----
Credit to Dario Weißer for bringing this to our attention.

Self-Review Checklist:

- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX

checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Fixed a bug where a cleverly crafted directory name could lead to
remote code execution

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants