Skip to content

security: validate core integer bounds - #4189

Open
EndlessSeeker wants to merge 1 commit into
higress-group:mainfrom
EndlessSeeker:codex/openssf-high-core-integer-bounds
Open

security: validate core integer bounds#4189
EndlessSeeker wants to merge 1 commit into
higress-group:mainfrom
EndlessSeeker:codex/openssf-high-core-integer-bounds

Conversation

@EndlessSeeker

Copy link
Copy Markdown
Collaborator

Summary

  • parse local rate-limit annotations directly as uint32 values
  • reject zero rates, zero burst multipliers, negative/overflowing annotations, and burst multiplication overflow
  • parse ZooKeeper endpoint ports with a 16-bit bound and skip invalid, zero, or out-of-range endpoints instead of emitting wrapped port values
  • add boundary regression tests for annotation parsing, burst overflow, and invalid ZooKeeper ports

CodeQL coverage

This addresses three open High go/incorrect-integer-conversion alerts in Higress-owned core code: alerts 29, 30, and 5. No finding is dismissed or suppressed.

Validation

  • gofmt completed for all changed Go files
  • git diff --check passed
  • targeted tests were added for both code paths

A local targeted go test invocation was blocked before compilation because the existing generated external/istio tree in this workspace requires Go 1.26 while the repository and CI select Go 1.24. No dependency or generated tree was changed to bypass that mismatch; the clean GitHub CI run is the authoritative test for this PR.

Change-Id: I3a4507858e92347d0fc87e8110279530400e097a
Signed-off-by: EndlessSeeker <1766508902@qq.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c8b8279). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/ingress/kube/annotations/local_rate_limit.go 74.19% 4 Missing and 4 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4189   +/-   ##
=======================================
  Coverage        ?   50.82%           
=======================================
  Files           ?       88           
  Lines           ?    13431           
  Branches        ?        0           
=======================================
  Hits            ?     6826           
  Misses          ?     6152           
  Partials        ?      453           
Files with missing lines Coverage Δ
pkg/ingress/kube/annotations/local_rate_limit.go 86.66% <74.19%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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