Re:The most copied StackOverflow snippet of all time is flawed
by noduerme on Thursday September 28, 2023 @02:57AM
(#37686255)
Idk. I have some pieces of production code that need to inject `$tableIdentifier`.`$field` into a query, where both are nominally passed from the client. I don't rely strictly on a list of constants in those cases. I take the user request, check the table name against a constant list, then run a query (every time) to describe the fields in that table and type-check them against what's in the user-submitted variables. Then escape them. Anything mismatched in name or shape at any stage of that is considered malicious.
[ Parent
| on HN ]
There are no comments on this comment yet.