SourceCodester Online Eyewear Shop 1.0 POST Request oews/classes/Users.php registration firstname/middlename/lastname/email/contact cross site scripting
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 5.3 | $0-$5k | 0.18 |
A vulnerability has been found in SourceCodester Online Eyewear Shop 1.0 and classified as problematic. Affected by this vulnerability is the function registration of the file oews/classes/Users.php of the component POST Request Handler. The manipulation of the argument firstname/middlename/lastname/email/contact with an unknown input leads to a cross site scripting vulnerability. The CWE definition for the vulnerability is CWE-79. The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. As an impact it is known to affect integrity.
The weakness was shared 02/07/2023 by Pierfrancesco Conti with Cyber Partners. This vulnerability is known as CVE-2023-0732. It demands that the victim is doing some kind of user interaction. Technical details and also a exploit are known. MITRE ATT&CK project uses the attack technique T1059.007 for this issue. Responsible for the vulnerability is the following code:
function registration(){
if(!empty($_POST['password']))
$_POST['password'] = md5($_POST['password']);
else
unset($_POST['password']);
extract($_POST);
$main_field = ['firstname', 'middlename', 'lastname', 'gender', 'contact', 'email', 'status', 'password'];
$data = "";
$check = $this->conn->query("SELECT * FROM `customer_list` where email = '{$email}' ".($id > 0 ? " and id!='{$id}'" : "")." ")->num_rows;
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = 'Email already exists.';
return json_encode($resp);
}
foreach($_POST as $k => $v){
$v = $this->conn->real_escape_string($v);
if(in_array($k, $main_field)){
if(!empty($data)) $data .= ", ";
$data .= " `{$k}` = '{$v}' ";
}
}
if(empty($id)){
$sql = "INSERT INTO `customer_list` set {$data} ";
}else{
$sql = "UPDATE `customer_list` set {$data} where id = '{$id}' ";
}
$save = $this->conn->query($sql);
if($save){
$uid = !empty($id) ? $id : $this->conn->insert_id;
$resp['status'] = 'success';
$resp['uid'] = $uid;
if(!empty($id))
$resp['msg'] = 'User Details has been updated successfully';
else
$resp['msg'] = 'Your Account has been created successfully';
if(!empty($_FILES['img']['tmp_name'])){
if(!is_dir(base_app."uploads/customers"))
mkdir(base_app."uploads/customers");
$ext = pathinfo($_FILES['img']['name'], PATHINFO_EXTENSION);
$fname = "uploads/customers/$uid.png";
$accept = array('image/jpeg','image/png');
if(!in_array($_FILES['img']['type'],$accept)){
$resp['msg'] = "Image file type is invalid";
}
if($_FILES['img']['type'] == 'image/jpeg')
$uploadfile = imagecreatefromjpeg($_FILES['img']['tmp_name']);
elseif($_FILES['img']['type'] == 'image/png')
$uploadfile = imagecreatefrompng($_FILES['img']['tmp_name']);
if(!$uploadfile){
$resp['msg'] = "Image is invalid";
}
$temp = imagescale($uploadfile,200,200);
if(is_file(base_app.$fname))
unlink(base_app.$fname);
$upload =imagepng($temp,base_app.$fname);
if($upload){
$this->conn->query("UPDATE `customer_list` set `avatar` = CONCAT('{$fname}', '?v=',unix_timestamp(CURRENT_TIMESTAMP)) where id = '{$uid}'");
}
imagedestroy($temp);
}
if(!empty($uid) && $this->settings->userdata('login_type') != 1){
$user = $this->conn->query("SELECT * FROM `customer_list` where id = '{$uid}' ");
if($user->num_rows > 0){
$res = $user->fetch_array();
foreach($res as $k => $v){
if(!is_numeric($k) && $k != 'password'){
$this->settings->set_userdata($k, $v);
}
}
$this->settings->set_userdata('login_type', '2');
}
}
}else{
$resp['status'] = 'failed';
$resp['msg'] = $this->conn->error;
$resp['sql'] = $sql;
}
if($resp['status'] == 'success' && isset($resp['msg']))
$this->settings->set_flashdata('success', $resp['msg']);
return json_encode($resp);
}It is declared as proof-of-concept. By approaching the search of inurl:oews/classes/Users.php it is possible to find vulnerable targets with Google Hacking.
There is no information about possible countermeasures known. It may be suggested to replace the affected object with an alternative product.
Product
Vendor
Name
License
- free
CPE 2.3
CPE 2.2
CVSSv3
VulDB Meta Base Score: 5.5VulDB Meta Temp Score: 5.3
VulDB Base Score: 3.5
VulDB Temp Score: 3.2
VulDB Vector: 🔒
VulDB Reliability: 🔍
Researcher Base Score: 9.0
Researcher Vector: 🔒
NVD Base Score: 6.1
NVD Vector: 🔒
CNA Base Score: 3.5
CNA Vector (VulDB): 🔒
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| unlock | unlock | unlock | unlock | unlock | unlock |
| unlock | unlock | unlock | unlock | unlock | unlock |
| unlock | unlock | unlock | unlock | unlock | unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Researcher Base Score: 🔒
NVD Base Score: 🔒
Exploiting
Class: Cross site scriptingCWE: CWE-79 / CWE-74 / CWE-707
ATT&CK: T1059.007
Local: No
Remote: Yes
Availability: 🔒
Status: Proof-of-Concept
Google Hack: 🔒
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | unlock | unlock | unlock | unlock |
|---|---|---|---|---|
| Today | unlock | unlock | unlock | unlock |
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: no mitigation knownStatus: 🔍
0-Day Time: 🔒
Timeline
02/07/2023 Advisory disclosed02/07/2023 CVE reserved
02/07/2023 VulDB entry created
03/06/2023 VulDB last update
Sources
Advisory: vuldb.comResearcher: Pierfrancesco Conti
Organization: Cyber Partners
Status: Not defined
CVE: CVE-2023-0732 (🔒)
scip Labs: https://www.scip.ch/en/?labs.20161013
Entry
Created: 02/07/2023 21:04Updated: 03/06/2023 11:07
Changes: 02/07/2023 21:04 (39), 02/08/2023 14:11 (8), 02/08/2023 14:12 (15), 02/08/2023 14:15 (4), 03/06/2023 11:01 (3), 03/06/2023 11:07 (28)
Complete: 🔍
Submitter: CP_offensive_team
Committer: CP_offensive_team
No comments yet. Languages: en.
Please log in to comment.