Skip to content

fix: prevent PR titles with special characters from breaking Slack changelog workflow - #38

Open
BenjaminLangenakenSF wants to merge 2 commits into
mainfrom
fix/slack-changelog-title-injection
Open

fix: prevent PR titles with special characters from breaking Slack changelog workflow#38
BenjaminLangenakenSF wants to merge 2 commits into
mainfrom
fix/slack-changelog-title-injection

Conversation

@BenjaminLangenakenSF

Copy link
Copy Markdown
Contributor

Description

PR titles containing double quotes and unquoted parentheses — e.g. BE-14720: Fix French typo "à été organisé(e)" in electronic meeting text — break the Get PR Details step with a bash syntax error, so the changelog job fails and no Slack message gets posted at all.

More generally, this workflow spliced ${{ github context values }} directly into shell script text across all three steps. Since GitHub Actions substitutes ${{ }} as literal text before bash parses the line, any PR title containing backticks or $(...) could trigger arbitrary command execution in the Post to Slack step (PR titles are attacker/contributor controlled).

This PR fixes it by passing every GitHub context value through an env: block instead, so bash treats it as an opaque variable value rather than re-parsing it as script text. Also fixed a related latent bug: the JSON-escaping sed handled " and newlines but not \, so a title containing a backslash would have produced invalid JSON.

Verified locally: the original line reproduces syntax error near unexpected token '(' with the BE-14720 title; the same title passed through an env var (this PR's approach) round-trips cleanly.

Fixes # (no tracked issue — found while investigating why BE-14720's title would affect the changelog Slack post)

Type of change

  • Bug fix
  • New feature
  • Breaking change

Checklist

  • README updated (if needed)
  • Version updated (if needed)
  • Documentation updated (if needed)

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Comment @coderabbitai help to get the list of available commands.

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.

1 participant