1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Escape HTML in the 404 page.

There is a reflected XSS in the development mode 404 page for clients
that don't URL-encode the request path. (I'm not aware of any major
browsers that do this, but you can see the idea with cURL.)
This commit is contained in:
Andy Brody 2014-06-11 18:41:02 -07:00
parent f42ed4d236
commit 26cb21542b

View file

@ -1941,7 +1941,7 @@ module Sinatra
<img src='#{uri "/__sinatra__/404.png"}'>
<div id="c">
Try this:
<pre>#{code}</pre>
<pre>#{Rack::Utils.escape_html(code)}</pre>
</div>
</body>
</html>