-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSS from params parser exception (status code : 400) #1428
Comments
Really critical issue, thank you for the report. This vulnerability has been added since this commit. |
The attached fix looks good 👍 |
escape invalid query params, fixes #1428
CVE is here: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11627 |
👋 I am Rob and I work on the GitHub team that sends vulnerability alerts. Since the CVE is now public, we'd like to send out alerts to users of sinatra <= 2.0.1. We see here though that you're working on releasing 2.0.2 into RubyGems however. We plan to publish alerts an alert in the next 48 hours - can you advise on when you plan to release 2.0.2? Thank you! |
@rschultheis Sorry, Rob. We will release within a few hours from now. |
Thank you for the quick turn around @namusyaka 🙇 . We've now started publishing alerts for the CVE. |
@namusyaka @rschultheis FYI Sinatra applications using 1.4.8 (and lower I guess) are also affected, when run as "modular" applications see my repro at https://github.com/dentarg/gists/tree/master/gists/sinatra-CVE-2018-11627#cve-2018-11627 |
My bad, the issue lies with rack 1.6.x. I will open the issue there. |
Hmm, rack 1.6.10 isn't vulnerable out-of-the-box. Might still be an issue with Sinatra? |
Ah, I see that it was discussed in #1070, to not release to the 1.x series. |
Ah, with
|
...but Sinatra 2.0.1 does have the problem even with Sorry for the noise, but maybe this saves someone else from playing 🕵️ themselves :) |
sinatra/sinatra#1428 Initial investigation was done in https://github.com/twingly/zoo/issues/405
sinatra/sinatra#1428 Initial investigation was done in https://github.com/twingly/zoo/issues/405
Hi @dentarg, The GitHub security alerts for CVE-2018-11627 are currently only going to repos that have sinatra 2.0.0 or 2.0.1 in their Gemfile and/or Gemfile.lock files. Since the CVE did not specify a minimum version, we did perform a very basic analysis to determine that the minimum non-beta version appears to be 2.0.0. If you have more insight onto what the correct minimum version for this vulnerability is we can update our data and alert the appropriate repos. Thank you for the ping! |
@rschultheis I think you are correct in that minimum version for this vulnerability is 2.0.0. (However, I have only checked 1.4.8, not anything below that.) |
Name: sinatra Version: 2.0.1 Advisory: CVE-2018-11627 Criticality: Unknown URL: sinatra/sinatra#1428 Title: XSS via the 400 Bad Request page Solution: upgrade to >= 2.0.2
Because in the previous version of the gemspec we had an open reference to Sinatra it meant we were essentially saying any version would do. Hakiri was flagging this with [CVE-2018-7212](sinatra/sinatra#1379), the resolution of which was to specify a version equal to or greater than 2.0.1 It was then flagging this project with [CVE-2018-11627](sinatra/sinatra#1428), and again the resolution was to specify a version, this time equal to or greater than 2.0.2
Because in the previous version of the gemspec we had an open reference to Sinatra it meant we were essentially saying any version would do. Hakiri was flagging this with [CVE-2018-7212](sinatra/sinatra#1379), the resolution of which was to specify a version equal to or greater than 2.0.1 It was then flagging this project with [CVE-2018-11627](sinatra/sinatra#1428), and again the resolution was to specify a version, this time equal to or greater than 2.0.2
By the way, Is it possible to attack against other , I think so because form content-type "x-www-form-urlencoded" will encode < to %3c and "text/palin" will not work in sinatra in this case . |
source at :
sinatra/lib/sinatra/base.rb
Line 78 in 3fa1f2c
demo code
call curl like
return
I know it 400 , but the error message can be HTML ... & no way to disable / filter it ...
and you can use code like this to overwrite it
The text was updated successfully, but these errors were encountered: