You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): escape template data in the rendered deploy-azure.sh (bicep/arm) #964
internal/api/handler_federation.go (around lines 558-562 on main) renders the bicep/ARM deploy-azure.sh script with the raw template data. It does not pass the data through the shell escaping (shellEscapeData) that the other rendered scripts get. A value that passes input validation but contains shell syntax is therefore interpolated into the script verbatim.
Found by the independent review of #955. The reviewer's example: a contact email with a valid quoted local part containing $(id) is accepted, and the command runs on the machine of whoever downloads and runs deploy-azure.sh.
Impact
The person who supplies the value is the one who downloads and runs the script, so this is a self-targeted injection with a narrow blast radius. It is still a correctness and safety gap: the generated script should never execute data. #952 (escape flag values per output format) asked for the server side to be confirmed, and this path is the remaining gap.
Repro (no real Azure needed)
Request the bicep or ARM federation bundle with an email such as "a$(id)b"@example.com, or any field rendered into deploy-azure.sh that allows $(.
Inspect the rendered deploy-azure.sh. The value appears unquoted or unescaped inside a double-quoted shell context.
Run bash -n on the file to see that it parses, then run it in a sandbox with az stubbed: id executes.
Suggested fix
Render that template with shellEscapeData(data), as the other script paths do. Add a test that renders deploy-azure.sh with a $(...) payload and asserts the output contains no unescaped command substitution.
Already fixed on main by #963: the bicep/arm deploy-azure.sh render now goes through shellEscapeData (internal/api/handler_federation.go:561 on main). The remaining '}' and JSON-metacharacter handling for the contact email is in #992 (#991). Verified by the independent review of #992, which rendered 22 scripts with hostile emails and ran them with az stubbed: no command executed.
Activity
cristim commentedon Oct 16, 2026
Already fixed on main by #963: the bicep/arm deploy-azure.sh render now goes through shellEscapeData (internal/api/handler_federation.go:561 on main). The remaining '}' and JSON-metacharacter handling for the contact email is in #992 (#991). Verified by the independent review of #992, which rendered 22 scripts with hostile emails and ran them with az stubbed: no command executed.