Skip to content

Escape Slack notification inputs#3730

Merged
virajmehta merged 2 commits intomainfrom
gb/escape-slack
Oct 1, 2025
Merged

Escape Slack notification inputs#3730
virajmehta merged 2 commits intomainfrom
gb/escape-slack

Conversation

@GabrielBianconi
Copy link
Copy Markdown
Member

@GabrielBianconi GabrielBianconi commented Sep 29, 2025

Fix #3718

First PR with Sonnet 4.5


Important

Escapes inputs for Slack notifications in GitHub workflow to prevent injection attacks.

  • Behavior:
    • Escapes inputs for Slack notifications in .github/workflows/slack-notifications.yml using jq to build payloads for various GitHub events.
    • Handles events: issues, issue_comment, pull_request_target, pull_request_review, discussion, and discussion_comment.
  • Implementation:
    • Adds separate steps to build payloads for each event type, ensuring inputs are properly escaped.
    • Updates Slack notification steps to use pre-built payloads from previous steps.

This description was created by Ellipsis for bbeb667. You can customize this summary. It will automatically update as commits are pushed.

Copilot AI review requested due to automatic review settings September 29, 2025 18:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR escapes Slack notification inputs to prevent potential security issues and JSON injection vulnerabilities in GitHub Actions workflow notifications. The change refactors inline payload definitions to use proper JSON construction with jq for safe input handling.

  • Extracts JSON payload construction into dedicated build steps using jq for proper escaping
  • Replaces inline YAML payload definitions with references to safely constructed payloads
  • Applies consistent escaping pattern across all notification types (issues, comments, PRs, discussions)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@virajmehta virajmehta added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 012e868 Oct 1, 2025
30 checks passed
@virajmehta virajmehta deleted the gb/escape-slack branch October 1, 2025 15:58
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.

Ensure the Slack bot escapes correctly

3 participants