Skip to content

Fix YAML syntax error and security issue in stale-hip-management workflow - #1322

Merged
mgarbs merged 1 commit into
mainfrom
fix-workflow-syntax-and-security
Nov 3, 2025
Merged

Fix YAML syntax error and security issue in stale-hip-management workflow#1322
mgarbs merged 1 commit into
mainfrom
fix-workflow-syntax-and-security

Conversation

@mgarbs

@mgarbs mgarbs commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a critical YAML syntax error and security vulnerability in the stale-hip-management workflow:

  • Fixed YAML syntax error on line 94: The multi-line string in the gh pr comment command was causing a parsing error. Resolved by using a heredoc pattern instead of inline multi-line strings
  • Fixed code injection vulnerability: Workflow inputs (github.event.inputs.*) were being used directly in bash without validation, allowing potential code injection. Now validates that inputs are positive integers before use
  • Improved YAML compatibility: Replaced backtick quotes with single quotes around 'keep-open' label reference

Changes

  1. Moved workflow inputs to environment variables with validation
  2. Added regex validation to ensure inputs are numeric only
  3. Used heredoc syntax for multi-line comment body
  4. Replaced backticks with single quotes for better compatibility

Test Plan

  • Workflow file passes YAML syntax validation
  • Input validation prevents non-numeric values
  • Test workflow execution in GitHub Actions

Security Impact

This PR addresses a code injection vulnerability where malicious workflow_dispatch inputs could execute arbitrary code. The fix ensures only numeric values are accepted for the day parameters.

@mgarbs
mgarbs requested review from a team as code owners November 3, 2025 13:26
@mgarbs
mgarbs requested a review from PavelSBorisov November 3, 2025 13:26
…flow

- Fix YAML syntax error on line 94 by using heredoc for multi-line comment
- Add input validation to prevent code injection attacks
- Move workflow inputs to environment variables with validation
- Replace backtick quotes with single quotes for better YAML compatibility

Signed-off-by: Michael Garber <michael.garber@hashgraph.com>
@mgarbs
mgarbs force-pushed the fix-workflow-syntax-and-security branch from 0434c85 to 5042a4c Compare November 3, 2025 13:34
@mgarbs
mgarbs merged commit 1380cc5 into main Nov 3, 2025
12 of 13 checks passed
@mgarbs
mgarbs deleted the fix-workflow-syntax-and-security branch November 3, 2025 14:53
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.

2 participants