Assuming ColdFusion 10,0,13,287689 and Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production.
With this example...
<cfquery name="q" datasource="ds">
update someTable set
#form.col#label = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.x#">
where id = <cfqueryparam cfsqltype="cf_sql_decimal" value="#form.id#">
</cfquery>
Also assuming there is no data validation checking on #form.col#
, how could this be exploited? Obviously they could cause the query to fail with an invalid column, but I don't see any way something more malicious (another UPDATE, SELECT, or DELETE) could be ran by the user since multiple statements cannot be ran in a single <cfquery>
. So something like this does not work...
#form.col#
:
id = 1; delete from users; --comment everything else out...
I'm aware that with SELECTs it's easier to exploit using unions to get data you're not authorized to see, but I'm curious about this specific update statement.
So is it possible in this example for an end user to run additional SELECTs, UPDATEs, or DELETEs?
Thanks for the answers so far but so we are clear, I'm not asking for how to protect the code or for best practices. I just want to know how to exploit that code if it were present for demonstrative purposes. I have been unsuccessful at exploiting it with Oracle.