Skip to content

Remediate reachable CVE by pinning golang.org/x/text to v0.3.8 and adding ParseLanguage regression coverage - #7

Draft
al1dazzi with Copilot wants to merge 4 commits into
mainfrom
copilot/rch-task-7044e31c2ad26913-remediate-vulnerability
Draft

al1dazzi with Copilot wants to merge 4 commits into
mainfrom
copilot/rch-task-7044e31c2ad26913-remediate-vulnerability

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown

This PR addresses the reachable high-priority dependency finding on golang.org/x/text@v0.3.7 in the ParseLanguage request path. The vulnerable version is removed from the module graph and replaced with a fixed version while keeping route behavior intact.

  • Dependency remediation

    • Bump golang.org/x/text from v0.3.7 to v0.3.8 in go.mod.
    • Regenerate go.sum so the resolved lock state no longer includes v0.3.7.
  • Handler-path regression coverage (internal/handlers/cve_test.go)

    • Add focused tests for ParseLanguage:
      • allowlisted valid tag succeeds (en-US)
      • unsupported tag is rejected (zh)
      • malformed encoded tag is rejected (en%0AUS)
  • Example of the added guard-path assertions

    req := httptest.NewRequest(http.MethodGet, "/parse-language?tag=en%0AUS", nil)
    rec := httptest.NewRecorder()
    
    ParseLanguage(rec, req)
    
    if rec.Code != http.StatusBadRequest {
        t.Fatalf("expected %d, got %d", http.StatusBadRequest, rec.Code)
    }

Copilot AI and others added 3 commits September 11, 2026 20:42
Co-authored-by: al1dazzi <247480224+al1dazzi@users.noreply.github.com>
Co-authored-by: al1dazzi <247480224+al1dazzi@users.noreply.github.com>
Co-authored-by: al1dazzi <247480224+al1dazzi@users.noreply.github.com>
Copilot AI changed the title [WIP] Remediate vulnerable dependency golang.org/x/text v0.3.7 Remediate reachable CVE by pinning golang.org/x/text to v0.3.8 and adding ParseLanguage regression coverage Sep 11, 2026
Copilot AI requested a review from al1dazzi September 11, 2026 20:46
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