fix(git-tools): remove eval from issue-create wrapper #559

Closed
opened 2026-06-19 21:51:03 +00:00 by jason.woltje · 0 comments
Owner

Problem

The Mosaic git wrapper issue-create.sh builds a tea command string and executes it via eval. When an issue body contains Markdown inline code or shell-looking snippets, the shell can perform command substitution during the tea attempt.

Observed while creating issue #558: inline-code examples such as confidence/source values and mosaic budget command examples produced command-not-found / unknown-command noise before the API fallback succeeded.

Risk

  • User-provided issue/PR Markdown can be interpreted by the shell before reaching tea.
  • The API fallback may still create the issue, masking the unsafe wrapper behavior.
  • This is a security and reliability bug in the wrapper layer.

Required fix

  • Remove eval-based command construction from issue-create.sh.
  • Use argv arrays for gh and tea invocations.
  • Preserve multi-line Markdown bodies verbatim.
  • Add a regression test with Markdown containing inline-code, dollar signs, quotes, and command-looking snippets.

Acceptance criteria

  • Creating an issue with multi-line Markdown and inline code emits no shell command-substitution noise.
  • The issue body is preserved exactly enough for Markdown review.
  • Fallback behavior remains intact when tea cannot infer the repo.
## Problem The Mosaic git wrapper issue-create.sh builds a tea command string and executes it via eval. When an issue body contains Markdown inline code or shell-looking snippets, the shell can perform command substitution during the tea attempt. Observed while creating issue #558: inline-code examples such as confidence/source values and mosaic budget command examples produced command-not-found / unknown-command noise before the API fallback succeeded. ## Risk - User-provided issue/PR Markdown can be interpreted by the shell before reaching tea. - The API fallback may still create the issue, masking the unsafe wrapper behavior. - This is a security and reliability bug in the wrapper layer. ## Required fix - Remove eval-based command construction from issue-create.sh. - Use argv arrays for gh and tea invocations. - Preserve multi-line Markdown bodies verbatim. - Add a regression test with Markdown containing inline-code, dollar signs, quotes, and command-looking snippets. ## Acceptance criteria - Creating an issue with multi-line Markdown and inline code emits no shell command-substitution noise. - The issue body is preserved exactly enough for Markdown review. - Fallback behavior remains intact when tea cannot infer the repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#559