Skip to content
SQL injection Write-up Beginner

How I secured Government Website from huge Data breach

A government website had a SQL injection vulnerability in a URL parameter, allowing an attacker to extract sensitive personal data from many databases. The author used automated tools to confirm the flaw and retrieve database names and user credentials.

medium.com

Published on medium.com

In this post, I’m going to share how I discovered a SQL injection vulnerability on a government website that leads to a huge data breach. here are some info regarding the site: The redacted.gov.in domain is used to apply birth and death certificates for citizens.

jejex0, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the application failed to properly sanitise or parameterise user input in the UserId parameter before using it in a database query.

Impact

An attacker could access sensitive personal information such as Aadhar numbers, mobile numbers, addresses, passport numbers, and user credentials from multiple databases.

What the attacker needed

None

The fix

The vulnerability was fixed after being reported to NCIIPC.

How it was found

  1. Collected URLs from the website using a tool called Paramspider.
  2. Identified a URL with a UserId parameter that looked vulnerable.
  3. Tested by adding an apostrophe to the parameter, which caused a 500 Internal Server Error.
  4. Confirmed SQL injection manually with further tests.
  5. Used SQLmap to enumerate databases and extract data.

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 write-up has not been written yet. The Original tab links to the source.

SQL injection is a way to trick a website's database into running unintended commands by inserting special characters into input fields. Here, the UserID parameter in the URL was not properly sanitised, so an attacker could make the database reveal private information like ID numbers and passwords.

What is SQL injection?

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

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.