这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@annaowens
Copy link
Contributor

Description of what I changed

@isears
Fixed DWREncounterService.java to encode the search result phrase that appears when users search for an encounter to add in the Edit Visit page.

Note: Since ui was not defined in this file, I modeled this fix after this PR.

Link to Ticket

https://issues.openmrs.org/browse/RA-1865

Issue I worked on

This fix protects against reflected XSS that is executed when a user searches for an encounter to add on the Edit Visit page. Specifically, this vulnerability fixes the vulnerability that occurs when no search results match the search phrase. The search widget that appears presents a message which reads "No matches found for {search phrase}", which reflects XSS in the search phrase.

Before Fix

Injected iframe appears in search message:
VulnerableEmpt71

After Fix

Search message is now shown as text rather than interpreted as HTML:
FixedEmpt71

Steps to reproduce

  1. Launch the OpenMRS application.
  2. Login with username "Admin" and password "Admin123" with location as Inpatient Ward.
  3. Select “System Administration”
  4. Select “Advanced Administration”
  5. Select “Manage Patients”
  6. Type in “John” in the search box.
  7. Select the “John D Patient” record.
  8. Click on “View Patient Dashboard”.
  9. Click on the “Start Visit” button.
  10. Click on the “Add Encounter” button.
  11. Enter <iframe src=https://www.ncsu.edu/> in the text box that appears

An iframe will appear in the search result.

Copy link
Member

@isears isears left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw this, sorry it took so long to review. Thanks @annaowens

@isears isears merged commit 29090aa into openmrs:master Apr 11, 2021
Parth59 pushed a commit to Parth59/openmrs-module-legacyui that referenced this pull request Apr 21, 2021
Parth59 added a commit to Parth59/openmrs-module-legacyui that referenced this pull request Apr 21, 2021
* Logging when user accesses server log (openmrs#156)

* RA-1865: Patch bugs discovered by NCSU team (openmrs#154)

* Changed DWRPersonService for EMPT46 (openmrs#158)

Reverted openmrs.js changes

* Fixed DWRConceptService for EMPT46 (openmrs#159)

Reverted openmrs.js changes

DWRPersonService

Co-authored-by: Jack MacDonald <33408323+jmmacdo4@users.noreply.github.com>
Co-authored-by: Anna Owens <35906111+annaowens@users.noreply.github.com>
Parth59 pushed a commit to Parth59/openmrs-module-legacyui that referenced this pull request Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants