fix(ci): issue titles containing quotes break the Slack notification workflow#1107
Open
Echolonius wants to merge 1 commit into
Open
fix(ci): issue titles containing quotes break the Slack notification workflow#1107Echolonius wants to merge 1 commit into
Echolonius wants to merge 1 commit into
Conversation
The workflow interpolated the raw issue title into a JSON payload, so any title containing a double quote produced invalid JSON and the run failed. All three historical failures of this workflow (issues titled with "defer", skills="all", and "Error: Stream closed") are titles containing quotes; every success is quote-free. Wrap the interpolation in toJSON(format(...)) so the title is escaped (and, as a side effect, a crafted title can no longer inject arbitrary Slack API payload fields).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Post new issues to Slack" workflow interpolates the raw issue title into its JSON payload:
Any issue title containing a double quote produces invalid JSON, and the run fails. The correlation is exact across this workflow's history:
… ("Error: Stream closed")(#1105)PreToolUse "defer" does not end the query(#1060)… with skills="all" …(#1044)Beyond lost notifications, the raw interpolation lets a crafted title inject arbitrary JSON into the
chat.postMessagepayload (e.g. extra Slack API fields/blocks).Fix
Wrap the interpolation in
toJSON(format(...)), which emits a fully-escaped JSON string (quotes, backslashes, newlines).Verified by parsing the workflow YAML and simulating the expression interpolation with a hostile title (quotes + backslashes): the rendered payload is valid JSON and the title displays verbatim.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YcMi8ny9DUBDf6y6m76HWk