Repository navigation
detect ipv6 literal hosts in url2cluster and token endpoint check - #9165
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Added a bug fix note in release-notes/current.yaml. |
| @@ -66,10 +66,8 @@ func url2Cluster(strURL string) (*urlCluster, error) { | |||
|
|
|||
| name := clusterName(u.Hostname(), uint32(port)) | |||
|
|
|||
| if ip, err := netip.ParseAddr(u.Hostname()); err == nil { | |||
| if ip.Unmap().Is4() { | |||
There was a problem hiding this comment.
hey @zhaohuabing do you remember why this code was added
There was a problem hiding this comment.
I had a dig through the history on this in case it helps. The check traces back to the original OIDC translation in #2191, where it was written as net.ParseIP(host).To4() != nil, so it only ever matched IPv4 literals. #2447 later swapped net.ParseIP for netip.ParseAddr across the tree and carried this one over verbatim as Unmap().Is4(), so the IPv4-only behaviour is original rather than something the migration introduced.
As far as I can tell nothing downstream relies on it being IPv4-specific. An IPv6 literal endpoint is just as much a static cluster as an IPv4 one, and the other host checks in backend.go and validate.go already treat any address that parses as an IP the same way, so dropping the Is4 narrowing just lines these two spots up with those.
6040eb6 to
84535aa
Compare
|
can you fix DCO? |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #9165 +/- ##
==========================================
+ Coverage 75.31% 75.36% +0.04%
==========================================
Files 252 252
Lines 41434 41432 -2
==========================================
+ Hits 31208 31225 +17
+ Misses 8111 8095 -16
+ Partials 2115 2112 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: dxbjavid <[email protected]>
Signed-off-by: dxbjavid <[email protected]>
84535aa to
88f9327
Compare
|
done, signed off both commits and force-pushed. DCO should be green now. |
|
Hi maintainers, Just following up on this PR. The requested release note and DCO fixes have been addressed, and the latest changes have been pushed. Could you please let me know if there is anything else that needs to be updated on my side, or if the PR is waiting for a final merge decision? Thank you for your time and review. |
Signed-off-by: zirain <[email protected]>
|
Sorry for missing this one, triggered now. |
Signed-off-by: Javid Khan <[email protected]>
|
merged latest main to clear the conflict. release notes moved to the new per-file format under release-notes/current since i last touched this, so i've shifted my entry over to bug_fixes/9165-ipv6-literal-oidc-token-jwks-endpoints.md. the two code changes are unchanged and the branch is mergeable again. |
|
Thank you both for the reviews and approvals! I really appreciate your time and feedback throughout the process. |
|
/retest |
|
TY! |
…voyproxy#9165) * detect ipv6 literal hosts in url2cluster and token endpoint check Signed-off-by: dxbjavid <[email protected]> * add release note for ipv6 literal endpoint fix Signed-off-by: dxbjavid <[email protected]> --------- Signed-off-by: dxbjavid <[email protected]> Signed-off-by: zirain <[email protected]> Signed-off-by: Javid Khan <[email protected]> Co-authored-by: zirain <[email protected]> (cherry picked from commit 30d456e) Signed-off-by: jukie <[email protected]>
* detect ipv6 literal hosts in url2cluster and token endpoint check (#9165) * detect ipv6 literal hosts in url2cluster and token endpoint check Signed-off-by: dxbjavid <[email protected]> * add release note for ipv6 literal endpoint fix Signed-off-by: dxbjavid <[email protected]> --------- Signed-off-by: dxbjavid <[email protected]> Signed-off-by: zirain <[email protected]> Signed-off-by: Javid Khan <[email protected]> Co-authored-by: zirain <[email protected]> (cherry picked from commit 30d456e) Signed-off-by: jukie <[email protected]> * Revert LuaPerRoute source materialization for Lua (#9426) * Revert "[xds] stabilize listener-level Lua XDS filters to avoid listener drain (#8598)" This reverts commit 80b2762. Why: - Back out the LuaPerRoute stabilization layer together with #8355 while investigating the Gateway-scoped Lua memory regression from #9355. - #8598 only stabilizes per-route Lua HCM slot names; it still leaves Lua source materialized per route, so it is not sufficient for the memory issue. Test plan: - `go test ./internal/xds/translator` Signed-off-by: Arko Dasgupta <[email protected]> * Revert "refactor/perf: use LuaPerRoute instead of FilterConfig (#8355)" This reverts commit f31ac4e. Why: - #8355 materialized Gateway-targeted Lua as per-route LuaPerRoute source code. - With large route tables, identical Gateway-scoped scripts are duplicated across route entries and worker Lua runtime state, matching the memory regression reported in #9355. - Restoring listener-level Lua source avoids scaling the Gateway-scoped script with route count. Test plan: - `go test ./internal/xds/translator` Fixes #9355 Signed-off-by: Arko Dasgupta <[email protected]> * add filterContext in per route level Signed-off-by: Arko Dasgupta <[email protected]> * [xds] scope Lua revert to translator changes Remove unrelated Gateway API status-merge and redirect regression files that were accidentally included with the filterContext follow-up. Add a breaking-change fragment documenting the listener-level Lua source layout and filter-key migration for EnvoyPatchPolicy and extension consumers. Test: make test Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]> (cherry picked from commit 76bd888) Signed-off-by: jukie <[email protected]> * fix: default backend TLS max version to 1.3 (#9412) Backend (upstream) TLS connections were silently capped at TLS 1.2. Apply the defaults (min 1.2, max 1.3) in applyBackendTLSSetting when not configured. Fixes #9395 Signed-off-by: vishwas-bm <[email protected]> (cherry picked from commit 581a9c5) Signed-off-by: jukie <[email protected]> * fix: add default retry policy for Envoy wasm module fetch (#9462) add default retry policy for Envoy wasm module fetch Signed-off-by: jukie <[email protected]> (cherry picked from commit 3e18557) Signed-off-by: jukie <[email protected]> * fix/refactor: deep copy status in translator for all resources (#9458) Signed-off-by: Rudrakh Panigrahi <[email protected]> Co-authored-by: zirain <[email protected]> (cherry picked from commit e51b417) Signed-off-by: jukie <[email protected]> * fix(logs): restore ISO 8601 timestamp format (#9493) * fix(logs): restore ISO 8601 timestamp format Signed-off-by: Florian Wiegand <[email protected]> * fix(logs): add release note for ISO 8601 timestamp fix Signed-off-by: Florian Wiegand <[email protected]> --------- Signed-off-by: Florian Wiegand <[email protected]> (cherry picked from commit 2621405) Signed-off-by: jukie <[email protected]> * fix: unreferenced Secret events trigger reconciliation when HTTPRouteFilter CRD exists (#9488) * fix: unreferenced Secret events trigger reconciliation when HTTPRouteFilter CRD exists isHTTPRouteFilterReferencingSecret returned true on both branches, so with the HTTPRouteFilter CRD installed (the default), every Secret write in the cluster passed validateSecretForReconcile and enqueued a full reconcile. Any high-frequency Secret writer (secret sync controllers, cert rotation) drives the controller to reconcile continuously. Return false when no HTTPRouteFilter references the Secret, matching the other is*ReferencingSecret helpers. Enable hrfCRDExists in the predicate test so the existing unreferenced-Secret case guards this path, and add positive/negative cases for HTTPRouteFilter credential injection refs. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: James Hong <[email protected]> (cherry picked from commit 4d7686c) Signed-off-by: jukie <[email protected]> --------- Signed-off-by: dxbjavid <[email protected]> Signed-off-by: zirain <[email protected]> Signed-off-by: Javid Khan <[email protected]> Signed-off-by: jukie <[email protected]> Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: vishwas-bm <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> Signed-off-by: Florian Wiegand <[email protected]> Signed-off-by: James Hong <[email protected]> Co-authored-by: Javid Khan <[email protected]> Co-authored-by: zirain <[email protected]> Co-authored-by: Arko Dasgupta <[email protected]> Co-authored-by: vishwas-bm <[email protected]> Co-authored-by: Rudrakh Panigrahi <[email protected]> Co-authored-by: Florian Wiegand <[email protected]> Co-authored-by: James Hong <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
While reading the oidc cluster building I noticed url2Cluster and validateTokenEndpoint both use ip.Unmap().Is4() to spot an IP literal host, so only IPv4 is caught and an IPv6 literal like [::1] slips through. In url2Cluster that means a numeric IPv6 token or jwks endpoint is classified as a strict DNS cluster instead of a static one, and in validateTokenEndpoint it bypasses the domain-name requirement meant to forbid IP-literal token endpoints. Dropped the Is4 narrowing so a successful ParseAddr is treated as an IP in both spots, which matches how the hostname checks in backend.go and validate.go already behave.