Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-111312 Overview
CVE-2026-111312 is a missing authentication and authorization vulnerability [CWE-306] in OpenHealth through version 0.2.0. The flaw resides in the /api/health-data/[id] route, which exposes GET, PATCH, and DELETE handlers that query records by id without verifying the session or the authorId of the requesting user. Unauthenticated attackers who know a HealthData record identifier can read another user's medical records and file metadata, overwrite the record with arbitrary JSON, or delete it entirely. The vulnerability affects a healthcare application, making the exposed data particularly sensitive from a privacy and regulatory standpoint.
Critical Impact
Unauthenticated remote attackers can read, modify, or delete arbitrary users' medical records through the exposed API route.
Affected Products
- OpenHealth through version 0.2.0
- /api/health-data/[id] route (GET, PATCH, DELETE handlers)
- Deployments relying on the default middleware.ts route matcher
Discovery Timeline
- 2026-10-15 - CVE-2026-111312 published to the National Vulnerability Database (NVD)
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-111312
Vulnerability Analysis
OpenHealth is a Next.js application that stores HealthData records tied to individual users through an authorId field. The handlers defined in src/app/api/health-data/[id]/route.ts accept the id path parameter and query the database directly using Prisma without first resolving the current session or filtering by authorId.
The GET handler returns the full record, including parsed medical data and file metadata. The PATCH handler accepts arbitrary JSON and persists it to the record. The DELETE handler removes the record entirely. None of the three handlers invokes the authentication context, so any client that can reach the endpoint receives the same privileges as the record owner.
The middleware.ts route matcher further compounds the issue by excluding the /api/health-data path from session enforcement. Combined, these two defects turn an authenticated per-user API into an open read, write, and delete interface.
Root Cause
The root cause is the absence of an authorization check comparing the authenticated session subject against the HealthData.authorId field. The handlers trust the caller-supplied id as the sole lookup key, which satisfies the pattern described in [CWE-306: Missing Authentication for Critical Function]. The middleware configuration omits the vulnerable prefix from protected routes, so no upstream guard compensates for the missing check.
Attack Vector
An attacker enumerates or guesses HealthData record identifiers and issues HTTP requests directly to /api/health-data/<id>. A GET request discloses medical data belonging to another user. A PATCH request with an attacker-controlled JSON body overwrites the stored record. A DELETE request removes it. No credentials, tokens, or user interaction are required. Technical details are documented in the HackMD IDOR Vulnerability Report and the VulnCheck Advisory on OpenHealth.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-111312
Indicators of Compromise
- Unauthenticated HTTP requests to /api/health-data/<id> in reverse proxy or application logs.
- PATCH or DELETE requests to the health-data route that lack a valid session cookie or Authorization header.
- Sequential or enumerated identifiers in request paths targeting /api/health-data/.
- Unexpected changes to HealthData rows whose updating session subject does not match the stored authorId.
Detection Strategies
- Review access logs for requests to /api/health-data/[id] originating from clients without an authenticated session.
- Compare database audit trails for HealthData records whose last-modified actor differs from authorId.
- Alert on request patterns consistent with identifier enumeration, such as rapid sequential id values from a single source IP.
Monitoring Recommendations
- Enable request logging on the Next.js application and forward logs to a centralized analytics platform.
- Instrument the API handlers to emit an audit event containing the session subject, requested id, and resolved authorId on every call.
- Monitor for anomalous spikes in PATCH or DELETE volume against the health-data route.
How to Mitigate CVE-2026-111312
Immediate Actions Required
- Restrict external exposure of the /api/health-data/[id] route at the reverse proxy or ingress layer until a patched build is deployed.
- Add explicit session validation and an authorId equality check to the GET, PATCH, and DELETE handlers in src/app/api/health-data/[id]/route.ts.
- Update src/middleware.ts so the matcher covers /api/health-data and enforces authentication before the handler executes.
- Audit the HealthData table for unauthorized reads, modifications, or deletions since deployment.
Patch Information
No fixed version is identified in the published advisory. OpenHealth releases through 0.2.0 are affected. Monitor the OpenHealthForAll GitHub Repository for a patched release. Review the vulnerable implementation in the OpenHealthForAll Route Code and the OpenHealthForAll Middleware Code when preparing a fix.
Workarounds
- Place the application behind an authenticating reverse proxy that rejects unauthenticated requests to /api/health-data/*.
- Patch the local fork to resolve getServerSession inside each handler and return 401 when no session exists and 403 when the session subject does not equal authorId.
- Rotate or invalidate publicly guessable HealthData identifiers where feasible, and prefer opaque UUIDs over sequential keys.
# Configuration example
# Example Nginx guard restricting the vulnerable route to authenticated sessions
location /api/health-data/ {
auth_request /auth/validate;
error_page 401 = @unauthenticated;
proxy_pass http://openhealth_upstream;
}
location @unauthenticated {
return 401;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

