Skip to main content
Next Defence - Next-Gen AI Cyber Security Firm
Australia & New Zealand[email protected](02) 9064 2614
INSIGHT

Patient Record API Authorisation: A Two-Clinic Test Worksheet

A patient-record API may correctly authenticate a clinic's staff or integration service while returning a record belonging to another clinic.

A patient-record API may correctly authenticate a clinic’s staff or integration service while returning a record belonging to another clinic. The serious failure is not the absence of login security; it is the receiving API’s inability to establish whether a particular actor is entitled to perform a particular operation on that patient’s information. This worksheet uses two fictional clinics and synthetic patients to exercise that boundary without exposing real clinical data.

Define the clinical relationship in the test model

Create Clinic North and Clinic South as separate fictional organisations in a non-production environment. Assign synthetic patient N-101 to North and patient S-201 to South. Give each clinic an authorised practitioner and a test integration service. The integration’s intended task might be retrieving a lab-result status for a patient under the clinic’s care, not browsing a regional patient database.

Decide how the application represents an eligible treatment relationship and which authority can approve an exception. A person with a valid clinician role may still require a patient assignment, encounter, referral or other contextual permission. A service token may need the same purpose and clinic restrictions. Do not build the test around the assumption that a clinic identifier supplied in the request URL is trustworthy.

Include an emergency-access route only if the system actually offers one. It should have a distinct authorisation model, attributable activation, stated purpose and review. It should not become a loophole through which every failed negative test can be reclassified as permitted activity.

Minimum technical test environment

Prepare a segmented test tenant with fabricated patient demographics, encounters, results and document attachments. Arrange representative identities for two clinicians, two service principals, an administrator with no clinical assignment and one expired staff account. Enable gateway, API service, database access-decision and asynchronous job logs where available. Do not copy live patient records, provider identifiers or real access tokens into the worksheet.

Record the expected behaviour of each endpoint: patient lookup, encounter read, document download, bulk export, background task creation and any audit search. A test of the visible patient view does not establish that direct URLs, mobile clients or queued integrations enforce the same policy. Confirm whether the API resource owner, not a caller-controlled header, determines the clinic and patient context.

Set a safe test window and a named clinical application owner. Any configuration change that might affect production requires separate operational approval. This guide does not authorise probing a health service or clinical system without explicit consent.

Case 1: North reads its own patient

Use the approved North practitioner identity to request N-101’s fabricated result in the context of a valid treatment assignment. Expect the precise authorised fields and no unrelated records. Capture the request correlation ID, token audience or role summary, server-side decision, patient ownership check and response classification. A green login result on its own does not make this case pass.

Repeat through the intended integration service if that service is part of the normal pathway. Check that the service acts on a documented clinic scope and cannot silently substitute a broader account. Record whether the response is delivered synchronously or placed in a queue. The test establishes the positive baseline needed before evaluating denials.

Case 2: North requests South’s patient directly

Keep the North token and request shape unchanged while changing only the synthetic patient identifier to S-201. Expect a refusal that does not disclose patient content or confirm sensitive details beyond what the service’s approved error policy permits. Capture the backend event showing North’s identity, South’s resource owner and the rejected operation. A disabled front-end button is not the relevant test.

Try the application’s alternative direct-object route and the document download endpoint. If the API blocks patient details but permits an attachment URL, record a failed boundary. Examine whether cached responses or signed download links remain usable after denial. Keep the test to fabricated files and do not enumerate real identifiers.

Case 3: Service identity, bulk export and queue

Submit a North-scoped integration job using a synthetic list containing both N-101 and S-201. The service should process the eligible record and reject or safely handle the ineligible one according to its documented interface contract. Check that the final export contains no South content and that the worker logs show the decision. Avoid testing only the API’s immediate acknowledgement; an accepted queue entry may result in an unsafe later data export.

Test a service principal without a patient-specific purpose and an account whose scope has expired. Record whether revocation invalidates both the interactive request and subsequent worker executions. A failed token refresh is not sufficient evidence if an already-issued job or link remains active. Inspect the destination storage or message recipient in the synthetic environment.

Case 4: Clinic administrator and legitimate exception

Give a North administrator responsibility for user and clinic configuration, but no clinical assignment to S-201. The administrator should be able to manage permitted settings without automatically acquiring every patient’s records. Test a settings operation and a patient-content request separately. The service’s authorisation policy may legitimately grant some administrators access in defined circumstances; document the actual scope rather than assuming all administrative roles behave identically.

Where emergency access exists, perform a separate approved synthetic case using its stated approval, expiry and audit requirements. Ensure that a normal clinician cannot simply set an “emergency” parameter to bypass patient-level checks. Review how the organisation will investigate and communicate inappropriate use while preserving clinical safety.

Decision table and evidence fields

For each test use the same compact fields: case ID, source clinic, actor and role, stated clinical purpose, patient or object owner, API operation, expected result, actual HTTP and application response, worker outcome, audit event, tester and reviewer. Record versions of the policy and software build because a passing result can become invalid after an interface update. Keep protected diagnostic logs in an approved repository with only the minimum necessary synthetic content.

Classify cases as pass, fail or not demonstrated. A missing API log is an evidence limitation; an accepted wrong-clinic response is a failed control; a refused request that stops legitimate care is an availability defect. Do not silently combine them into a single maturity score. Agree on which results demand immediate remediation before a deployment proceeds.

Safeguards for a discovered failure

If a permitted-looking service principal retrieves South’s synthetic patient, identify the specific authorisation rule or scope binding responsible. Correct it at the receiving resource, then retest patient lookup, attachments, exports and background processing. Do not rely solely on an identity provider claim or client application change. Consider whether existing tokens, caches and pending jobs need invalidation.

In a real incident, protect patient care while restricting the unsafe route. Clinical leadership must assess how a temporary block affects urgent results or treatment continuity; privacy and legal specialists should assess any actual data exposure and applicable reporting duties. A synthetic test failure does not prove a real patient was affected, but it should prompt a bounded investigation of comparable production behaviour through authorised methods.

Repeat after changes and restoration

Schedule the workbook after a clinic merger, new interface, vendor integration, API gateway update, role migration or material recovery event. A backup restore can reintroduce old token policies or clinic mappings. Reconfirm the positive North read and the negative North-to-South read after the change, and verify the worker path rather than relying on a previous successful screen test.

The worksheet is complete when the clinical application owner can show that valid care-related access survives, prohibited cross-clinic operations fail at every tested receiving path, and any unknown routes have owners and follow-up dates. It protects patient relationships through explicit object-level decisions instead of assuming strong authentication automatically makes every requested clinical object appropriate.

Additional case: referral changes the relationship

Introduce a fabricated referral that legitimately transfers patient N-101’s care from Clinic North to Clinic South. Specify which party authorises the change, when it becomes effective and which records should be available before and after that moment. Test that the original relationship does not silently grant permanent unrestricted access after discharge or transfer. If historic records must remain available for a lawful treatment or retention purpose, model that narrower permission explicitly rather than claiming every access should end instantly. Retest document links and queued result messages because these often follow a different lifecycle from an interactive patient lookup.

Additional case: the receiving patient changes after approval

A batch worker is approved to retrieve results for a named synthetic patient set. Before execution, one patient’s clinic assignment changes. The worker should enforce the current policy at the appropriate processing point, not assume that the original queue submission is universal authority. Use a controlled simulation to compare queue admission, execution-time access and final export contents. Have the clinical system owner define how to manage a legitimate result that is delayed by the change, including a safe review process. The aim is to protect the correct patient relationship without losing medically necessary messages.

Review of error behaviour

Compare wrong-patient responses across the primary API, bulk endpoint, attachment service and audit search. Error codes need not be identical, but none should return unauthorised content. A response that reveals an exact patient name or document title despite denying the full record can still leak sensitive information. Record the observed metadata and ask the application owner to specify the permitted disclosure policy. Ensure error logging does not create a second copy of fabricated confidential fields in a broadly available monitoring system.

Sources and further reading

Explore Next Defence expertise

Next Defence can help organisations assess the technical and business exposure examined in patient record api authorisation: a two-clinic test worksheet. Our team can review the available source records, test the relevant access or operational controls and work with accountable owners to deliver test cases for own-read, other-read, override approval and post-expiry denial.

Explore related cyber security services ↗

LET'S TALK

Let’s talk about your security.

Tell us what you are protecting, where you need greater visibility or what you want to achieve. We will help identify the right next step.

Talk to a Security Specialist

Describe your security requirements. Please do not submit passwords, credentials or confidential incident evidence. This form is not an emergency incident-response channel.

Form powered by HubSpot. Review our Privacy Policy. If the form doesn’t load, email [email protected].