Secrets and encoding

How to sanitize HAR files and remove sensitive data

Inspect a HAR archive for credentials and personal data before sharing it. PageUtil’s HAR File Sanitizer reviews supplied files locally and removes supported sensitive fields. Check the exported archive as well: application-specific query parameters, bodies and identifiers can require additional review.

Architecture diagram comparing raw browser HAR network logs, standard DevTools sanitized exports, and deep client-side payload redaction with intact waterfall timings.
Identifying credential leakage vectors across HTTP Archive 1.2 headers, query parameters, and payloads while preserving connection waterfall timings.

Why browser HAR exports leak credentials, session tokens, and customer data

A HAR file represents recorded HTTP exchanges as JSON. Depending on the browser, export settings, and available recording data, it can include request URLs, headers, query parameters, request payloads, and response content. It is not necessarily a complete record of every byte exchanged.

An export made with sensitive data enabled can contain Authorization headers, session cookies, and API keys. Bearer tokens and some encoded credentials (which you can inspect in JWT Decoder) may grant access if shared while still valid. Use a sanitized browser export and inspect its contents before attaching it to a support ticket.

Business data can remain in recorded request and response bodies, URLs, or custom headers. Look for customer records, employee email addresses, internal hostnames, and diagnostic messages. A sanitized export removes specified sensitive fields; it does not establish that all application data is suitable to share.

What Chrome’s sanitized HAR export removes and what to review

Chrome’s Network documentation says its sanitized HAR export omits Cookie, Set-Cookie, and Authorization headers. This includes response Set-Cookie headers as well as request credentials. Use the sanitized export rather than the separate export with sensitive data when preparing a recording to share.

Removing these headers does not establish that every remaining value is safe to disclose. Review request URLs, query parameters, custom headers, request bodies, and response bodies for application-specific secrets and personal data. For example, a token in a URL or a customer record in JSON needs separate attention.

Export behavior can change between browser versions. Check the current documentation and inspect the actual exported file. A label such as sanitized is not a guarantee that all confidential application data has been removed.

Comparison of Browser HAR Export Mechanisms vs Deep Sanitization
Data Field LocationChrome DevTools RawChrome DevTools SanitizedPageUtil HAR File Sanitizer
Request Authorization headerExposed (cleartext token)OmittedRedacted (Bearer / Basic credential audit)
Request Cookie headerExposed (active sessions)OmittedRedacted (per-cookie key-value mask)
Response Set-Cookie headerMay contain session cookiesOmittedRedacted when present
Custom auth headers (X-Api-Key)Review contentsReview contentsMatching header rules redact known names
URL query parameters (?token=)Review URL & query arrayReview URL & query arrayMatching rules redact request.url and queryString
POST request bodies (passwords)Review postDataReview postDataConfigured detection or body stripping
Response bodies (customer PII)Review content.textReview content.textConfigured detection or body stripping
Waterfall timing metricsRecorded fields retainedRecorded fields retainedRecorded fields retained (DNS, SSL, TCP, TTFB)

How to scan, sanitize, and audit a HAR file before sharing

Open HAR File Sanitizer in your browser and drag your .har file into the drop zone (or load the sample batch to explore a realistic recording). The file is parsed locally in browser memory without sending bytes across the network.

The tool recursively traverses every entry in log.entries. It analyzes request URLs to identify sensitive query string keys (such as access_token, api_key, auth, password, and session) and replaces their values with [REDACTED]. It audits request and response headers (which you can also analyze with HTTP Headers) to redact Authorization, Cookie, Set-Cookie, and vendor-specific authentication keys.

Next, the scanner runs heuristic token detectors across all text nodes and payloads. It flags and masks high-entropy API keys—including AWS Access Key IDs (AKIA...), GitHub Personal Access Tokens (ghp_...), Stripe secret keys (sk_live_...), and Google Cloud API keys (AIza...). It also detects PII such as email addresses and Luhn-validated credit card sequences.

Review the Risk Assessment Report at the top of the page. It summarizes critical and high-severity findings by category. You can filter findings by severity, click into specific requests to inspect what was redacted, and download the sanitized .har archive or copy an itemized Markdown risk report for your records.

// Example: Redacting an OAuth token exchange entry in HAR JSON
Before Sanitization:
{
  "request": {
    "method": "POST",
    "url": "https://api.example.com/v1/user?api_key=sec_prod_991823",
    "headers": [
      { "name": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1Ni..." },
      { "name": "Cookie", "value": "session_id=sess_49102; user=sarah" }
    ],
    "postData": {
      "text": "{\"password\":\"Secret123!\",\"email\":\"user@example.com\"}"
    }
  }
}

After Sanitization (PageUtil HAR File Sanitizer):
{
  "request": {
    "method": "POST",
    "url": "https://api.example.com/v1/user?api_key=[REDACTED]",
    "headers": [
      { "name": "Authorization", "value": "Bearer [REDACTED]" },
      { "name": "Cookie", "value": "[REDACTED]" }
    ],
    "postData": {
      "text": "{\"password\":\"[REDACTED]\",\"email\":\"[REDACTED]\"}"
    }
  }
}

Debugging latency waterfalls without leaking response payloads

In many engineering escalations—such as diagnosing CDN edge cache hit ratios, TCP connection delays, SSL negotiation overhead, or time-to-first-byte (TTFB) spikes—the actual content of the response body is completely irrelevant. The infrastructure or CDN engineer only needs the timing breakdown: blocked, dns, connect, ssl, send, wait, and receive.

When payload contents are unnecessary, switch the Payload & body handling setting to Strip all request & response bodies (Timing Debugging Mode). Still review the remaining URLs, headers, and metadata before sharing.

In this mode, the sanitizer strips request.postData.text and response.content.text while retaining request entries and recorded timing measurements. Removing bodies can reduce file size, but confidential information may still appear elsewhere in the recording. Review the sanitized output and share only the data needed for the investigation.

References

Use the linked specifications and product documentation to check behavior in your own environment.

Continue troubleshooting

Related tools

Frequently asked questions

What should I review after exporting a sanitized HAR from Chrome?

Chrome omits Cookie, Set-Cookie, and Authorization headers. Review the remaining URLs, query parameters, custom headers, and bodies for application-specific secrets or personal data. Check the actual export before sharing it.

Can third-party support teams debug latency without seeing response bodies?

They can often investigate using the recorded timings without payload bodies. Strip unnecessary bodies and review remaining URLs, headers, and metadata for confidential data. The recording may not contain every timing field.

How does the tool prevent sensitive query parameters from leaking?

The sanitizer parses the request URL and replaces values of known sensitive query parameters (such as token, api_key, auth, session, and password) with [REDACTED] in both the URL string and the queryString parameter array.

Does PageUtil store or transmit my uploaded HAR file?

No. All decompression, JSON traversal, pattern scanning, and redactions occur entirely inside your browser memory using Web Workers. Network traces never leave your device.

Can automated sanitizers guarantee complete anonymization?

No automated scanner can guarantee 100% anonymization because proprietary token formats, bespoke hashes, or confidential business text can resemble normal identifiers. Always review the itemized risk report before public sharing.

Need help with a tool or found a bug?

Report an issue directly to engineering. No accounts required — all client data remains private on your device.

Report an Issue →