Bhima 1.27.0 - Sensitive Information Disclosure via IDOR
6.5
Medium
Discovered by

Offensive Team, Fluid Attacks
Summary
Full name
Bhima 1.27.0 - Sensitive Information Disclosure via IDOR
Code name
State
Public
Release date
Affected product
Bhima
Vendor
Third Culture Software
Affected version(s)
1.27.0
Vulnerability name
Insecure object reference
Vulnerability type
Remotely exploitable
Yes
CVSS v3.1 vector string
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CVSS v3.1 base score
6.5
Exploit available
Yes
CVE ID(s)
Description
Bhima 1.27.0 exposes user-management API endpoints to any authenticated user,
without checking that the requester is an administrator or is requesting their
own record. A low-privileged user can enumerate users through GET /users and
retrieve another user's detailed record through GET /users/:id by changing
the numeric identifier.
The exposed information includes usernames, account status, last-login data,
role memberships, depot and cash-box assignments. The detailed endpoint also
returns email addresses and project permissions.
Vulnerability
Root cause
Bhima's global access middleware requires a valid authenticated session for/users routes, but version 1.27.0 did not apply an authorization check to the
user-list endpoint. The affected route was registered as:
The users.list controller executes a query over the user table and related
roles, depots, and cash-box permissions, then returns the rows to the caller.
It does not compare the requested records with req.session.user.id, nor check
for an administrator role.
The detail endpoint has the same authorization flaw. In version 1.27.0 it was
registered as:
users.detail passes the attacker-controlled :id to lookupUser(). That
function returns the matching user's username, email, account state, roles,
depots, cash boxes, and project identifiers. There is no ownership or
administrator check before the response is returned.
Source-to-sink path
Source — authenticated low-privileged user: The attacker logs in with a
valid non-administrative account and obtains a session cookie orx-access-tokenJWT.Object reference: The attacker requests
GET /usersto enumerate user
identifiers, or supplies another user's numeric identifier inGET /users/:id.Missing authorization: The routes and controller do not require an
administrator role and do not constrain:idto the authenticated user's
identifier.Data retrieval:
list()andlookupUser()query theuser,user_role,role,depot_permission,depot,cashbox_permission,cash_box, andproject_permissiontables.Sink — HTTP response: The resulting records are serialized as JSON and
returned with HTTP 200 to the low-privileged caller.
Impact
An authenticated ordinary user can access user information belonging to other
accounts. The information supports account and organizational reconnaissance:
usernames, email addresses, account activity/status, role memberships, project
permissions, and operational assignments. The vulnerability has no direct
integrity or availability impact in the demonstrated read path.
Use a local Bhima 1.27.0 instance with two test accounts: a low-privileged
attacker account and a distinct target account. Do not use a production system
or accounts belonging to other people.
Authenticate as the low-privileged test account and retain its JWT:
Enumerate users using the low-privileged token:
Expected vulnerable result: HTTP 200 and JSON entries for users other than the
authenticated account, including their identifiers, usernames, status, roles,
depots, and cash boxes.
Request a target user's detailed record by changing the numeric ID:
Expected vulnerable result: HTTP 200 and the target user's detailed JSON
record, including email address and project-permission identifiers.
Evidence of exploitation

Our security policy
We have reserved the ID CVE-2023-0967 to refer to this issue from now on. Disclosure policy
System Information
Bhima
Version: 1.27.0
Operating System: GNU/Linux
References
GitHub repository: https://github.com/IMA-WorldHealth/bhima/
Historical authorization change: https://github.com/IMA-WorldHealth/bhima-2.x/commit/c14c1b63141dc06b30814de997f0f8e317685acf
Authorization-removal change: https://github.com/IMA-WorldHealth/bhima-2.x/commit/611f9674974998d1f611710818acadbaddcadd83
Mitigation
There is currently no patch available for this vulnerability.
Credits
The vulnerability was discovered by Carlos Bello from Fluid Attacks' Offensive Team.
Timeline
Vulnerability discovered
Vendor contacted
Vendor replied
Public disclosure
Does your application use this vulnerable software?
During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.














