cxronen / OpenRoom

Other
0 stars 0 forks source link

CX Reflected_XSS_All_Clients @ modules/dayviewAJAX.php [master] #87

Open cxronen opened 4 years ago

cxronen commented 4 years ago

Reflected_XSS_All_Clients issue exists @ modules/dayviewAJAX.php in branch master

The application's <?php embeds untrusted data in the generated output with echo, at line 1 of modules\dayviewAJAX.php. This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output. The attacker would be able to alter the returned web page by simply providing modified data in the user input _POST, which is read by the <?php method at line 1 of modules\dayviewAJAX.php. This input then flows through the code straight to the output web page, without sanitization.  This can enable a Reflected Cross-Site Scripting (XSS) attack.

Severity: High

CWE:79

Checkmarx

Lines: 186 44 221


Code (Line #186):

                            if($isadministrator == "TRUE" || $_SESSION["username"] == (string)$reservation->username) $info .= "<strong>Time of Request</strong>: ". $reservation->timeofrequest ."<br/><br/><center>Cancel this reservation? <a href=\'javascript:cancel(". $reservation->id .",". $_POST["group"] .");\'>Yes</a> <a href=\'javascript:closePopUp();\'>No</a></center>";

Code (Line #44):

        $group_str .= "<td onClick=\"dayviewer('". $_POST["fromrange"] ."','". $_POST["torange"] ."','". $group["roomgroupid"] ."','');\" ". $selected_str .">". $group["roomgroupname"] ."</td>";

Code (Line #221):

                $collision = "<img style=\"cursor: pointer;\" src=\"". $_SESSION["themepath"] ."images/reservebutton.png\" border=\"0\" onClick=\"showPopUpReserve(this,'". $room->name ."','". $time_str ."','". $_POST["group"] ."','". $altusernamestr ."','". $room->id ."','". strtotime($currentmdy ." ". $current_time->getTime()) ."','". $capacity ."','". $durationhtml ."','". $capacity_string ."','". $optionalfields_string ."');\" />\n";