Skip to content

fix(security): resolve ReDoS in image name validation regex#243

Merged
DimaBir merged 1 commit intomainfrom
fix/code-scanning-alerts
Apr 13, 2026
Merged

fix(security): resolve ReDoS in image name validation regex#243
DimaBir merged 1 commit intomainfrom
fix/code-scanning-alerts

Conversation

@DimaBir
Copy link
Copy Markdown
Collaborator

@DimaBir DimaBir commented Apr 13, 2026

Summary

  • Fix exponential backtracking vulnerability in validateImageName regex (CodeQL alert #352)
  • Remove . from hostname character classes so it only matches as a segment separator, eliminating ambiguous quantifier overlap

Test plan

  • Verify valid image names still pass: registry.example.com:5000/org/image:tag, myimage:latest, org/image@sha256:abc...
  • Verify ReDoS input -.-.-.-.-.-.-.-.-.-. no longer causes hang

@DimaBir DimaBir requested a review from a team as a code owner April 13, 2026 06:38
@DimaBir DimaBir merged commit 91a1da1 into main Apr 13, 2026
17 checks passed
@DimaBir DimaBir deleted the fix/code-scanning-alerts branch April 13, 2026 06:40
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