danielmiessler.fabric/internal
Authensor 3eba7a51d4 fix: shell-escape extension values to prevent command injection
The extension executor runs commands via 'sh -c' with user-controlled
values interpolated into the command string without escaping. A value
containing shell metacharacters (;, |, $(), backticks) is executed by
the shell, enabling command injection.

User input flows from content processed through a pattern into the
extension system via the InputSentinel, then into formatCommand which
interpolates it into the cmd_template, then into exec.Command('sh', '-c').
No escaping is applied at any point.

Fix: wrap all user-controlled values (value, numbered pipe-split values)
in single quotes with embedded-single-quote escaping before interpolation.
This ensures sh -c treats them as literal arguments, not shell syntax.

The existing tests pass unchanged because the inner sh strips the single
quotes, so the executed command receives the same argument values.

Regression test added: ShellInjectionBlocked verifies that input
'hello; touch /marker' does not create the marker file.

Signed-off-by: John Kearney <johndanielkearney@gmail.com>
2026-07-01 21:55:21 -05:00
..
chat feat: replace hardcoded error strings with i18n translation keys 2026-02-21 13:28:52 -08:00
cli modernize ./... 2026-05-28 12:27:27 -07:00
core fix: parse vendor prefix from model name when vendor is not specified 2026-04-08 18:17:59 +08:00
domain refactor: replace fmt.Errorf("%s", ...) with errors.New() and normalize i18n strings 2026-02-21 15:48:01 -08:00
i18n feat: cache OpenAI model discovery and handle provider rate limits 2026-06-09 14:36:46 -07:00
log feat: add wire debug level (4) for full LLM request/response debug logging 2026-02-21 19:48:38 -08:00
plugins fix: shell-escape extension values to prevent command injection 2026-07-01 21:55:21 -05:00
server refactor: propagate context.Context through Vendor interface methods 2026-03-25 16:09:10 -07:00
tools feat: internationalize YouTube visual extraction flags and error messages 2026-04-05 15:22:28 -07:00
util feat: replace hardcoded error strings with i18n translation keys 2026-02-21 13:28:52 -08:00