Comments (8)
If you are interested, I will fork your repo, fix a few things and make a pull request so that you can distribute my changes.
Let me know.
from reqwest.
eval is not bad if it's your own website and data
from reqwest.
This is no response. Eval is bad even if it's your own website and data.
Consider a website sending data to the backend service and the service including the request or part of it in the response in order to be processed on the UI side. Someone malicious could forge a request that could end up being evaluated if proper care wasn't taken (i.e. making sure reqwest won't eval and encoding everything that came from the user). Browse around, there are tons of such websites. Using eval adds a risk for cross-site scripting.
Think about it.
from reqwest.
If you're using JSON responses, just make sure you have a window.JSON
object, use a polyfill for older browsers, and eval()
won't be invoked. If you're using Reqwest in Ender then include ender-json in your build and the world will be at peace.
If you're using JS responses and don't like eval()
then stop using JS or give it a different type and handle responseText
yourself. JS over AJAX isn't ideal anyway.
from reqwest.
Oh, I'm definitely not sending JS from the server. I'm just stating the fact that code can be injected and executed through the eval().
from reqwest.
caveat emptor
from reqwest.
sorry if the response was terse. as @rvagg explained, there are simple ways around it and it's used as the last resort
from reqwest.
Oh I'm aware of the proper ways to do ajax. However, in your library, 'JS' is absolutely not "last resort" as your it uses it by DEFAULT. This is the complete opposite of last resort. Make the web safer by preventing inexperienced developers make silly mistakes like that.
If you feel the 'JS' type can be useful for some people, by all means keep it, but it should definitely not be the default. Furthermore, the 'JSON' type should not default to a simple 'eval()' call in case of a browser without native JSON parser (an alternative solution is use a JSON parser lib like crockford's).
There is a reason why JSON parsers exist in the first place.
This is my professional opinion. Take it or leave it.
from reqwest.
Related Issues (20)
- Setting contentType to application/json leads to session cookie not being sent HOT 1
- Setting content-type to 'application/json' on POST seems to be broken HOT 2
- context undefined when using webpack HOT 8
- reqwest 404 Request Method:OPTIONS
- Uncaught TypeError: Cannot read property 'responseText' of undefined
- if ajax return empty string ,the success function first param type will become "XMLHttpRequest" HOT 1
- How to abort a request? HOT 1
- Unable to send multipart/form-data request HOT 2
- Incorrect handling of response data
- reqwest promise with Nock HOT 1
- in IOS/Android webview, CORS, reqwest run error
- cache
- when I use reqwest post file,there is error: nested exception is java.lang.NullPointerException
- No err was throwed when network disconnected
- Ability to disable TLS at compile time? HOT 1
- CORS error when trying to get google geocoding HOT 4
- not support more than 16 integer data in response data
- how can i get response head HOT 3
- Type settings jsonp, jsonpCallback and jsonpCallbackName are not added, there will be default callback? HOT 1
- greenhouse HOT 1
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 reqwest.