/

CVE-2026-111312

Severity:

HIGH RISK

(7.7)

Missing Authentication (CWE-306) in OpenHealth API

CVE-2026-111312

Deferred

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306

Impact:

Unauthorized access, modification, and deletion of sensitive health data

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenHealth exposes health-data API handlers that process records by identifier without checking whether the requester is authenticated or authorized to access the record. An unauthenticated attacker who knows a record ID may read medical data and file metadata, modify stored content, or delete the record.

OpenHealth exposes health-data API handlers that process records by identifier without checking whether the requester is authenticated or authorized to access the record. An unauthenticated attacker who knows a record ID may read medical data and file metadata, modify stored content, or delete the record.

Affected context

The vulnerability occurs in OpenHealth deployments through version 0.2.0 where the /api/health-data/[id] GET, PATCH, and DELETE handlers accept a record identifier without consistently enforcing session and ownership checks. Risk is greatest when record IDs are discoverable, predictable, exposed through other application behavior, or otherwise obtainable by an unauthenticated user.

The vulnerability occurs in OpenHealth deployments through version 0.2.0 where the /api/health-data/[id] GET, PATCH, and DELETE handlers accept a record identifier without consistently enforcing session and ownership checks. Risk is greatest when record IDs are discoverable, predictable, exposed through other application behavior, or otherwise obtainable by an unauthenticated user.

Exploit preconditions

  • Attack surface: The /api/health-data/[id] HTTP endpoints
  • Required access: Network access to the API; no valid session may be required
  • Trigger point: A GET, PATCH, or DELETE request targeting a known HealthData record ID
  • Why exploitation is possible: The handlers query and modify records by identifier without verifying authentication or confirming that the requester is authorized to access the selected record
  • Attack surface: The /api/health-data/[id] HTTP endpoints
  • Required access: Network access to the API; no valid session may be required
  • Trigger point: A GET, PATCH, or DELETE request targeting a known HealthData record ID
  • Why exploitation is possible: The handlers query and modify records by identifier without verifying authentication or confirming that the requester is authorized to access the selected record

Why this happens

The underlying flaw is an authorization boundary failure in request handlers. The endpoints trust a client-supplied record identifier and perform database operations before establishing the requester's identity and ownership permissions. This maps primarily to CWE-306: Missing Authentication for Critical Function, with a related broken-access-control condition because authenticated identity and record-level authorization are not enforced before sensitive operations.

The underlying flaw is an authorization boundary failure in request handlers. The endpoints trust a client-supplied record identifier and perform database operations before establishing the requester's identity and ownership permissions. This maps primarily to CWE-306: Missing Authentication for Critical Function, with a related broken-access-control condition because authenticated identity and record-level authorization are not enforced before sensitive operations.

Potential impact

  • An attacker may disclose another user's medical records and associated file metadata.
  • An attacker could overwrite health-data records with arbitrary JSON.
  • An attacker may delete records, causing loss of availability or integrity.
  • The vulnerability could create privacy, compliance, and patient-safety risks.
  • An attacker may disclose another user's medical records and associated file metadata.
  • An attacker could overwrite health-data records with arbitrary JSON.
  • An attacker may delete records, causing loss of availability or integrity.
  • The vulnerability could create privacy, compliance, and patient-safety risks.

General mitigation guidance

Mitigation generally centers on enforcing identity and record-level authorization at every sensitive handler.

Common defensive patterns include:

  • Require an authenticated session before processing health-data requests.
  • Derive the user identity from a trusted server-side session or token rather than request parameters.
  • Verify that the authenticated user or an explicitly authorized role owns or may access the requested record before every read, update, or delete operation.
  • Apply deny-by-default authorization policies and use separate policies for viewing, editing, and deleting data.
  • Prefer database queries that include the authorized subject or tenant constraint, reducing reliance on an identifier-only lookup.
  • Minimize record and file-metadata exposure and apply least privilege to service accounts.
  • Record and review access, modification, and deletion events without logging sensitive medical content.

Mitigation generally centers on enforcing identity and record-level authorization at every sensitive handler.

Common defensive patterns include:

  • Require an authenticated session before processing health-data requests.
  • Derive the user identity from a trusted server-side session or token rather than request parameters.
  • Verify that the authenticated user or an explicitly authorized role owns or may access the requested record before every read, update, or delete operation.
  • Apply deny-by-default authorization policies and use separate policies for viewing, editing, and deleting data.
  • Prefer database queries that include the authorized subject or tenant constraint, reducing reliance on an identifier-only lookup.
  • Minimize record and file-metadata exposure and apply least privilege to service accounts.
  • Record and review access, modification, and deletion events without logging sensitive medical content.

How teams detect issues like this

Detection can combine application review, automated analysis, and runtime monitoring:

  • Use static analysis and code review rules that flag database lookups keyed only by URL parameters in sensitive handlers.
  • Review every GET, PATCH, and DELETE path for authentication middleware and object-level authorization checks.
  • Look for controller or route code that accesses user-owned records before resolving the authenticated principal.
  • Test requests with no session, a different user's session, invalid identifiers, and identifiers from another tenant.
  • Enforce API policies requiring authentication and authorization annotations for protected health-data routes.
  • Monitor for unusual unauthenticated requests, repeated identifier enumeration, bulk reads, unexpected updates, and deletion patterns.

Automated security testing and code-review tools may help identify missing checks, but findings should be validated against the application's authorization model.

Detection can combine application review, automated analysis, and runtime monitoring:

  • Use static analysis and code review rules that flag database lookups keyed only by URL parameters in sensitive handlers.
  • Review every GET, PATCH, and DELETE path for authentication middleware and object-level authorization checks.
  • Look for controller or route code that accesses user-owned records before resolving the authenticated principal.
  • Test requests with no session, a different user's session, invalid identifiers, and identifiers from another tenant.
  • Enforce API policies requiring authentication and authorization annotations for protected health-data routes.
  • Monitor for unusual unauthenticated requests, repeated identifier enumeration, bulk reads, unexpected updates, and deletion patterns.

Automated security testing and code-review tools may help identify missing checks, but findings should be validated against the application's authorization model.

Sources

SourceLink
github.comgithub.com/OpenHealthForAll/open-health
github.comgithub.com/OpenHealthForAll/open-health/blob/v0.2.0/src/app/api/health-data/%5Bid%5D/route.ts#L13-L43
github.comgithub.com/OpenHealthForAll/open-health/blob/v0.2.0/src/middleware.ts#L20
hackmd.iohackmd.io/@hieuPenguinnn/open-health-health-data-id-missing-auth-idor
vulncheck.comvulncheck.com/advisories/openhealth-through-0.2.0-missing-authentication-via-api-health-data-id-route

Frequently asked

questions

Yes, when the affected API is reachable by an attacker and record identifiers can be obtained or guessed. No local access should be necessary if the endpoints are publicly exposed.

The reported behavior indicates that a valid session is not required. The key condition is the ability to reach the endpoint and supply a valid HealthData record ID.

Require authentication before handling the request, then enforce object-level authorization using the authenticated identity and the record's ownership or access policy before reading, modifying, or deleting data.

Use centralized authentication and authorization middleware, deny-by-default API policies, ownership-aware database queries, and automated tests covering unauthenticated and cross-user access attempts.

Yes, when the affected API is reachable by an attacker and record identifiers can be obtained or guessed. No local access should be necessary if the endpoints are publicly exposed.

The reported behavior indicates that a valid session is not required. The key condition is the ability to reach the endpoint and supply a valid HealthData record ID.

Require authentication before handling the request, then enforce object-level authorization using the authenticated identity and the record's ownership or access policy before reading, modifying, or deleting data.

Use centralized authentication and authorization middleware, deny-by-default API policies, ownership-aware database queries, and automated tests covering unauthenticated and cross-user access attempts.

Find out what's already
exploitable in your codebase.