Comments (5)
Thanks for the report. Do you have any suggestions what to do about it?
from sinatra.
Hello @dentarg,
I initially suggest the HTML escaping within the uri
in this code snippet:
<img src='#{uri '/__sinatra__/404.png'}'>
from sinatra.
Yeah, I was thinking that and <img src='#{Rack::Utils.escape_html(uri('/__sinatra__/404.png'))}'>
does work fine.
I was also thinking, why do we need to use uri
at all here? So I looked in the git history, and found 238eede, the reason is "when running under a nested path"
...but why not use the same solution, SCRIPT_NAME
, as for the 500 image? I did that in #1943
from sinatra.
Because by using the header X-Forwarded-Host
we are able to change the Host Header and instead of a host, we write a Javascript payload.
from sinatra.
But yes, you can use the solution that you did in #1943
from sinatra.
Related Issues (20)
- Remove `Tilt::Cache` usage (needed for Tilt 3) HOT 3
- Make tests pass on JRuby 9.4 HOT 3
- `NoMethodError - undefined method '=~' for 1:Integer` HOT 1
- Update streaming to make use of Rack "callable body"
- Test
- Streaming in `before` filter
- DOS attack due to automatic Rack body parsing (incorrect Content-Type) HOT 1
- Move development dependencies from gemspec to Gemfile
- Specify `rack` version requirement for `rack-protection` HOT 3
- Improve release workflow HOT 12
- Sinatra Namespace and sinatra.route HOT 2
- Remove use of `TemplateCache` HOT 3
- Release 3.1.0
- Disable `session_hijacking` by default HOT 2
- Add `base64` dependency HOT 3
- Remove code for encrypted cookies in favour of rack-session HOT 5
- Spam issue, ignore
- Sinatra::IndifferentHash does not support initialization with any hash or key-value pair list HOT 9
- Remove the `IndifferentHash` initializer HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sinatra.