Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

fix(http): redact sensitive request config in error logs#328

Open
jasonandjay wants to merge 1 commit into
Polymarket:mainfrom
jasonandjay:fix/redact-error-config
Open

fix(http): redact sensitive request config in error logs#328
jasonandjay wants to merge 1 commit into
Polymarket:mainfrom
jasonandjay:fix/redact-error-config

Conversation

@jasonandjay
Copy link
Copy Markdown

@jasonandjay jasonandjay commented Mar 15, 2026

Fixes #327

What changed

  • Stop logging raw err.response.config in HTTP helper error paths.
  • Add sanitizeAxiosResponseConfig() to only keep safe fields (method, url, timeout).
  • Add unit test to ensure sensitive fields like headers and auth are not exposed.

Why

The previous error logging could leak authorization material via request config dumps in logs.


Note

Low Risk
Low risk: limits error-log output to a small allowlist and adds a unit test; behavior changes are confined to logging and should not affect request/response handling.

Overview
Updates HTTP helper error logging to stop dumping raw Axios response.config (which may include auth/headers) and instead log a sanitized subset via new sanitizeAxiosResponseConfig().

Adds a unit test to assert only method, url, and timeout are retained and sensitive fields like headers/auth are excluded.

Written by Cursor Bugbot for commit a946e5d. This will update automatically on new commits. Configure here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRITICAL SECURITY VULNERABILITY] The CLOB SDK dumps the full request config (including auth headers) in its error logs.

1 participant