fix: update AI summary comment command to use response variable#27
Merged
Conversation
fix: update AI summary comment command to use response variable chore: bump actions/ai-inference to v2
|
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.
Fix Shell Injection Vulnerability in AI Summary Workflow
Bug Fix
🐛 Resolved a shell injection vulnerability in the AI summary workflow where the AI inference response was directly interpolated into the shell command string. This allowed special characters (especially single quotes) in the AI-generated response to break out of the quoted context and potentially execute arbitrary shell commands, including exfiltrating secrets like
GITHUB_TOKEN.The fix passes the AI response through an environment variable (
$RESPONSE) instead of inline interpolation, ensuring the value is treated as data rather than being re-parsed by the shell.Changes
.github/workflows/summary.yml: Replaced the unsafe inline interpolation of${{ steps.inference.outputs.response }}with a safe$RESPONSEenvironment variable reference. TheISSUE_NUMBERargument is also now properly double-quoted. The response value is now passed via theenvblock, preventing shell injection.Before (vulnerable):
After (safe):