Skip to content

ci: fix expression injection in slack-issue-notification workflow#896

Open
anishesg wants to merge 1 commit intoanthropics:mainfrom
proudhare:fix/ph-issue-895
Open

ci: fix expression injection in slack-issue-notification workflow#896
anishesg wants to merge 1 commit intoanthropics:mainfrom
proudhare:fix/ph-issue-895

Conversation

@anishesg
Copy link
Copy Markdown

Problem

.github/workflows/slack-issue-notification.yml interpolated github.event.issue.title directly into the Slack payload JSON string (line 25). Because the slackapi/slack-github-action v2.1.1 passes the payload through js-yaml (which uses last-wins semantics on duplicate keys), a crafted issue title containing JSON/YAML syntax can inject arbitrary extra Slack message blocks. A HackerOne researcher demonstrated this with a title containing a "}},{"type":"section",... payload that successfully appended an extra section to the posted Slack message.

Fix

Replaced the inline expression interpolation with a dedicated jq step that constructs the JSON payload from env: variables. All untrusted values (ISSUE_TITLE, ISSUE_AUTHOR, etc.) are passed as --arg strings to jq -n, so they are treated as opaque literals and any embedded JSON/YAML syntax is properly escaped before the payload is handed to the Slack action.

Fixes #895

## Problem

Signed-off-by: anish k <ak8686@princeton.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[H1-PoC-R035] t"}},{"type":"section","text":{"type":"mrkdwn","text":"H1-SECURITY-MARKER-R035

1 participant