Skip to content
SQL injection Disclosed report Beginner

SQL Injection on cookie parameter

The lang cookie value was inserted into a database query without proper handling, so a single quote caused a SQL syntax error, indicating SQL injection.

w31rd0 Follow

Originally disclosed on HackerOne

  • Triaged in 37 hours
  • Fixed in 3 months
  • Disclosed after 4 months

Summary:

Hello team. It seams one of the parameters in the cookies is vulnerable to SQL injection. Below requests has the lang parameter in cookies. If you inject one quote mark like '. You get SQL error with the syntax. By injecting a second you have the error removed. I did not attempt to exfiltrate data as this is obvious indication of SQLi.

GET /index.php/search/default?t=1&x=0&y=0 HTTP/1.1
Host: mtn.com.ye
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Cookie: PHPSESSID=86ce3d04baa357ffcacf5d013679b696; lang=en'; _ga=GA1.3.1859249834.1576704214; _gid=GA1.3.1031541111.1576704214; _gat=1; _gat_UA-44336198-10=1
Upgrade-Insecure-Requests: 1

I would like to ask for permission for further exploiting this issue.

Impact

Web application is vulnerable to SQL injection, allowing access to data

Attachments

SQLi.png
SQLi.png From the original on HackerOne

The original report as published on HackerOne, by w31rd0. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the lang cookie value was concatenated into a SQL query without parameterisation or escaping.

Impact

The application is vulnerable to SQL injection, which could allow access to data, though the reporter did not attempt to extract any.

What the attacker needed

Ability to send crafted cookies

How it was found

  1. Change the lang cookie value to include a single quote.
  2. Observe the SQL syntax error in the response.
  3. Add a second quote and see the error disappear.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A cookie is a small piece of data your browser sends back to a website on each request. The site was putting the value of the lang cookie straight into a database command, so a stray quote character broke the command and produced an error. That error shows the input is not being handled safely, which usually means an attacker can make the database reveal or alter information.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by w31rd0

View all

2 more disclosed reports, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.