mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-07-27 12:03:19 +02:00
7b44049e6e
When an IdP name claim contains trailing whitespace (e.g. 'Matt '), every proxied API request failed with 502 'Illegal header value' because httpx enforces RFC 7230 which forbids leading/trailing OWS in header values. Defense in depth: - strip_userinfo() trims the IdP name at ingress (oidc.py) - _sanitize_header_value() removes CTL/DEL chars at both header-injection sites (API proxy + auth-callback bootstrap) in app.py - update_profile() trims user-supplied names in PUT handler X-User-Name is informational only (seeds non-unique UserProfile.name); identity/auth are keyed on X-User-Id and X-User-Roles, so sanitization is safe.