R79: invalidation ttl tracks maxage, empty tpl hdr

This commit is contained in:
2026-08-13 18:21:35 +01:00
parent 1c5e301730
commit 351aae866e
3 changed files with 119 additions and 2 deletions
+8
View File
@@ -944,6 +944,14 @@ func (t *TraefikOidc) forwardAuthorized(rw http.ResponseWriter, req *http.Reques
if strings.Contains(headerValue, noValueSentinel) {
headerValue = strings.ReplaceAll(headerValue, noValueSentinel, "")
}
// Skip an empty render: Setting "" would clobber an identity
// header (X-Forwarded-User / X-Auth-Request-*) already injected
// earlier in this function with the authenticated value, silently
// dropping the user identity at the backend.
if headerValue == "" {
t.logger.Debugf("Skipping templated header %s: rendered value is empty", headerName)
continue
}
// Sanitize the rendered output: template inputs are claim-derived
// and attacker-influenceable, so reject control chars (header
// injection), bidi-override runes, the , ; = delimiters, and an