Skip to content
XSS Disclosed report Beginner

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.

exception Follow

Originally disclosed on HackerOne

Informational View original
  • 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

Screen_Shot_2016-08-20_at_3.48.33_PM.png
Screen_Shot_2016-08-20_at_3.48.33_PM.png From the original on HackerOne
Screen_Shot_2016-08-20_at_3.49.56_PM.png
Screen_Shot_2016-08-20_at_3.49.56_PM.png

The original report as published on HackerOne, by exception. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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.

More by exception

View all

7 more disclosed reports, best first.

More from Gratipay

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.