✨ New Release: PDF Redactor is live! True redaction & metadata removal with zero server uploads.
PrivateTools
Back to blog

Sanitize HAR Files Locally to Hide Cookies and Secrets

Remove session cookies, bearer tokens, passwords, and API keys from HAR files locally in your browser without uploading network logs to external servers.

Sanitize HAR Files Locally to Hide Cookies and Secrets

Sharing a HAR (HTTP Archive) file is a fast way to debug network issues with teammates, QA, or support. Because a HAR file records full request and response details, unredacted exports can expose sensitive session data.

Raw HAR files can contain session cookies, bearer tokens, API keys, form payloads, and internal URLs. Cleaning those values before sharing helps protect accounts, user data, and internal endpoints.

What Raw HAR Files Can Expose

A HAR file is structured JSON that captures traffic details from your browser session, including:

  • Session cookies: Can allow session replay or account access if exposed.
  • Authorization headers: Often include bearer tokens, API keys, or auth credentials.
  • Request bodies and form data: May contain passwords, tokens, or personal details submitted during a flow.
  • Internal or staging URLs: Can reveal private hostnames, query parameters, or internal API paths.

Local HAR Sanitization

Manual find-and-replace in large JSON files is slow and easy to miss edge cases, while sending raw network logs to third-party servers creates unnecessary data exposure.

The PrivateTools HAR File Sanitizer runs locally in your browser so your .har or .json file is processed on your device without uploading it to a remote server.

  • Local browser execution: Processes files in browser memory without sending network logs to external servers.
  • Targeted redaction rules: Masks common sensitive fields like cookies, auth headers, passwords, and tokens, plus custom field names.
  • Preserved JSON structure: Replaces sensitive values while keeping request timing, status codes, and log structure intact for debugging.
  • Large file support: Handles large .har and .json exports directly in the browser.

How to Sanitize a HAR File

1. Load Your HAR or JSON File

Select or drop your .har or .json file into the sanitizer.

2. Choose Redaction Rules and Custom Keys

Enable redaction for cookies, authorization headers, passwords, and tokens, and add any custom header or key names your app uses.

3. Download the Cleaned File

Export the sanitized file and confirm sensitive values are masked before attaching it to a ticket or issue.

Common Questions

How do I remove cookies and tokens from a HAR file?

Use a sanitization tool that masks sensitive cookie headers, Authorization values, and matching keys while keeping the rest of the HAR JSON valid.

Is it safe to upload a HAR file to a web tool?

Avoid uploading sensitive production HAR logs to unknown servers. Client-side tools process the file locally in your browser without server uploads.

Will redacting a HAR file break debugging?

Masking sensitive values keeps timestamps, HTTP methods, status codes, and non-sensitive headers intact so you can still inspect failing requests.

Can I redact custom headers or API keys?

Yes. Adding custom key or header names lets you mask project-specific tokens or internal headers alongside standard fields.

Summary

Clean cookies, tokens, and secrets out of HAR files locally before sharing bug reports by using the HAR File Sanitizer on PrivateTools.