heygrc
HIPAA person or entity authentication in code

A header is not an identity.

164.312(d) (person or entity authentication) is a HIPAA Security Rule standard with no implementation specifications attached, unlike access control's unique-identification requirement or integrity's authentication mechanism, which have their own required or addressable sub-specs. It is simply mandatory: before anyone, or any system, gets at electronic protected health information, you need a way to confirm they really are who they say they are. That is a different question from 164.312(b)'s audit controls, which record what happened after the fact, and from an access-control decision about what an already-verified identity is allowed to reach. 164.312(d) is about who is asking, before permissions or logging apply, and in most systems that verification happens in the code that reads a session, a token, or a credential, and it can be quietly swapped for something that proves nothing.

How it shows up in a diff

The shapes the same control failure takes.

Person or entity authentication weakens when a change lets something other than a verified credential decide who is asking. The recurring shapes:

  • A caller-supplied value is trusted as identity

    An endpoint reads who the request is for from a header, query parameter, or request body the caller controls, instead of the verified session or token.

  • Network location stands in for a credential

    An internal service or job is let through to an ePHI endpoint because the call comes from inside the cluster or VPC, not because it presented anything that verifies which entity it is.

  • A revoked credential still authenticates

    Logout, token revocation, or session expiry stops actually invalidating the credential, so access that should have ended keeps working.

  • Account recovery skips verifying the requester

    A password reset or account-recovery path grants access to ePHI without confirming the person asking is the account holder.

  • A fallback path accepts no credential at all

    A debug route, internal tool, or break-glass path reaches ePHI under some condition without authenticating the caller at all.

Worked example

An endpoint that trusts a header instead of the session.

A new mobile client sends the signed-in user's id in an X-User-Id header. Rather than wire the mobile app's session through to this endpoint, a change reads the id from that header instead of the session. The lookup works the same for honest clients, and now any caller can retrieve any user's records just by setting that header, since the header itself proves nothing about who is actually asking.

api/records.ts+1 -1
router.get('/records', async (req, res) => {-  const userId = req.session.userId+  const userId = req.headers['x-user-id']  const record = await records.findForUser(userId)  res.json(record)})
heygrcHIPAA 164.312(d)

Reading x-user-id from the request instead of the authenticated session means the identity behind the request is now whatever the caller claims in a header, which verifies nothing. 164.312(d) expects you to confirm who is actually asking before ePHI is handed over, and a header the client writes confirms nothing. Read the user from the verified session or token, not a value the caller can set.

What an auditor does with this

Person or entity authentication is checked at the request, not the login screen.

A HIPAA review looks past the login flow to every path that reaches ePHI: does each one still verify who is asking, or does some newer route trust a value the request itself supplies. A change that swapped a verified session or token for a caller-supplied identity, or let an internal call reach ePHI on network location alone, is the concrete gap behind that, and it is visible in the diff to the handler deciding who the request is for.

What this is, and is not

A review, not your identity provider.

heygrc flags changes that touch 164.312(d) and cites the CFR reference so the fix happens in the pull request. It does not run your authentication or issue your sessions and tokens. It catches the moment a change starts trusting an unverified identity to reach ePHI, at the diff.