Jay Lawrence
All posts

Frontend security · HIPAA compliance · Healthcare software

Frontend HIPAA readiness: protecting PHI in the browser

What a frontend security review taught me about keeping clinical data out of telemetry, URLs, durable browser storage, caches, and unprotected deployments.

My latest HIPAA learning focused on the frontend: the place where protected health information becomes visible, interactive, and easy to copy into systems that were never meant to receive it. I now think of the browser as a temporary data environment, not only a presentation layer.

The browser boundary

A clinical page is surrounded by systems that can retain what it sees.

The useful screen is only the center. Telemetry, URLs, storage, caches, network calls, and deployment infrastructure all create adjacent data paths.

The shift in perspective

A secure API does not automatically create a safe frontend.

Authorization and encryption are essential, but sensitive information can still escape after an approved response reaches the browser. A resident name in the DOM can enter session replay. A token in a query string can enter analytics. Clinical working state can survive logout. A preview deployment can expose the right application to the wrong audience.

If the browser can see sensitive information, every system attached to the browser deserves a threat model.

The review loop

We followed data from render to residue.

Candidate scanning helped locate likely risks, but source-to-sink inspection showed whether information could actually reach an unsafe destination.

Five questions expose most frontend privacy paths.

  1. PageRender

    What reaches the DOM?

  2. ObserversObserve

    What watches the page?

  3. BrowserPersist

    What survives navigation?

  4. BoundaryClear

    What changes on logout or context switch?

  5. EvidenceVerify

    What does production actually do?

The sequence runs once as an explanation; every stage remains fully readable when motion is reduced or JavaScript is unavailable.

Telemetry

Analytics should fail closed around PHI.

Masking a few inputs was not enough when clinical information appeared throughout ordinary page text. The safer model is a global kill switch, disabled replay and autocapture, and an explicit allowlist of low-cardinality route templates.

Privacy controls should describe the small set of data allowed to leave the application. Trying to enumerate every future sensitive value is fragile because the product will keep changing.

Only approved telemetry crosses the analytics boundary.

The approved path emits a route category—not the DOM, a raw URL, an identity, or free text.

Browser state

Convenient persistence can quietly become a clinical record.

Resident-linked validation state previously survived logout and browser restart in local storage. It is now memory-only, while a central cleanup path clears sensitive stores, client caches, and analytics identity at every trust-boundary change.

State location, query-key design, cache lifetime, and reset behavior are privacy architecture decisions.

Sensitive state should end when authority ends.

Logout is one path. Idle expiry, account changes, tenant changes, facility changes, and browser restoration need the same guarantee.

The browser perimeter

Security controls form layers, not a single frontend switch.

A nonce-based Content Security Policy, local dependencies, and private responses narrow the browser boundary. They do not replace server authorization, object validation, malware scanning, audit events, or live deployment verification.

Each layer answers a different failure mode.

  1. PageRender deliberately

    Show only the information required for the current task.

  2. BrowserConstrain execution

    Nonce scripts, local workers, memory-first state, and no-store intent.

  3. BackendEnforce authority

    Tenant, facility, role, and object checks remain server responsibilities.

  4. StorageValidate and audit

    Downloads, uploads, content checks, link lifetime, and access events.

  5. DeployProve the perimeter

    Live headers, caches, previews, logs, regions, and access controls.

A hidden button is not authorization, and source configuration is not proof of effective CDN or production behavior.

Verification

Privacy tests should use synthetic secrets and try to make them leak.

A deliberately recognizable fake resident, token, identifier, and clinical phrase make the absence of a leak testable.

The marker should disappear—or be rejected—at every unapproved destination.

DecisionSynthetic testExpected evidence
TelemetryInspect replay, analytics, errors, and performance payloadsNo marker observed
Browser residueInspect storage, history, DOM, object URLs, and cachesNo marker retained
Session changesLogout, expire, switch account, tenant, facility, and tabState fully cleared
DeploymentInspect previews, headers, CDN cache, logs, and source mapsProtected and private
AuthorizationAttempt cross-tenant, cross-facility, and cross-object accessRequest rejected
Passing these checks validates a specific deployed journey. It does not certify every future feature.

Readiness versus remediation

Fixed locally is not the same as ready for real PHI.

Local controls and regression tests are important evidence. Release readiness still depends on the real vendor settings, historical data deletion, staging policy, preview protection, business associate agreements, deployed behavior, backend controls, and an accountable owner accepting residual risk.

A vendor badge or signed agreement does not prove that our chosen products, region, retention, access controls, and actual data flows are appropriate.

Code closure and release evidence are separate gates.

Repository

Confirmed locally

Controls, tests, types, build, and synthetic public-route checks.

  • Privacy suite
  • Unit suite
  • CSP implementation
  • Session cleanup
Operations

Still requires evidence

Live projects, vendor scope, deletion, protection, authorization, and audit.

  • BAA coverage
  • Project settings
  • Deployed payloads
  • Risk acceptance
plus
The product stays blocked for real PHI until both sides are complete.

What I am carrying forward

Frontend privacy is the discipline of leaving less residue.

The browser will always need enough information to help a clinician do the work. My job is to make that information useful for the moment, inaccessible outside its intended context, and absent from the places where it never needed to be.

This is a technical learning record, not a HIPAA certification or legal opinion. Readiness depends on the organization’s complete safeguards, risk analysis, agreements, operating procedures, and qualified legal and security review.

References

Public vendor guidance behind this entry.