What to strip from a HAR before you share it: a checklist
One-line answer: a HAR is a recording, not anonymous statistics. Remove the credentials and personal data the recipient does not need, and tell them what you removed.
What one HAR file holds
- Every request URL and query string — search terms, e-mail addresses and reset tokens can be in there.
- Request and response headers — Authorization, Cookie, Set-Cookie, X-API-Key, X-Auth-Token.
- Request and response bodies — login JSON, customer records and JWTs often sit in plain text.
- Metadata — server IPs, connection IDs, User-Agent and page titles.
Start with URLs and query strings
The most common leak is the query string: a password-reset code, an invite token, or an API key and secret appended to a URL. Log collectors store the whole URL, so it survives into the HAR.
harview clears parameters named token, key, secret, auth, code or password, including the same names in the URL. Tokens under other names (id_token, for example) need your own check.
Headers: what is actually dangerous
| Header | What it carries | If you leave it in |
|---|---|---|
| Authorization | Bearer JWT or Basic credentials | The recipient can call the API with the same rights until it expires. |
| Cookie | Session ID, CSRF token | A live session is equivalent to being signed in. |
| Set-Cookie | New sessions, tracking cookies | The session the server issued can be reused as is. |
| X-API-Key / X-Auth-Token | Service-to-service keys | The key allows calls until it is rotated. |
Bodies: JSON and base64
The usual suspects are password in a login request, access_token in a response and customer e-mails in a list. harview can remove Bearer tokens, JWTs, e-mail addresses and JSON values under password, token, secret and similar keys.
Response bodies encoded as base64 are left untouched in this version, with a count of how many were skipped. Decode those and review them separately.
Checklist before sharing
- 1. Is the HAR really needed? A console error alone may be a screenshot.
- 2. Are there tokens or e-mails in any query string?
- 3. Are Authorization, Cookie, Set-Cookie and API keys removed?
- 4. Do the bodies still hold passwords, tokens or customer data?
- 5. Are internal host names and private IPs acceptable to expose?
- 6. Did you tell the recipient what was removed and how much?
Verify after exporting
Reopen the sanitised HAR in harview and search for a fragment of a token, a cookie name and an e-mail domain. The quickest check is comparing what the receipt counted with what is actually gone.
Keep the original in a controlled location and attach only the sanitised copy to mail or an issue tracker.
Questions
Is masking enough to make a HAR safe?
It removes most credentials, but tokens under unexpected names, base64 bodies and metadata such as server IPs can remain. Check once more against the recipient and purpose.
A vendor asks for the original HAR.
Check the contract and access controls, and try to solve it with a masked copy first. If the original is unavoidable, reproduce the issue with a short-lived test account.
Are screenshots safe?
No. If tokens and e-mails are on screen, they are exposed. Blur them by the same standard before sharing a screenshot.
Sources
- W3C — HTTP Archive 1.2 specification
- OWASP — Secrets Management Cheat Sheet
- OWASP — Session Management Cheat Sheet
Every example here can be opened in the workbench as it is.
Open the workbench