You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TASK-057: redact credentials in http_request::operator<<
By default, http_request::operator<< now emits the fixed token
"<redacted>" in place of the following plaintext credential surfaces
(OWASP A09:2021 / CWE-312 / CWE-532):
- The Basic-auth password (pass:"<redacted>")
- The Authorization and Proxy-Authorization request headers
(and the same names in trailers/footers), case-insensitive
- Every cookie value (cookie keys remain visible for log triage)
The username (user:"...") is NOT redacted — REMOTE_USER access-log
convention; identifier, not a secret. Query-string arguments are
streamed verbatim and are documented as out-of-scope for TASK-057
(callers that put credential material in query parameters should
sanitize before constructing the request URL).
Opt-in builder flag create_webserver::expose_credentials_in_logs(true)
restores the v1 verbose form bit-for-bit, plumbed through the const
bool webserver::expose_credentials_in_logs member and applied per
request by webserver_impl::requests_answer_first_step. Default is
false (secure-by-default). create_test_request::expose_credentials_in_logs()
provides the same opt-in for unit tests without spinning up a webserver.
New unit test http_request_operator_stream_test (Test 1 +
Test 2) pins the default-redact and opt-in-exposes contracts. A new
builder-toggle smoke test in create_webserver_test pins the chained
setter shape. Doxygen on the friend operator<< declaration documents
the redaction policy and a CWE-312 / CWE-532 warning on the opt-in.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments