Why Browser HAR Files Leak Production Secrets and How to Clean Them Client-Side
Sharing a browser network trace (HAR file) for debugging can unintentionally expose session cookies, bearer tokens, signed URLs, request bodies, and internal server details. Common regex-based scrubbers fail because they miss custom authentication headers, secrets embedded in URLs and redirects, and vendor-specific fields that pass through unchanged. The author built the Sunasty HAR Sanitizer, which runs entirely in the browser so no data is uploaded, and extracted its scrubbing core as the har-clean npm package. Instead of filtering out known secrets, the tool constructs a new HAR 1.2 file using explicit allowlists, keeping only validated fields. By default it strips all headers, cookies, query strings, and redirect targets, and rewrites URLs to a redacted form unless the user opts in.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in