-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Summary
Deep static audit of PR #1078 (token authentication and authorization) identified multiple confirmed defects, including high-severity issues in cache handling and JWKS concurrency.
A detailed report has been prepared locally in:
PR-1078-audit-report.md
Scope reviewed
- HTTP/TCP token auth entrypoints
- Token validation/cache (
ExternalAuthenticators) - JWT/JWKS path (
TokenProcessorsJWT,JWKSProvider) - OpenID/Opaque provider path (
TokenProcessorsOpaque) - Token user directory mapping (
TokenAccessStorage) - Config/parser/load integration
Confirmed defects
High
-
Use-after-erase in token cache expiry cleanup
src/Access/ExternalAuthenticators.cpp- Potential UB/crash in expired-entry cleanup path.
-
Data race in JWKS refresh/cache writes
src/Access/Common/JWKSProvider.cpp- Shared-lock path writes mutable state (
last_request_send,cached_jwks).
-
OpenID discovery constructor does not assign discovered fallback endpoints
src/Access/TokenProcessorsOpaque.cpp- Discovery-configured OpenID processor can fail fallback path.
Medium
-
token_cache_lifetimeunits mismatch (seconds vs minutes)src/Access/ExternalAuthenticators.cpp
-
cache_entry.expires_atcan remain unset in one branchsrc/Access/ExternalAuthenticators.cpp
-
jwt_static_keyparser requiresstatic_keyunconditionallysrc/Access/TokenProcessorsParse.cpp
-
Invalid
roles_filterregex falls back to unfiltered role mappingsrc/Access/TokenAccessStorage.cpp
-
Inconsistent malformed-token handling (false vs throw) across JWT processors
src/Access/TokenProcessorsJWT.cpp
Low
- Diagnostics consistency issues in token/JWKS paths
Recommended next actions
- Fix high-severity issues first (cache UB, JWKS race, OpenID discovery endpoint assignment).
- Add focused regression tests for:
- expired cache cleanup branch,
- concurrent JWKS refresh,
- OpenID discovery fallback behavior,
jwt_static_keyparser behavior for asymmetric algorithms.
Notes
This issue intentionally tracks only confirmed defects from static reasoning. Runtime stress/TSAN validation is still recommended for concurrency manifestation frequency.