How Insecure Client-Side State Management Led to a Critical BFLA in a Healthcare Platform
The React frontend stored user role in sessionStorage and used it to decide which admin routes to show, while the backend API endpoints under /api/v1/admins/* only checked for a valid JWT and did not verify admin role. An attacker with a standard doctor account could edit the role value in sessionStorage to 'admin', unlock the admin UI, and call admin API endpoints that returned full administrative data.
Published on medium.com
During a recent authorized security assessment of a live (Private), AI-powered healthcare management platform, I identified a critical Broken Function Level Authorization (BFLA) vulnerability (OWASP API5:2023).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
## Context
During an authorised security assessment of a live, private, AI-powered healthcare management platform, I found a critical Broken Function Level Authorization (BFLA) vulnerability, classified as OWASP API5:2023. By analysing the React frontend bundle and manipulating values in local session storage, I escalated from a standard Doctor account to a full System Administrator. The flaw exposed tenant metrics, administrative controls and system-wide management features.
The application is a Single Page Application (SPA) built with React 18 and React Router v7. The administrative area is protected by client-side route guards that check the user's role.
## Setup
The assessment was performed against the live, private application, with authorisation. The account used was a standard clinician account, approved with the role `doctor`.
The work involved inspecting the page source and the minified JavaScript bundle, and using browser developer tools (F12) to edit session storage. The escalation used the standard user's own bearer token against the API.
## Finding it
Initial recon started with the page source. The application loaded its entire architecture from a single minified JavaScript bundle:
```html
<script type="module" crossorigin src="/assets/index-QESwW2hV.js"></script>
```
{{media:1}}
Deobfuscating the React Router configuration inside that bundle produced two findings that did not look right.
First, hardcoded hidden routes: an administrative login portal at `/portal-****` and hidden management interfaces at `/admin-*****`, `/admin-*****` and `/admin-**********`. The identifiers are masked in the published write-up.
Second, and more importantly, the route guards protecting those interfaces, written as `<Ze role="admin">`, decided authorisation by reading user attributes directly from browser storage:
```javascript
const currentUser = JSON.parse(sessionStorage.getItem("currentUser"));
```
A route guard that trusts `sessionStorage` is only a UI convenience, because the user controls that storage completely. The question was whether the backend independently enforced the same role check, so I moved on to look at what the application stored after login.
## Exploitation
### Step 1: Inspecting the session state
After authenticating as a standard clinician, the application initialised two key items in `sessionStorage`:
- `accessToken`: a JWT string used for API authorisation.
- `currentUser`: a JSON object storing user metadata, including ID, name, email and `role: "doctor"`.
The `currentUser` object looked like this:
```json
{ "id": "fec231c2-ac4c-47de-bd27-6eba1679ae26", "role": "doctor", "specialization": "Cardiology", "status": "approved"}
```
{{media:2}}
The `accessToken` is a JWT string used for API authorisation, while `currentUser` stores user metadata. The `role` field in `currentUser` is what the route guards read.
### Step 2: Client-side role manipulation
Using the browser developer tools (F12, Application, Session Storage), I changed the `role` key inside the `currentUser` JSON string from `"doctor"` to `"admin"`:
```json
{ "role": "admin"}
```
{{media:3}}
This edit touches only data the browser holds locally. The JWT in `accessToken` was not modified, so any request made afterwards still carried the standard clinician's bearer token.
### Step 3: Unlocking the administrative interfaces
Refreshing the dashboard caused the React application to re-evaluate the local state. The UI immediately rendered the Super Admin navigation drawer (�
شرف عا�
/ Super Admin), displaying high-level system controls.
{{media:4}}
This confirmed that the frontend trusted the edited value, but it proved nothing about the server. In a secure system, changing local state should only alter what is rendered, while backend endpoints reject privileged actions with `HTTP 403 Forbidden`.
### Step 4: Verifying BFLA against the API
Navigating to the administrative routes triggered API requests to endpoints such as:
```http
GET /api/v1/admins/dashboard/stats
GET /api/v1/admins/doctors
GET /api/v1/admins/subscriptions
```
The backend processed these requests using the standard user's bearer token and responded with **HTTP 200 OK**, returning full administrative data, organisation breakdowns and system-wide metrics. The server had accepted a doctor's token on administrator-only endpoints, which is the BFLA condition: the function-level authorisation check was missing on the API side, not merely on the client.
## Root cause
The flaw came from two architectural issues working together.
1. **Frontend role reliance.** The UI treated client-editable storage (`sessionStorage`) as the source of truth for routing decisions. The `<Ze role="admin">` guards read `currentUser` from storage, so anyone could unlock the administrative UI by editing a JSON field.
2. **Missing backend authorisation middleware.** The REST API endpoints under `/api/v1/admins/*` checked that a valid JWT was provided, but did not enforce server-side Role-Based Access Control (RBAC) middleware to verify that the claims in that token carried administrative scope.
The route guard was purely client-side. The API checked that a valid JWT was provided, but did not verify administrative scope in its claims.
## Impact
With nothing more than a standard clinician account, an attacker could reach the administrative interfaces and, more seriously, call the administrative API endpoints directly with their own token. The responses returned full administrative data, organisation breakdowns and system-wide metrics, returning full administrative data, organisation breakdowns and system-wide metrics, along with the administrative controls and system-wide management features rendered by the Super Admin drawer. The write-up does not enumerate every administrative function reachable this way; the demonstrated impact is the data returned by the endpoints listed above.
## Fix
The engineering team resolved the issue by implementing strict, server-side RBAC middleware across all `/api/v1/admins/*` endpoints. The report gives an example of server-side role enforcement:
```python
# Example: Server-side role enforcement (FastAPI/Python)@router.get("/admins/dashboard/stats")async def get_admin_stats( current_user: User = Depends(get_current_admin_user) # Verifies role == "admin" from verified JWT): return await fetch_dashboard_stats()
```
During re-testing on the production environment, the client-side state was manipulated to `role: "admin"` and the UI attempted to fetch administrative data. The API backend validated the signed JWT claims, identified the user as a `doctor`, and rejected all administrative API calls with `HTTP 403 Forbidden`.
The write-up closes with three takeaways for developers:
- **Never trust the client.** Client-side storage (`localStorage`, `sessionStorage`, cookies) can be modified by the user at any time.
- **Enforce authorisation at the API layer.** Every API endpoint must independently verify user scopes and permissions on the server for every incoming request.
- **Store sensitive tokens securely.** Use `HttpOnly`, `Secure` and `SameSite` cookies to prevent token theft via client-side scripting.
The vulnerability was reported to and patched by the engineering team before publication, and sensitive identifiers, domain names and personal data were sanitised.
## Variants to test
- **Direct API calls without the UI.** Skip the browser entirely and send the administrative requests with a low-privileged bearer token. A positive result is `HTTP 200 OK` with administrative data instead of `403 Forbidden`.
- **Other role values in client storage.** Try values such as `admin`, `superadmin`, `owner` or `staff` in the same storage object, and check whether any of them unlock endpoints the account should not reach.
- **Hidden routes from the bundle.** Deobfuscate the router configuration on other SPAs and request every hidden administrative path directly. A positive result is a route that renders or an API call that succeeds for a non-administrative account.
- **Function-level checks on sibling endpoints.** Test write operations (create, update, delete) under the administrative prefix, not just reads. A positive result is a state change performed by a low-privileged token.
- **Tenant boundaries.** With two accounts in different organisations, call endpoints that reference another tenant's identifiers. A positive result is data from the other organisation returned to the first account.
- **Token claim tampering.** If the backend reads the role from the token rather than from storage, check whether the signature is actually verified, for example by altering a claim and replaying the token. A positive result is a request accepted with a modified, unsigned claim.## What happened, in plain words
A security researcher was given permission to test a live healthcare management platform, a website for managing a healthcare platform. The platform is described as AI-powered and private. During that test, the researcher found a serious security hole and was able to go from being an ordinary doctor account to being a full system administrator, without ever having an administrator password.
The hole belongs to a family of problems called Broken Function Level Authorization, or BFLA for short. To understand the name, split it up. "Authorization" (often spelled authorisation) is the process of deciding what a logged-in user is allowed to do. "Function level" means the decision is about a specific action or feature, such as "may this user open the admin dashboard?" rather than "is this user logged in at all?". "Broken" means the check is missing or wrong. So BFLA means: the system lets a user perform an action that their role should not permit, because the check on that particular action was not done properly. The report also gives it an industry label, OWASP API5:2023, which is just a catalogue number from a well-known list of common API security mistakes.
The whole escalation happened inside the browser, by editing a small piece of data the website had stored locally, and then watching whether the server behind the website accepted the resulting requests. It did. The server handed back administrative data to an ordinary doctor's account.
This article walks through the same steps the researcher took, in the same order, explaining every concept from scratch. You only need to be able to use a browser and a computer to follow along.
## Some background concepts first
Before the steps, a few ideas need to be clear, because the whole story depends on them.
**What is a Single Page Application (SPA)?** A traditional website loads a new page from the server every time you click a link. A Single Page Application loads one page once, and then a piece of software running inside your browser (called JavaScript) redraws the screen as you navigate. The server mostly just sends data, not whole pages. The platform in this report is an SPA built with a toolkit called React (version 18) and a routing library called React Router (version 7). "Routing" here means deciding which screen to show for which address.
**What is an API?** Think of a restaurant. The menu and the dining room are the website you see. The kitchen is the server where the real data lives. The waiter who carries your order to the kitchen and brings the food back is the API. In technical terms, an API (Application Programming Interface) is the set of addresses (called endpoints) that the browser-side software calls to ask the server for data or to tell it to do something. Each endpoint is like a specific request you can make: "give me the dashboard statistics", "list the doctors", and so on.
**What is a token?** When you log in, the server needs a way to recognise you on every later request, because the web does not remember you by itself. It gives your browser a small piece of text called a token, and your browser sends it back with every request, like a wristband at an event. The specific kind used here is a JWT (JSON Web Token), which is a token that carries some information inside it and is digitally signed by the server so it cannot be quietly altered. The signature is what makes it trustworthy: if anyone changes the contents, the signature no longer matches and the server can tell.
**What is sessionStorage?** Browsers give websites a few small storage boxes to keep data in. `sessionStorage` is one of them: a key-value store that lives in your browser tab and is cleared when the tab closes. The website can read and write it, and so can you, through the browser's developer tools. This is the crucial point of the whole story: anything stored in `sessionStorage` is under the user's control, not the server's.
**What is a role?** Many applications give each account a label describing what it may do, such as `doctor`, `admin` or `superadmin`. The label is called the role. The application uses it to decide which screens to show and which actions to allow.
**What is a route guard?** In an SPA, some screens should only be shown to certain users. A route guard is a small check the front-end software performs before showing a screen, for example "only show the admin area if the role is admin". The question that matters in security is whether that check is the only one, or whether the server also checks.
**What is a tenant?** A tenant is one organisation using a shared platform. A hospital group and a clinic chain might both use the same software, each as a separate tenant, and each should only see its own data. "Tenant metrics" means statistics belonging to one organisation.
**What does HTTP 200 OK and HTTP 403 Forbidden mean?** When the browser talks to a server, the server replies with a three-digit status code. `200 OK` means "here is what you asked for, all good". `403 Forbidden` means "I understood your request, but you are not allowed to do this". A secure system answers a forbidden request with 403. The bug in this report is that the server answered 200.
## The setup
The test was performed against the live, private application, with authorisation. The account used was a standard clinician account, approved with the role `doctor`.
The work involved inspecting the page source and the minified JavaScript bundle, and using browser developer tools (F12) to edit session storage. "Minified" means the code has been squashed to save space: variable names shortened, whitespace removed, so it is hard for a human to read. "Deobfuscating" means tidying it back up enough to follow the logic.
The escalation used the standard user's own bearer token against the API.
## Finding it
The first step was to look at the page source, which is the raw text the server sends to the browser. The application loaded its entire architecture from a single minified JavaScript bundle:
```html
<script type="module" crossorigin src="/assets/index-QESwW2hV.js"></script>
```
{{media:1}}
Line by line, this is one HTML tag. `<script` starts a script tag, which tells the browser to load and run some JavaScript. `type="module"` says the script is a modern JavaScript module, a way of packaging code. `crossorigin` is an attribute that affects how the browser fetches the file from another origin; here it is just part of how the app was built. `src="/assets/index-QESwW2hV.js"` is the address of the file being loaded: a single JavaScript file with a scrambled-looking name, which is typical of a build tool that gives each version a unique name so browsers do not serve a stale copy. The closing `></script>` ends the tag. The important observation is that one file contains the whole application, so reading it reveals the whole application's logic.
Deobfuscating the React Router configuration inside that bundle produced two findings that did not look right.
First, hardcoded hidden routes: an administrative login portal at `/portal-****` and hidden management interfaces at `/admin-*****`, `/admin-*****` and `/admin-**********`. A "route" is simply a web address path, the part after the domain name. "Hardcoded" means the addresses are written directly into the code rather than being fetched from somewhere. The asterisks are masks: the published write-up hides the exact names so the real site is not exposed. The point is that these administrative addresses exist in the code even though an ordinary user never sees a link to them.
Second, and more importantly, the route guards protecting those interfaces, written as `<Ze role="admin">`, decided authorisation by reading user attributes directly from browser storage:
```javascript
const currentUser = JSON.parse(sessionStorage.getItem("currentUser"));
```
Line by line: `const currentUser` declares a new variable named `currentUser`, which will hold the logged-in user's details. `=` assigns it a value. `JSON.parse(...)` takes a piece of text formatted as JSON (a common text format for structured data, like a shopping list with labels) and turns it into a real object the code can use. `sessionStorage.getItem("currentUser")` asks the browser's session storage for the item stored under the key `currentUser`, and returns it as text. So the whole line means: "fetch the text stored in the browser under the name currentUser, and turn it into an object". The guard `<Ze role="admin">` then presumably looks at that object's role field to decide whether to show the admin screens.
A route guard that trusts `sessionStorage` is only a UI convenience, because the user controls that storage completely. The question was whether the backend independently enforced the same role check, so the next step was to look at what the application stored after login.
## Exploitation
### Step 1: Inspecting the session state
After authenticating as a standard clinician, the application initialised two key items in `sessionStorage`:
- `accessToken`: a JWT string used for API authorisation.
- `currentUser`: a JSON object storing user metadata, including ID, name, email and `role: "doctor"`.
The `currentUser` object looked like this:
```json
{ "id": "fec231c2-ac4c-47de-bd27-6eba1679ae26", "role": "doctor", "specialization": "Cardiology", "status": "approved"}
```
{{media:2}}
Line by line: the outer `{` and `}` mark the start and end of a JSON object. `"id": "fec231c2-ac4c-47de-bd27-6eba1679ae26"` is a field named `id` holding a unique identifier for this user. `"role": "doctor"` is the field that matters most: it says this user is a doctor. `"specialization": "Cardiology"` records the user's medical speciality. `"status": "approved"` says the account has been approved. Commas separate the fields. This is the data the front-end reads to decide what to show.
The `accessToken` is a JWT string used for API authorisation, while `currentUser` stores user metadata. The `role` field in `currentUser` is what the route guards read. That distinction is the heart of the matter: the token is what the server checks, and the `currentUser` object is what the browser checks. If the server only checks the token, and the token says "doctor", then editing `currentUser` should change nothing on the server side.
### Step 2: Client-side role manipulation
Using the browser developer tools (F12, Application, Session Storage), the researcher changed the `role` key inside the `currentUser` JSON string from `"doctor"` to `"admin"`:
```json
{ "role": "admin"}
```
{{media:3}}
Line by line: this is a JSON object with a single field, `role`, whose value is now `"admin"`. The researcher replaced the stored text with this. The reason for doing this is simple: if the front-end trusts this value, the front-end will now believe the user is an administrator and show the administrator screens. That is a test of the front-end. It does not yet prove anything about the server.
This edit touches only data the browser holds locally. The JWT in `accessToken` was not modified, so any request made afterwards still carried the standard clinician's bearer token. "Bearer token" means a token that the client simply presents with each request, like showing a wristband at the door; the server reads it and decides who you are.
### Step 3: Unlocking the administrative interfaces
Refreshing the dashboard caused the React application to re-evaluate the local state. The UI immediately rendered the Super Admin navigation drawer (�
شرف عا�
/ Super Admin), displaying high-level system controls.
{{media:4}}
"Re-evaluate the local state" means the application re-read the stored values and redrew the screen based on them. "Navigation drawer" is the side menu that lists the sections a user can reach. The fact that the Super Admin menu appeared confirms the front-end trusted the edited value. But it proves nothing about the server: a screen can be drawn without the server ever agreeing that the user is allowed to see it. In a secure system, changing local state should only alter what is rendered, while backend endpoints reject privileged actions with `HTTP 403 Forbidden`.
### Step 4: Verifying BFLA against the API
Navigating to the administrative routes triggered API requests to endpoints such as:
```http
GET /api/v1/admins/dashboard/stats
GET /api/v1/admins/doctors
GET /api/v1/admins/subscriptions
```
Line by line: `GET` is the HTTP method meaning "fetch this for me" (as opposed to `POST`, which usually means "create or submit something"). `/api/v1/admins/dashboard/stats` is the address of an endpoint: `/api` marks it as an API call, `/v1` is a version number, `/admins` is the administrative area, and `/dashboard/stats` asks for dashboard statistics. `/api/v1/admins/doctors` asks for the list of doctors. `/api/v1/admins/subscriptions` asks for subscription information. All three sit under the administrative prefix, so all three should be off-limits to a doctor.
The backend processed these requests using the standard user's bearer token and responded with **HTTP 200 OK**, returning full administrative data, organisation breakdowns and system-wide metrics. The server had accepted a doctor's token on administrator-only endpoints, which is the BFLA condition: the function-level authorisation check was missing on the API side, not merely on the client. In other words, the server checked that the token was valid, but not that the token belonged to an administrator.
## Root cause
The flaw came from two architectural issues working together.
1. **Frontend role reliance.** The UI treated client-editable storage (`sessionStorage`) as the source of truth for routing decisions. The `<Ze role="admin">` guards read `currentUser` from storage, so anyone could unlock the administrative UI by editing a JSON field. A useful comparison: it is like a nightclub that decides who gets into the VIP room by asking customers to read out the colour of their own wristband, instead of checking it at the door.
2. **Missing backend authorisation middleware.** The REST API endpoints under `/api/v1/admins/*` checked that a valid JWT was provided, but did not enforce server-side Role-Based Access Control (RBAC) middleware to verify that the claims in that token carried administrative scope. "Middleware" is code that runs before the main handler, like a bouncer who checks your ID before you reach the bar. "RBAC" (Role-Based Access Control) means decisions are made based on the role attached to the user. "Claims" are the pieces of information inside a JWT, such as who the user is and what role they have.
The route guard was purely client-side. The API checked that a valid JWT was provided, but did not verify administrative scope in its claims. "Authentication" means proving who you are; "authorisation" means deciding what you may do. The server was doing the first but not the second.
## Impact
With nothing more than a standard clinician account, an attacker could reach the administrative interfaces and, more seriously, call the administrative API endpoints directly with their own token. The responses returned full administrative data, organisation breakdowns and system-wide metrics, returning full administrative data, organisation breakdowns and system-wide metrics, along with the administrative controls and system-wide management features rendered by the Super Admin drawer. The write-up does not enumerate every administrative function reachable this way; the demonstrated impact is the data returned by the endpoints listed above.
## Fix
The engineering team resolved the issue by implementing strict, server-side RBAC middleware across all `/api/v1/admins/*` endpoints. The report gives an example of server-side role enforcement:
```python
# Example: Server-side role enforcement (FastAPI/Python)@router.get("/admins/dashboard/stats")async def get_admin_stats( current_user: User = Depends(get_current_admin_user) # Verifies role == "admin" from verified JWT): return await fetch_dashboard_stats()
```
Line by line: `# Example: Server-side role enforcement (FastAPI/Python)` is a comment, ignored by the computer, saying this is an example of enforcing roles on the server using the FastAPI framework in Python. `@router.get("/admins/dashboard/stats")` is a decorator that attaches the following function to the endpoint `/admins/dashboard/stats` for `GET` requests. `async def get_admin_stats(` starts the definition of an asynchronous function named `get_admin_stats`; "asynchronous" means it can wait for slow work without blocking everything else. `current_user: User = Depends(get_current_admin_user)` is the key line: before the function runs, the framework calls `get_current_admin_user`, which the comment says verifies that the role is `admin` from a verified JWT. If that check fails, the function never runs. `):` closes the parameter list. `return await fetch_dashboard_stats()` runs the actual work and returns the result. The point is that the check now happens on the server, before any data is handed out.
During re-testing on the production environment, the client-side state was manipulated to `role: "admin"` and the UI attempted to fetch administrative data. The API backend validated the signed JWT claims, identified the user as a `doctor`, and rejected all administrative API calls with `HTTP 403 Forbidden`. The same trick that worked before now failed at the server, which is exactly what should happen.
The write-up closes with three takeaways for developers:
- **Never trust the client.** Client-side storage (`localStorage`, `sessionStorage`, cookies) can be modified by the user at any time. `localStorage` is like `sessionStorage` but persists after the tab closes; cookies are small pieces of data the browser sends to the server automatically with each request.
- **Enforce authorisation at the API layer.** Every API endpoint must independently verify user scopes and permissions on the server for every incoming request.
- **Store sensitive tokens securely.** Use `HttpOnly`, `Secure` and `SameSite` cookies to prevent token theft via client-side scripting. `HttpOnly` means JavaScript cannot read the cookie; `Secure` means it is only sent over encrypted connections; `SameSite` limits when it is sent to other sites.
The vulnerability was reported to and patched by the engineering team before publication, and sensitive identifiers, domain names and personal data were sanitised.
## Variants to test
These are other angles a tester might try, following the same idea.
- **Direct API calls without the UI.** Skip the browser entirely and send the administrative requests with a low-privileged bearer token. A positive result is `HTTP 200 OK` with administrative data instead of `403 Forbidden`. This removes the front-end from the picture and tests the server directly.
- **Other role values in client storage.** Try values such as `admin`, `superadmin`, `owner` or `staff` in the same storage object, and check whether any of them unlock endpoints the account should not reach. Different applications use different role names, so it is worth trying several.
- **Hidden routes from the bundle.** Deobfuscate the router configuration on other SPAs and request every hidden administrative path directly. A positive result is a route that renders or an API call that succeeds for a non-administrative account. Hidden addresses are not secret once the code is public.
- **Function-level checks on sibling endpoints.** Test write operations (create, update, delete) under the administrative prefix, not just reads. A positive result is a state change performed by a low-privileged token. Reading data is bad enough; changing it is worse.
- **Tenant boundaries.** With two accounts in different organisations, call endpoints that reference another tenant's identifiers. A positive result is data from the other organisation returned to the first account. This tests whether the server checks which organisation the user belongs to.
- **Token claim tampering.** If the backend reads the role from the token rather than from storage, check whether the signature is actually verified, for example by altering a claim and replaying the token. A positive result is a request accepted with a modified, unsigned claim. This tests whether the server really checks the signature it claims to check.
## Glossary
- **API (Application Programming Interface)**: the set of addresses and rules a program uses to ask a server for data or actions, like a waiter carrying orders to a kitchen.
- **API endpoint**: a specific address on the server that performs one job, such as returning dashboard statistics.
- **Authentication**: proving who you are, usually by logging in.
- **Authorisation (authorization)**: deciding what a logged-in user is allowed to do.
- **Bearer token**: a token the client presents with each request so the server can identify the user.
- **BFLA (Broken Function Level Authorization)**: a flaw where the system fails to check whether a user may perform a specific action, letting them do things their role should not allow.
- **Claim**: a piece of information inside a token, such as the user's identity or role.
- **Client-side**: happening in the user's browser, under the user's control.
- **Cookie**: a small piece of data the browser stores and sends to the server automatically with requests.
- **Crossorigin**: an HTML attribute affecting how a browser fetches a file from another origin.
- **Deobfuscate**: to tidy up minified or scrambled code so a human can read it.
- **Endpoint**: see API endpoint.
- **FastAPI**: a Python framework for building web APIs.
- **GET**: an HTTP method meaning "fetch this for me".
- **Hardcoded**: written directly into the code rather than fetched from elsewhere.
- **HTTP 200 OK**: the server's reply meaning the request succeeded and here is the data.
- **HTTP 403 Forbidden**: the server's reply meaning the request was understood but the user is not allowed to do it.
- **HttpOnly**: a cookie setting that stops JavaScript from reading the cookie.
- **JSON (JavaScript Object Notation)**: a text format for structured data, using curly braces, field names and values.
- **JWT (JSON Web Token)**: a token that carries information inside it and is digitally signed by the server so it cannot be quietly altered.
- **localStorage**: a browser storage box that persists after the tab closes.
- **Middleware**: code that runs before the main handler, like a bouncer checking IDs before the bar.
- **Minified**: code squashed to save space, with short names and no whitespace, hard for humans to read.
- **OWASP API5:2023**: a catalogue label for a common API security mistake, from a well-known industry list.
- **RBAC (Role-Based Access Control)**: making access decisions based on the role attached to a user.
- **React / React Router**: a JavaScript toolkit for building browser-side applications, and a library for deciding which screen to show for which address.
- **REST API**: a common style of web API built around addresses and HTTP methods like GET.
- **Role**: a label on an account, such as `doctor` or `admin`, describing what it may do.
- **Route**: a web address path, the part after the domain name.
- **Route guard**: a front-end check that decides whether to show a screen to a user.
- **SameSite**: a cookie setting that limits when the cookie is sent to other sites.
- **Secure (cookie)**: a cookie setting that only sends the cookie over encrypted connections.
- **sessionStorage**: a browser storage box that lives in one tab and is cleared when the tab closes.
- **Single Page Application (SPA)**: a website that loads once and redraws itself in the browser as you navigate, rather than loading new pages from the server.
- **Tenant**: one organisation using a shared platform, which should only see its own data.
- **Token**: a small piece of text given to the browser at login and sent back with requests so the server can recognise the user.
- **UI (User Interface)**: the screens and controls a user sees and interacts with.