Hi,
I am trying to find sql injection on a post request which allows user registration.This post request has a validation that if we try to register a user with the same username,then it will return a response stating that "User already exists" and this user won't be registered.
Now if this request sends a SQL injection payload in the referrer header,then is the sql injection payload tested through the referrer header against this request or it is not executed since the application has validation in place for duplicate user registration.
Request and response is mentioned below:
Request:POST
http://localhost:5000/users/v1/register HTTP/1.1
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.2
Accept: */*
Postman-Token: ad7a5833-dc3e-4eaf-9c85-b04566bc9633
Connection: keep-alive
Content-Length: 78
Referer:
http://localhost:5000/users/v1/register" OR "1"="1
Host: localhost:5000
{
"username": "2",
"password": "yui2",
"email": "
yu...@fdgfg.com"
}
Response:HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 69
Server: Werkzeug/1.0.1 Python/3.7.14
Date: Mon, 12 Sep 2022 16:10:26 GMT
{ "status": "fail", "message": "User already exists. Please Log in."}
Please suggest.
Do let me know if further information is required here.
Best Regards,
Rakesh Kirola