I'm not ColdFusion developer but this has something put on my head to fix within week.
Problem: our legacy app creates view by empid
and use logged user id to select records from view.
<cfset empid= session.emp_id>
Then this variable is used in cfquery
as
Select columns from sometext_#empid#
This has been flagged by Veracode for SQL injection and it's being done in lots of pages so manual code change in all queries is little impossible.
I changed #empid#
with cfqueryparam
and it's not flagged by Veracode anymore but I read it's not what cfqueryparam
is meant for and I'm worried it might break
Tried to find solution but could not find anything close to my problem. Is there any way to validate SQL injection at cfset
tag itself and hope Veracode understand not to flag this variable or what would be the proper way to fix this?