XSS Via Method injection
The server echoed an unrecognised HTTP method back in an error page without escaping it. An attacker could craft a request whose method contains HTML so that the reflected value executes script in a victim's browser.
- Triaged in 2 hours
- Disclosed after 12 days
Hi guys
i found a low risk vuln , when you request a page on gratipay.com with uncommon Method , the server responds with error message .
Invalid Method 'Invalid HTTP method:TTEGETTT with out escaping chars
so when you inject an html element with method you can trigger an XSS .
Steps to reproduce
- make an http request with a method like this
Fix : you should validate the method value before printing it back in responses
Attachments


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 error handler reflected the raw HTTP method value into the response without HTML-encoding it.
Impact
An attacker could execute script in a victim's browser in the context of the site, though the report rates the risk as low.
What the attacker needed
Ability to send a crafted HTTP request
The fix
The method value should be validated and HTML-encoded before it is printed back in responses.
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.
A web server usually replies with an error when it receives an HTTP method it does not recognise. Here the server copied the method name straight into the error page without making it safe. If the method name contains HTML, the browser may run it as code, which is cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.