opyeb harview

Authorization, Cookie and API keys in a HAR: what is exposed

2026-11-29 · 2 min read

One-line answer: an authentication header in a HAR is a key that can resend that request. Treat Bearer tokens and session cookies with the same care as a password.

Authorization schemes

Common Authorization schemes
SchemeShapeRisk in a HAR
BearerBearer eyJ… (JWT) or an opaque stringCan be replayed until it expires.
BasicBasic base64(user:password)Decoding reveals the credentials outright.
DigestDigest username=…, response=…Harder to replay, but account identifiers are visible.
ApiKeyApiKey <key>Often valid indefinitely depending on the service.

The Cookie header carries the session ID the browser sends. Set-Cookie shows the session the server issued plus attributes (Path, HttpOnly, Secure, SameSite). The attributes make session policy easy to read, but a live value is equivalent to being signed in.

Keeping cookie names while masking values lets a reader tell a session cookie from a preference; clearing every value is the safer default.

X-API-Key and X-Auth-Token

These are service-specific names, not standards. Similar names carry different meanings and lifetimes, so a HAR alone cannot tell you when a key expires. Treat a visible key as exposed and ask the service owner whether it must be rotated.

A JWT is not encrypted

A JWT is three base64url parts: header.payload.signature. The signature prevents forgery, but anyone can decode and read the payload, including claims such as sub, scope and exp.

That is why masking only part of a JWT is not enough. harview replaces the whole three-part token that starts with eyJ with [REDACTED_JWT].

Why keep the scheme and the names

Keeping "Bearer [REDACTED]" shows which authentication method was used, and keeping cookie names shows which session system is in play. That helps debugging and is not the secret.

The value itself should not survive, not even its length: length is a hint about the token type.

If you find an exposure

Questions

What does decoding a JWT reveal?

The algorithm in the header and claims such as sub (user), scope (rights) and iat/exp (issued and expiry times). It is readable without verifying the signature, so identity and permission details are exposed.

Is Basic authentication safe because it is base64?

No. Base64 is encoding, not encryption; decoding gives the username and password directly.

Masking breaks reproduction. Is that acceptable?

Keep the original separately when you need to replay. A shared copy is for showing structure, not for replaying requests.

Sources

Every example here can be opened in the workbench as it is.

Open the workbench