DEV Community

Ioneyrezende
Ioneyrezende

Posted on

Bahmni's high-risk patient search needs query-level authorization and parameter binding

Bahmni's high-risk patient search needs query-level authorization and parameter binding

CVE-2026-63192 affects the bahmnicore-omod module in Bahmni 0.93. The issue is SQL injection in the high-risk patient search path. Bahmni's advisory says an authenticated attacker can use boolean-blind and error-based techniques to infer patient data from the database. The direct query result may not display the data, which makes the vulnerability harder to notice than a normal data-dump response.

The data is the impact

This is a read-oriented disclosure issue. The attacker needs an authenticated session, but that requirement does not make it low risk. Healthcare roles often have access to search and reporting functions that can be abused to ask repeated database questions. A Boolean test can turn yes-or-no responses into patient attributes. Error output can reveal database behavior even when no rows are returned.

The affected advisory is fixed in 0.93.1, 1.0.1, 1.1.1, 1.2.1, 1.3.1, and 2.0.1. The fixed build should be verified in the installed module and the OpenMRS runtime, not just in the Bahmni front end.

Remove the dangerous property where possible

Bahmni lists a workaround for sites that do not use the high-risk patient search: remove the global property emrapi.sqlSearch.highRiskPatients. Restrict the SQL search to trusted networks and essential personnel. If the function is required, apply the update and review who can call the underlying REST path.

Move database access to a parameterized query with a read-only application role. Keep patient-record access in a separate authorization decision from general login. Log the search noun and the query path, not the patient data, so security teams can detect repeated Boolean or error-driven requests without creating another sensitive store.

Look for inference, not only bulk export

Detection should include unusual search frequency, repeated requests with changing predicates, database errors returned to an application client, and the same user querying a large number of unrelated patient identifiers. Correlate application logs with database audit logs. A user who retrieves one row at a time can still exfiltrate a lot of information.

If exploitation is suspected, preserve the session, IP address, role, query timestamps, and error messages. Review patient-record access policy and notify the responsible clinical and privacy teams. Do not delete application logs while cleaning the database.

The fix has two layers

Parameter binding prevents SQL syntax from becoming data access. Least privilege limits what a successful injection can read. Both controls are necessary in a clinical application because an authenticated user may already have a legitimate reason to search patient records.

The updated module closes the reported query path. The operational review decides whether the deployment still exposes the feature to too many users or too broad a database role.

References

Top comments (0)