oatpp-authkit/test
Uwe Schuster fafee1278f #16 (audit M-1..M-12): fix the medium-severity findings
M-1  TokenExtract: exact-name cookie parse (new pure cookieValue helper) —
     a substring find("session=") could be shadowed by a sibling xsession=,
     defeating __Host-/__Secure- prefix guarantees.
M-2  AuthInterceptor: gate setup-mode pseudo-admin on a loopback bind and log
     the grant; document that IAuthBackend::hasActiveUsers() must fail closed.
M-3  ws/Hub: empty propertyIds now means NO access for non-admins (was "all") —
     a non-admin whose scope set failed to populate no longer gets every
     property's notifications. Admins still get all via role.
M-4  new util/OriginCheck.hpp (originHostname/sameOrigin/originAllowed) +
     Hub doc: WSController must validate Origin at the handshake (CSWSH).
M-6  RedactedFieldRepository: ctor throws on an unknown redaction field name
     (a typo would silently redact nothing, leaving credentials in history).
M-7  RateLimiter: ctor validates capacity (finite >=1) / refillRate (finite >0),
     throws std::invalid_argument — zero/negative/NaN silently disabled it.
M-8  TokenExtract: document that clientIpTrusted's "unknown"/"invalid" sentinels
     collapse to one shared rate-limit bucket off-proxy.
M-9  new util/SessionCookie.hpp: safe-by-default Set-Cookie builder
     (HttpOnly+Secure+SameSite=Strict+Path=/), rejects control chars / ';'.
M-10 AuthInterceptor: Origin/Referer-vs-Host check on session mutations
     (defence in depth atop X-Requested-With); cert path documented as
     non-browser / not CSRF-gated.
M-11 AuthInterceptor: optional injected RateLimiter throttles invalid-token
     attempts per client IP → 429.
M-12 AuthInterceptor: sanitize request method/path (strip control chars, cap
     length) before logging — closes log-line forging (CWE-117).

(M-5 — temporal non-atomic save — was already resolved by the H-4 fix.)

Tests: new test_token_extract / test_rate_limiter / test_origin_check /
test_session_cookie; extended test_redacted_field_repository. All 19 ctest
targets pass. README + header docs updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:53:22 +02:00
..
CMakeLists.txt #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_audit_log_repository.cpp #13: TemporalRepository save — stable-live + historical-copy semantics 2026-04-30 00:10:03 +02:00
test_body_size_limit.cpp #4: BodySizeLimitInterceptor — fail-closed on missing/malformed Content-Length 2026-04-25 21:36:50 +02:00
test_json_serialization.cpp #6: route ad-hoc JSON through ObjectMapper (Option A — DI everywhere, all-in-one) 2026-04-25 21:56:05 +02:00
test_negotiation.cpp #2: Browser-friendly 401/403 — content-negotiate JSON vs HTML/redirect 2026-04-25 13:23:08 +02:00
test_origin_check.cpp #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_queryable.cpp #9: Optional IQueryable<T> capability + in-house query AST 2026-04-29 12:55:29 +02:00
test_rate_limiter.cpp #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_redacted_field_repository.cpp #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_repository_decorators.cpp #16 (audit H-1..H-5): fix the five high-severity findings 2026-05-29 12:49:03 +02:00
test_repository_interface.cpp #10: TemporalFieldTraits<T> — decouple decorator from canonical column names 2026-04-29 14:23:40 +02:00
test_role_template_schema.cpp #14 PR 1: relocate role_templates module + Atlas migration docs 2026-05-06 12:36:18 +02:00
test_schema_contract.cpp #14 PR 0: replace imperative migration kit with declarative SchemaContract 2026-05-06 12:14:51 +02:00
test_security_headers.cpp #3: SecurityHeadersInterceptor — strict baseline + CspOverride ctor (Option B) 2026-04-25 21:54:58 +02:00
test_session_cookie.cpp #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_smtp_transport.cpp #16 (audit H-1..H-5): fix the five high-severity findings 2026-05-29 12:49:03 +02:00
test_temporal_field_traits.cpp #13: TemporalRepository save — stable-live + historical-copy semantics 2026-04-30 00:10:03 +02:00
test_token_extract.cpp #16 (audit M-1..M-12): fix the medium-severity findings 2026-05-29 13:53:22 +02:00
test_user_permission_schema.cpp #14 PRs 2 & 3: relocate user_property_permissions + user_group_permissions 2026-05-06 12:39:52 +02:00
test_user_schema.cpp #14 PR 4: relocate users with temporal shape (Option B) 2026-05-06 12:57:59 +02:00