Vulnerable code:
if (isset($_GET['id'])) {
$client_id = mysql_real_escape_string($_GET['id']);
/
* Check if the id corresponds to a real client.
* Return 1 if true, 2 if false.
/
$page_status = (client_exists_id($client_id)) ? 1 : 2;
}
else {
/*
* Return 0 if the id is not set.
/
$page_status = 0;
}
/*
* Get the clients information from the database to use on the form.
/
if ($page_status === 1) {
$editing = $database->query("SELECT * FROM tbl_users WHERE
id=$client_id");
while($data = mysql_fetch_array($editing)) {
$add_client_data_name = $data['name'];
$add_client_data_user = $data['user'];
$add_client_data_email = $data['email'];
$add_client_data_addr = $data['address'];
$add_client_data_phone = $data['phone'];
$add_client_data_intcont = $data['contact'];
if ($data['notify'] == 1) { $add_client_data_notity = 1; }
else { $add_client_data_notity = 0; }
if ($data['active'] == 1) { $add_client_data_active = 1; }
else { $add_client_data_active = 0; }
}
}
::DISCLOSURE::
+ 01/06/2015: Detect vulnerability
+ 01/07/2015: Contact to vendor
+ 01/08/2015: Send the detail vulnerability to vendor - vendor did not reply
+ 03/05/2015: Public information
::DISCLAIMER::
THE INFORMATION PRESENTED HEREIN ARE PROVIDED ?AS IS? WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, ANY
IMPLIED WARRANTIES AND MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
OR WARRANTIES OF QUALITY OR COMPLETENESS. THE INFORMATION PRESENTED HERE IS
A SERVICE TO THE SECURITY COMMUNITY AND THE PRODUCT VENDORS. ANY APPLICATION
OR DISTRIBUTION OF THIS INFORMATION CONSTITUTES ACCEPTANCE ACCEPTANCE AS IS,
AND AT THE USER'S OWN RISK.
ITAS Team (www.itas.vn)
{"id": "SECURITYVULNS:DOC:31854", "bulletinFamily": "software", "title": "ProjectSend r561 - SQL injection vulnerability", "description": "\r\n\r\n#Vulnerability title: ProjectSend r561 - SQL injection vulnerability\r\n#Product: ProjectSend r561\r\n#Vendor: http://www.projectsend.org/\r\n#Affected version: ProjectSend r561\r\n#Download link: http://www.projectsend.org/download/67/\r\n#Fixed version: N/A\r\n#Author: Le Ngoc Phi (phi.n.le () itas vn) & ITAS Team (www.itas.vn)\r\n\r\n\r\n::PROOF OF CONCEPT::\r\n\r\n+ REQUEST:\r\nGET /projectsend/users-edit.php?id=<SQL INJECTION HERE> HTTP/1.1\r\nHost: target.org\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101\r\nFirefox/35.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nCookie: 54f8105d859e0_SESSION=q6tjpjjbt53nk1o5tnbv2123456;\r\nPHPSESSID=jec50hu4plibu5p2p6hnvpcut6\r\nConnection: keep-alive\r\n\r\n\r\n- Vulnerable file: client-edit.php\r\n- Vulnerable parameter: id\r\n- Vulnerable code: \r\nif (isset($_GET['id'])) {\r\n $client_id = mysql_real_escape_string($_GET['id']);\r\n /**\r\n * Check if the id corresponds to a real client.\r\n * Return 1 if true, 2 if false.\r\n **/\r\n $page_status = (client_exists_id($client_id)) ? 1 : 2;\r\n}\r\nelse {\r\n /**\r\n * Return 0 if the id is not set.\r\n */\r\n $page_status = 0;\r\n}\r\n\r\n/**\r\n * Get the clients information from the database to use on the form.\r\n */\r\nif ($page_status === 1) {\r\n $editing = $database->query("SELECT * FROM tbl_users WHERE\r\nid=$client_id");\r\n while($data = mysql_fetch_array($editing)) {\r\n $add_client_data_name = $data['name'];\r\n $add_client_data_user = $data['user'];\r\n $add_client_data_email = $data['email'];\r\n $add_client_data_addr = $data['address'];\r\n $add_client_data_phone = $data['phone'];\r\n $add_client_data_intcont = $data['contact'];\r\n if ($data['notify'] == 1) { $add_client_data_notity = 1; }\r\nelse { $add_client_data_notity = 0; }\r\n if ($data['active'] == 1) { $add_client_data_active = 1; }\r\nelse { $add_client_data_active = 0; }\r\n }\r\n}\r\n\r\n\r\n\r\n::DISCLOSURE::\r\n+ 01/06/2015: Detect vulnerability\r\n+ 01/07/2015: Contact to vendor\r\n+ 01/08/2015: Send the detail vulnerability to vendor - vendor did not reply\r\n+ 03/05/2015: Public information\r\n\r\n::REFERENCE::\r\n-\r\nhttp://www.itas.vn/news/itas-team-found-out-a-SQL-Injection-vulnerability-in\r\n-projectsend-r561-76.html\r\n\r\n\r\n::DISCLAIMER::\r\nTHE INFORMATION PRESENTED HEREIN ARE PROVIDED ?AS IS? WITHOUT WARRANTY OF\r\nANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, ANY\r\nIMPLIED WARRANTIES AND MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE\r\nOR WARRANTIES OF QUALITY OR COMPLETENESS. THE INFORMATION PRESENTED HERE IS\r\nA SERVICE TO THE SECURITY COMMUNITY AND THE PRODUCT VENDORS. ANY APPLICATION\r\nOR DISTRIBUTION OF THIS INFORMATION CONSTITUTES ACCEPTANCE ACCEPTANCE AS IS,\r\nAND AT THE USER'S OWN RISK.\r\n\r\n---------------------------------------------------------------------\r\nITAS Team (www.itas.vn)\r\n\r\n\r\n", "published": "2015-03-23T00:00:00", "modified": "2015-03-23T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "https://vulners.com/securityvulns/SECURITYVULNS:DOC:31854", "reporter": "Securityvulns", "references": [], "cvelist": [], "type": "securityvulns", "lastseen": "2018-08-31T11:10:58", "edition": 1, "viewCount": 2, "enchantments": {"score": {"value": 1.7, "vector": "NONE"}, "dependencies": {"references": [{"type": "securityvulns", "idList": ["SECURITYVULNS:VULN:14346"]}], "rev": 4}, "backreferences": {}, "exploitation": null, "vulnersScore": 1.7}, "affectedSoftware": [], "immutableFields": [], "cvss2": {}, "cvss3": {}, "_state": {"dependencies": 1645254681}}