--
mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
I'm a little nervous that this risk exists by default. Maybe a good compromise is for the generic views to check if it's a localhost request?Separately, I typically do "select()" without specifying any fields. Is it better practice to specify only the fields you need? Is there also a performance or memory benefit? I do not use "return locals()".
--
generic views are supposed to be a development tool. In production they should not be used (or should be customized).
In the case of generic views the problem is not in locals() but in response._vars which stores every object returned by the controller to the view.
Maybe a good compromise is for the generic views to check if it's a localhost request?
I'd leave it as it is. Doing heuristics on developer's intentions can make things worst. Of course warnings in the handbook are always a good thing!
mic
Sorry, but I don't agree. This is a pretty significant security hole that is open by default. It never would have occurred to me that I have to delete the generic files to avoid a data breach. If you have to name your fields in the select() to avoid security problems, that needs to be highlighted front and center. Don't forget that it is supposedly the view that is calling the controller so one might reasonably expect that the view only has access to the data it's using.Hope none of our critics read this thread.
I do not believe there is any security issue in exposing response._vars so that is still there.
Rails also seems to use mostly "select *".
--
mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
Yes but with select is another thing, different to this, is up to the developer to use * or selects fields, is more for a style guide.Agree with anthony, also I remember one time someone show a code returning global in the group. So the potential problem is out there, it's hurts, the web2py need to be secure by default, also because there are many users-starter in the programming web framework here.Massimo you are going to fix this issue in the core of web2py or in the generic files?, because if you fix in the generic files we have to change all applications prior to the version fix.
Could core check for "localhost" before serving generics so that people who are currently using them in development don't have to change anything?
I have a possible solution in trunk.It disables all generics but generic.html UNLESS you have response.allow_generic_views=True(this will close the vulnerability on upgrade on all existing apps)
The new scaffolding app opens this withresponse.allow_generic_views = request.is_local
Is this getting too complex?
You can do '*.html' or '*.json' but you can also do 'somecontroller/*.json' etc. Why not? Comes at no extra price.
Ok with the name change. I will wait a few hours in case there are other proposals. ;-)using regex.search causes problems. For example 'xml' would allow "somexmlaction.html". Currently * matches both / and . therefore we can already do '*' instead of '*/*.*'.
how about index.xhtml?