What is a HAR File and Why is Sharing It Dangerous?
A HAR (HTTP Archive) file is an industry-standard JSON-formatted log file generated by modern desktop and mobile browsers—including Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari. Standardized by the W3C Web Performance Working Group, the HAR format captures detailed records of every HTTP transaction between your browser and the remote web servers it interacts with.
A typical HAR archive records full request URLs, query parameters, HTTP headers, request POST data, server response codes, response bodies, and microsecond-level timing breakdowns (DNS lookup, SSL handshake, Time to First Byte, and content download). While these metrics make HAR files the gold standard for troubleshooting network latency, API timeouts, and user interface rendering defects, they carry catastrophic security liabilities if shared in their raw, unredacted state.
{
"name": "Authorization",
"value": "Bearer eyJhbGciOiJIUzI1Ni..."
},
{
"name": "Cookie",
"value": "session_id=a94df8e12b7;"
},
"postData": {
"text": "{\"password\":\"Sup3rS3cr3t!\"}"
}
{
"name": "Authorization",
"value": "Bearer [REDACTED_1]"
},
{
"name": "Cookie",
"value": "session_id=[REDACTED_2];"
},
"postData": {
"text": "{\"password\":\"[REDACTED_3]\"}"
}
The Anatomy of Session Hijacking via Browser Logs
When you reproduce a software bug while authenticated to a web portal (such as AWS Management Console, GitHub Enterprise, Jira, Salesforce, or Stripe), your browser actively transmits confidential credentials with every single network request. These include:
- Session & CSRF Cookies: Values located in
request.cookies,Cookieheaders, andSet-Cookieserver response instructions. An adversary or unintended recipient possessing these cookie strings can clone your active session and bypass Multi-Factor Authentication (MFA) entirely. - OAuth Bearer Tokens & API Keys: Microservice API transactions typically embed JSON Web Tokens (JWT) or access keys in
Authorization: Bearer <jwt>,x-api-key, orx-auth-token. - Cleartext Credentials in Form Bodies: Login submissions, registration sequences, and OAuth token exchanges pass unhashed passwords, credit card numbers, and API client secrets directly within
postData.text. - Pre-Signed Query Tokens: Temporary AWS S3 download parameters, Stripe checkout URLs, or time-limited tokens embedded in query strings.
How to Safely Export and Sanitize HAR Files
- Reproduce in a Clean Window: Where feasible, open an Incognito or Private browsing window with third-party extensions disabled to minimize extraneous noise.
- Record & Export from DevTools: Open Chrome/Firefox DevTools (F12 or Ctrl+Shift+I), switch to the Network tab, verify "Preserve log" is checked, reproduce the issue, and click the Export HAR icon.
- Drop into MafLabs HAR Sanitizer: Drop your
.harfile into this tool. The parsing engine executes strictly inside your local browser memory. - Select Redaction Mode: Choose between Consistent Indexed mode (ideal for debugging because identical secrets receive identical placeholders like
[REDACTED_1]), Static replacement, or cryptographic SHA-256 hashes. - Verify Zero Leakage & Download: Confirm the green "Verification Passed" banner is displayed, then download the sanitized file (named
original-sanitized.har). The structural timings and status codes remain authentic, enabling support engineers to diagnose performance without security risks.
Common Problems When Sharing Network Logs
The most common mistake when sharing HAR logs is performing naive find-and-replace text edits in text editors like Notepad or VS Code. This often breaks JSON string escaping (e.g. altering quotes or backslashes inside JSON-in-string payloads), which invalidates the JSON schema and prevents Chrome DevTools or Charles Proxy from opening the archive. MafLabs HAR Sanitizer parses and deeply walks the abstract JSON tree, ensuring syntax compliance while replacing every sensitive token.
Frequently Asked Questions
1. Is it safe to share a HAR file after using this tool?
2. What does a HAR file contain?
3. Is my HAR file uploaded to any remote server or cloud AI?
4. Does the sanitized HAR still open cleanly in Chrome DevTools?
5. How does the “Consistent Indexed” replacement mode work?
[REDACTED_1]). This allows engineers to trace request flows across multiple API calls without exposing the underlying credential.