views:

179

answers:

1

I've found this technique to be interesting to short some coding time. Not having to re-create database related statements along with a form binder for webcontrols is indeed interesting in my opinion. But I was wondering if it should be considered a major security risk for non intranet projects because it shows the database structure to the users

http://www.ironpythonresource.com/post/2008/08/23/IronPython-Dynamically-creating-objects-and-binding-them-to-a-form.aspx

Now I know this question might not have an unique purely objetive answer, but I hope tagging it as subjetive and making it comunity wiki it's enough for it to remain open and getting some technical considerations about it

+2  A: 

That way of determining the data fields to change from the form data can definitely be a security risk.

Say that I have a User table that has an IsAdmin field to determine who has full access to the application. In the form where a user can edit their own information the IsAdmin field is of course not included, but by simply editing the page before posting it (using for example FireBug), they can easily add a form field with that name what will automatically populate the property in the object. All they need to know (or guess) is what to name the field and what to put in it. Voila, we have another admin!

Guffa
If you have that particular security weakness, obscuring the name of your controls probably isn't going to save you.
quillbreaker
It is, indeed, very interesting what he pointed out. Still, you could take note of that, and using the technique in other situations where access privilegies and missing fields in the form are not included
Pablo
well, if you did an injection into the request (which is easy) but there was no ASP.NET control, I don't think it would be pulled into the page space, so to speak.
quillbreaker
BTW, you can modify these classes to take an optional list parameter, which contains fields you dont want to be binded from the screen. You could avoid that way the problem with the isadmin field by passing it as parameter when you create the dbobject and telling the formbinder not to take that kind of fields into account when binding by checking the fields in the "forbidden" list of the dbobject
Pablo