Skip to content

🐛 bug: validate and safely apply workflow version updates#4273

Merged
ReneWerner87 merged 2 commits into
mainfrom
propose-fix-for-workflow-version-injection
May 11, 2026
Merged

🐛 bug: validate and safely apply workflow version updates#4273
ReneWerner87 merged 2 commits into
mainfrom
propose-fix-for-workflow-version-injection

Conversation

@gaby

@gaby gaby commented May 10, 2026

Copy link
Copy Markdown
Member

Motivation

  • Fix a source-code injection vulnerability in .github/workflows/update-version.yml where an unvalidated version input could break out of the Go string literal in app.go and inject arbitrary top-level Go declarations.

Description

  • Add strict semantic-version validation (^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$) in the Determine version step and fail fast for invalid inputs.
  • Escape the VERSION value via python3 JSON quoting and replace the entire const Version = "..." line with a safe sed -E pattern to prevent quote-breaking payloads from injecting code into app.go.
  • Preserve existing behavior for auto-detecting a draft release tag and skipping commits when the version is unchanged.

Copilot AI review requested due to automatic review settings May 10, 2026 23:09
@gaby gaby requested a review from a team as a code owner May 10, 2026 23:09
@gaby gaby requested review from ReneWerner87, efectn and sixcolors May 10, 2026 23:09
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/update-version.yml is excluded by !**/*.yml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4eeaf3b-4b68-4448-9a97-2bfa96dee761

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch propose-fix-for-workflow-version-injection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Hardens the manual Update Version GitHub Actions workflow to prevent source-code injection when updating const Version in app.go, by validating version inputs and applying a safer replacement strategy.

Changes:

  • Add semantic-version style validation for the resolved version before proceeding.
  • Escape the VERSION value and replace the entire const Version = "..." line via an anchored sed -E pattern.
  • Preserve existing behavior for auto-detecting the latest draft release tag and skipping commits when no change is needed.
Comments suppressed due to low confidence (1)

.github/workflows/update-version.yml:80

  • The post-update verification uses grep without -F, so the version is treated as a regex (e.g., . matches any character). This can produce false positives and fail to actually verify the exact const Version = "..." line. Use fixed-string matching (and ideally anchor to the full line) when checking the updated value.
          sed -i -E "s|^const Version = \"[^\"]+\"$|const Version = \"${escaped_version}\"|" app.go
          echo "Updated: ${current} → ${VERSION}"

          # Verify the change
          grep "const Version = \"${VERSION}\"" app.go

Comment thread .github/workflows/update-version.yml Outdated
@codecov

codecov Bot commented May 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.26%. Comparing base (c48bbc2) to head (62caab7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4273      +/-   ##
==========================================
+ Coverage   91.21%   91.26%   +0.04%     
==========================================
  Files         130      130              
  Lines       12760    12760              
==========================================
+ Hits        11639    11645       +6     
+ Misses        709      704       -5     
+ Partials      412      411       -1     
Flag Coverage Δ
unittests 91.26% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ReneWerner87 ReneWerner87 merged commit ad161ca into main May 11, 2026
21 checks passed
@ReneWerner87 ReneWerner87 deleted the propose-fix-for-workflow-version-injection branch May 11, 2026 06:32
@github-project-automation github-project-automation Bot moved this to Done in v3 May 11, 2026
@ReneWerner87 ReneWerner87 modified the milestones: v3, v3.3.0 May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants