Skip to content

fix(security): 2 improvements across 2 files#662

Open
tomaioo wants to merge 2 commits intoversion-fox:mainfrom
tomaioo:fix/security/command-injection-risk-when-exporting-pa
Open

fix(security): 2 improvements across 2 files#662
tomaioo wants to merge 2 commits intoversion-fox:mainfrom
tomaioo:fix/security/command-injection-risk-when-exporting-pa

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 26, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: High | File: internal/shell/zsh.go:L78

The zsh.export method special-cases PATH and interpolates it directly into a double-quoted shell assignment (export PATH="%s";) without escaping. If a PATH segment contains shell metacharacters or command substitution syntax (e.g., $(...) or backticks), it can be evaluated when the activation script is sourced, leading to code execution in the user shell context.

Solution

Apply the same escaping logic used for other variables to PATH values (or use a robust shell-quoting helper for all vars). Avoid raw interpolation into double quotes.

Changes

  • internal/shell/zsh.go (modified)
  • internal/shell/clink.go (modified)

tomaioo added 2 commits April 26, 2026 11:24
- Security: Command injection risk when exporting PATH in Zsh activation script
- Security: Windows shell export does not escape values before emitting `set` commands

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Command injection risk when exporting PATH in Zsh activation script
- Security: Windows shell export does not escape values before emitting `set` commands

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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.

1 participant