← Vulnerability feed

Vulnerability record · CVE-2021-25921 · published 22 March 2021

CVE-2021-25921: OpenEMR Allergies section stored XSS via unvalidated input

Open Emr · Openemr

OpenEMR versions 2.7.3-rc1 through 6.0.0 fail to properly validate user input in the Allergies section, allowing stored cross-site scripting. Because the payload persists in the application, it can execute in the browser of any user who later views the affected record, including administrators. This matters in a clinical system where admin sessions can expose sensitive patient data and configuration.

5.4 CVSS 3.1 Medium EPSS 91% · top 0.2% CWE-79 · Cross-site scripting
5.4CVSS 3.1 base score, v2 3.5
91%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
4References
17 Jun 2026Last modified by NVD

Description

In OpenEMR, versions 2.7.3-rc1 to 6.0.0 are vulnerable to Stored Cross-Site-Scripting (XSS) due to user input not being validated properly in the `Allergies` section. An attacker could lure an admin to enter a malicious payload and by that initiate the exploit.

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: medium.

medium priorityCVSS rates it medium (5.4) and it requires authentication plus user interaction, but the very high EPSS and stored nature in a clinical system raise the practical risk.

What it is

OpenEMR versions 2.7.3-rc1 through 6.0.0 fail to properly validate user input in the Allergies section, allowing stored cross-site scripting. Because the payload persists in the application, it can execute in the browser of any user who later views the affected record, including administrators. This matters in a clinical system where admin sessions can expose sensitive patient data and configuration.

Impact

An attacker can execute arbitrary script in a victim's authenticated session, enabling session theft, data exfiltration, or actions performed with the victim's privileges. The scope change in the CVSS vector indicates the injected script can affect resources beyond the vulnerable component.

Attack surface

Reached over the network through the Allergies section of the OpenEMR web interface. The CVSS vector requires low privileges (PR:L) and user interaction (UI:R), meaning an authenticated low-privileged user must enter the payload and an admin must be lured into viewing it.

Exploitation

Not listed in CISA KEV and no ransomware associations are documented. EPSS is very high at 0.911 (99.8th percentile), but the record contains no public exploit reference, so active exploitation is not confirmed by the supplied data.

What to do

  • Upgrade OpenEMR to a version containing the fix in commit 0fadc3e592d84bc9dfe9e0403f8bd6e3c7d8427f or later.
  • Apply output encoding and input validation to the Allergies section and any other user-supplied fields.
  • Enforce a Content Security Policy that restricts inline script execution.
  • Restrict who can create or edit allergy records and review existing entries for injected content.

Detection

  • Search allergy record fields and audit logs for script tags, event handlers, or encoded HTML entities.
  • Monitor web logs for requests containing script payloads in allergy-related parameters.
  • Alert on anomalous admin session activity such as unexpected outbound requests or privilege changes after viewing allergy records.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2021-25921 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.8CVE-2026-24898Open-emr openemr improper authentication vulnerabilityOpenEMR is a free and open source electronic health records and medical practice management application. Prior to 8.0.0, an unauthenticated token dis…EPSS 0.56%9.8CVE-2024-22611Open-emr openemr sql injection vulnerabilityOpenEMR 7.0.2 is vulnerable to SQL Injection via \openemr\library\classes\Pharmacy.class.php, \controllers\C_Pharmacy.class.php and \openemr\controll…EPSS 6.3%9.8CVE-2024-37734Open-emr openemr vulnerabilityAn issue in OpenEMR 7.0.2 allows a remote attacker to escalate privileges viaa crafted POST request using the noteid parameter.EPSS 0.80%9.8CVE-2020-13567Open-emr openemr sql injection vulnerabilityMultiple SQL injection vulnerabilities exist in phpGACL 3.3.7. A specially crafted HTTP request can lead to a SQL injection. An attacker can send an …EPSS 2.3%9.8CVE-2019-17197Open-emr openemr sql injection vulnerabilityOpenEMR through 5.0.2 has SQL Injection in the Lifestyle demographic filter criteria in library/clinical_rules.php that affects library/patient.inc.EPSS 1.5%9.8CVE-2019-14529Open-emr openemr sql injection vulnerabilityOpenEMR before 5.0.2 allows SQL Injection in interface/forms/eye_mag/save.php.EPSS 28%9.8CVE-2018-17179Open-emr openemr sql injection vulnerabilityAn issue was discovered in OpenEMR before 5.0.1 Patch 7. There is SQL Injection in the make_task function in /interface/forms/eye_mag/php/taskman_fun…EPSS 13%9.8CVE-2018-17181Open-emr openemr sql injection vulnerabilityAn issue was discovered in OpenEMR before 5.0.1 Patch 7. SQL Injection exists in the SaveAudit function in /portal/lib/paylib.php and the portalAudit…EPSS 1.4%

Source: NIST National Vulnerability Database (record CVE-2021-25921), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.