Home › Guides › Privacy

Browser Storage and Private Inbox Credentials Explained

The TempMailPortal website does not ask a guest to create a conventional username and password. Instead, a new private web inbox comes with a short-lived bearer credential that the browser stores locally. That design makes a disposable inbox quick to use, but it creates a specific security boundary: access depends on possession of the credential and the continued existence of the server mailbox.

This guide explains that boundary in concrete terms. It is aimed at people deciding whether a browser-based temporary inbox is appropriate for a message—not at developers looking for a general authentication recipe.

Four values that are easy to confuse

Value Purpose Safe to share?
Temporary email address Tells a permitted sender where to deliver mail Yes, with the intended sender
Inbox bearer credential Authorizes the browser to list and read that inbox No
Turnstile token Proves one inbox-creation attempt passed server validation No reason to share; short-lived and single-use
Device-pairing code Grants a second device access to an existing inbox Only to your own device, before its five-minute expiry

Sharing the address is part of using email. Sharing the bearer credential or a pairing code transfers access. None of these values proves a person's real identity.

Where the active web inbox is stored

After a successful inbox creation, the homepage stores a JSON value in localStorage for the TempMailPortal origin. It contains the address, bearer credential and local save timestamp. The optional saved-inbox feature uses a separate local-storage entry containing up to five such address-and-credential pairs and optional labels.

localStorage belongs to the website origin, not to a TempMailPortal cloud profile. MDN documents that it persists across normal browser restarts and that pages on the same origin use that origin's storage area. The browser does not automatically attach these values to every HTTP request in the way it would attach a cookie. TempMailPortal's JavaScript reads the selected token and explicitly sends it in an Authorization: Bearer … header for inbox API calls.

That distinction reduces accidental transmission to unrelated paths, but it does not turn browser storage into a vault. Any JavaScript that successfully runs in the same origin can potentially read the storage. A person controlling the browser profile or a powerful extension may also reach it. OWASP's HTML5 guidance advises against storing sensitive authentication or authorization material in local storage for exactly this reason.

What the private web credential contains

The current web credential is a signed, stateless token. Its payload binds the exact full address to an expiration timestamp. A server-side HMAC signature protects that payload from modification.

“Stateless” here has a narrow meaning: the Worker does not need a separate database session row for the primary web token. It does not mean the entire inbox exists only in the browser. The Worker still stores the private-mailbox row and messages in server storage. During each authorized request, it verifies all of the following:

  1. the token has the expected private-web format;
  2. its encoded address and expiry can be parsed;
  3. the expiry is still in the future;
  4. its HMAC signature matches the server secret; and
  5. a live private-mailbox row exists for that exact address and expiry.

These checks make locally inventing or editing a token insufficient. The tests also confirm that a credential for one address cannot list another address's messages and that modifying the token causes an unauthorized response.

Why the address alone is not enough

The message-list and message-detail routes require the bearer credential. The server scopes their database queries by both parts of the authorized address: the local part before @ and the mailbox domain after it. If a different address has a message with a known identifier, the first inbox still cannot retrieve it through its credential.

This is more private than a public inbox that opens from a typed name alone. It is still bearer access: copying the valid credential copies the ability to make those authorized requests. The website does not claim that the credential is bound to one physical device.

Creation proof is separate from ongoing access

When a guest creates a browser inbox, the page first obtains a Cloudflare Turnstile token. The Worker sends that token to Cloudflare's Siteverify endpoint and checks the expected hostname and action before writing the mailbox row. Cloudflare documents that server validation is mandatory, and its tokens are single-use and expire after five minutes.

Turnstile helps reduce automated mailbox creation. It does not encrypt the inbox credential, authenticate the user's legal identity or protect a shared browser profile. After creation, the private bearer credential—not the consumed Turnstile token—controls inbox reads.

Restoration and expiry

The browser records a local save time and accepts the active inbox for restoration for up to seven days, provided the address uses a currently active domain and the credential has a supported private format. On reload, eligible saved data is placed back into the page and checked against the API.

The server independently gives a guest web mailbox a maximum seven-day lifetime. Message lifetime remains separate: a message may expire after ten minutes, one hour or 24 hours even while the address remains active. Restoring an address does not restore messages that have expired.

If browser data is cleared, the local copy of the credential disappears. The server mailbox may exist until its own expiry, but the guest normally has no password-recovery mechanism to reconstruct the lost credential. If the mailbox is deleted, the server record disappears and a retained local token stops validating.

Active inbox, saved list and paired device

These three features create different local access copies:

Forgetting a saved-list entry does not delete server data. Deleting the inbox does. Revoking devices removes secondary sessions and unused pairing codes; it does not erase the owner inbox.

The pairing code is deliberately not placed in a URL. It is a 64-character value displayed only after an authorized request, expires in five minutes and is consumed when redeemed. The recipient device must treat its resulting credential with the same care as the original.

Practical rules for a shared or managed device

  1. Do not use a shared browser profile for a temporary inbox containing personal information.
  2. Do not paste bearer credentials or pairing codes into chat, screenshots or support tickets.
  3. Use Copy or the address QR code when you need the email address; those controls use the address, not the inbox credential.
  4. Use Forget only when you intend to remove a local saved-list shortcut. Use Delete when you intend to retire the server mailbox.
  5. Clear site storage when leaving a device you no longer control, understanding that this may permanently remove your only guest access.
  6. Keep important account recovery in a secured permanent mailbox. Temporary inboxes are designed for low-stakes messages that can be lost.

What the current design does and does not protect

It protects against opening a private web inbox with only the email address, token tampering and cross-address reads through the supported API. It also places Turnstile and rate limiting ahead of anonymous creation.

It does not protect against someone who obtains a valid bearer credential, controls the browser profile, runs hostile code in the origin or accesses the device while the inbox is open. The website includes security headers such as HTTPS enforcement, a Content Security Policy and framing restrictions, but those are defense layers rather than a guarantee that browser-held secrets can never be exposed.

This threat model is why the site calls the inbox private yet low-trust. “Private” describes address-scoped access with a separate credential. It does not mean end-to-end encryption, verified identity or suitability for confidential records.

Sources and verification

The browser credential storage and restore flow were checked in the current homepage script. The linked web-storage guidance describes general risks; it does not certify any particular browser profile as secure.