SQL Injection Vulnerability In University Of Cambridge
A search page on a University of Cambridge museum website was vulnerable to SQL injection through a URL parameter. An attacker could use it to read database information such as the database version, user and name.
Published on web.archive.org
{{media:0}}
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 search parameter was inserted into a SQL query without proper escaping or parameterisation.
Impact
An attacker could read sensitive database information, and the text claims they may also bypass logins or modify and delete data.
What the attacker needed
None
The fix
The vulnerability was fixed according to the author, though the exact fix is not described.
How it was found
- Send a single quote in the search parameter and observe a SQL error.
- Adjust the input with a comment sequence to fix the error and confirm injection.
- Use ORDER BY with increasing numbers to find the number of columns.
- Use UNION SELECT with the correct number of columns to find a visible column.
- Replace a visible column with database functions to read version, user and database name.
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 when a website puts user input directly into a database command without cleaning it. Here, a search page took a value from the web address and used it in a database query, so adding special characters changed what the database did. The author used this to make the site show database details it should not reveal.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.