mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-11-10 09:04:44 +00:00
fix(security): close confirmed findings from the 2026-10-15 hunt (#166)
Seven findings are fixed. Each fix has a regression test. - Compare X-Forwarded-Host and the serving host case-insensitively, so a case variant cannot widen the session cookie Domain. - Reject a future iat on the opaque introspection path. - Serve the cached parsed JWKS inside the signature-refresh cooldown. - Release the half-open circuit slot when a probe panics. - Cap requests that wait for provider initialisation at 512. Extra requests receive 503 with Retry-After. - Cap cookie deletion headers at 32 cookie names per response. - Cap front-channel sid markers at 1000, so unauthenticated requests cannot evict backchannel or jti replay markers.
This commit is contained in:
@@ -389,6 +389,13 @@ func (c *JWKCache) getPublicKeyFresh(ctx context.Context, jwksURL, kid string, h
|
||||
|
||||
if withinCooldown {
|
||||
// Serve the cached keyset; do not fetch upstream again.
|
||||
if v, found := c.cache.GetLocal(jwksURL + parsedKeysSuffix); found {
|
||||
if pj, ok := v.(*parsedJWKS); ok {
|
||||
if k, ok := pj.keys[kid]; ok {
|
||||
return k, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
if cached, found := c.cache.GetLocal(jwksURL); found {
|
||||
if jwks, ok := cached.(*JWKSet); ok {
|
||||
if k, ok := buildParsedJWKS(jwks).keys[kid]; ok {
|
||||
|
||||
Reference in New Issue
Block a user