Skip to content

[Sync] Update project files from source repository (3a1151a) - #177

Merged
mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-pre-commit-20260824-162848-3a1151a
Aug 24, 2026
Merged

mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-pre-commit-20260824-162848-3a1151a

Conversation

@mrz1836

@mrz1836 mrz1836 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

What Changed

  • Added CR/LF sanitization to caller-supplied version strings in .github/actions/setup-benchstat/action.yml to prevent output injection attacks where embedded newlines could append malicious key=value pairs to $GITHUB_OUTPUT
  • Replaced sed-based Go version parsing with anchored regex matching (^([0-9]+)\.([0-9]+)(\.(x|[0-9]+))?$) to reject malformed inputs like "1.25junk" instead of silently coercing them
  • Added validation that MAJOR >= 1 for both Go version and benchstat minimum Go threshold, preventing "0.x" versions from passing validation
  • Extracted shared helper functions (to_int, effective_failures, summary_is_corrupt) from .github/actions/validate-test-results/action.yml into new file .github/scripts/test-result-helpers.sh to prevent code duplication between validation and summary steps
  • Added permissions: contents: read to .github/workflows/codeql-analysis.yml, .github/workflows/fortress-security-scans.yml, and .github/workflows/scorecard.yml
  • Enhanced .github/workflows/fortress-test-matrix.yml with additional security hardening and validation logic

Why It Was Necessary

  • Prevents output injection vulnerabilities where crafted version strings containing newlines could inject workflow commands or append arbitrary key=value pairs to GitHub Actions output files
  • Eliminates code duplication between validation and summary steps by centralizing shared helper functions, ensuring both steps use identical logic and can't drift
  • Ensures stricter input validation to catch malformed version strings early rather than silently coercing them, improving security posture and error reporting

Testing Performed

  • Security hardening changes prevent injection attacks through version string validation and CR/LF stripping before values reach sensitive sinks like $GITHUB_OUTPUT or $(( )) arithmetic evaluation
  • Refactored helper functions are sourced from shared script in both validation and summary steps, maintaining identical behavior while eliminating duplicate code
  • Version string parsing now rejects invalid formats (e.g., "1.25junk", "0.99", "127") that were previously accepted

Impact / Risk

  • Security Improvement: Prevents output injection and arithmetic-eval injection attacks through multiple validation layers
  • Breaking Change: None - stricter validation may reject previously-accepted malformed inputs, but these were incorrect configurations
  • Risk: Low - changes are defensive hardening; shared helper extraction maintains existing behavior while improving maintainability

@mrz1836 mrz1836 self-assigned this Aug 24, 2026
@mrz1836 mrz1836 added automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps labels Aug 24, 2026
@github-actions github-actions Bot added update General updates size/L Large change (201-500 lines) labels Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Analysis

🟢 Overall Coverage: 91.5%
No Go files modified in this PR

Project coverage remains at 91.5% (3.2K/3.5K statements)

Changes: 9 config files

Coverage Metrics

Metric Value Grade Trend
Percentage 91.5% 🏆 A 📊
Statements 3.2K/3.5K 🏆 A No change
Quality Score 91.5/100 🏆 A 📈

Coverage Breakdown

█████████████░░ 91.5%

Resources


Generated via go-coverage • 2026-08-24 16:34:01 UTC

github-actions Bot added a commit that referenced this pull request Aug 24, 2026
🏷️ Generated with GoFortress
@mrz1836
mrz1836 merged commit 4004ce6 into master Aug 24, 2026
25 checks passed
@github-actions
github-actions Bot deleted the chore/sync-files-go-pre-commit-20260824-162848-3a1151a branch August 24, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps size/L Large change (201-500 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant