Files
Miorbnli 3a17d5993a fix: prevent $-pattern injection in prompt template and approval substitution (#123015)
* fix: prevent dollar-pattern injection in prompt template and approval substitution

Three call sites used String.replace/replaceAll with a string replacement
fed a runtime variable, causing dollar-amp/dollar-1/dollar-backtick
sequences in user-supplied args or approval ids to corrupt the rendered text.

Switch each to a function replacement so the value is treated literally:

- prompt-template-arguments: dollar-ARGUMENTS and dollar-@ substitution
  corrupted slash-command args containing dollar signs
- get-reply-inline-actions: bundle command template expansion had the
  same issue with normalizedArgs
- approval-reaction-runtime: approval id placeholder rendering mangled
  ids containing dollar signs; the iMessage sibling
  (extensions/imessage/src/approval-text.ts) already escapes this

* fix: rebase, drop unproven approval rewrite, add dollar regression

Address review: the approval placeholder helper has no canonical
/approve <id> producer in the plugin-SDK manual fallback path, so its
rewrite is unproven - revert it. Keep the two reachable prompt-template
fixes and add an owner-boundary regression covering literal dollar
sequences in dollar-ARGUMENTS and dollar-@ substitution (fails on the
old string replacement form, passes with the callback form).

* test(auto-reply): cover literal dollar bundle command arguments

* fix(agent-core): resolve prompt placeholders in a single substitution pass
2026-08-24 13:43:23 -07:00
..