Question
cfqueryparam with PreserveSingleQuotes
Hi all,
Is the following query safe against SQL injection attacks?
<cfquery name="AddRequestParams" datasource="MyDb">
INSERT INTO MyTable (Field)
VALUES (<cfqueryparam value = "#PreserveSingleQuotes(URL.Value)#">)
</cfquery>
I've read in several places that you should avoid using PreserveSingleQuotes with cfqueryparam, but seen no examples of why this would be dangerous. [Yes, there's no data type or length validation; I removed these for clarity.]
Any help is greatly appreciated.
Dave
Is the following query safe against SQL injection attacks?
<cfquery name="AddRequestParams" datasource="MyDb">
INSERT INTO MyTable (Field)
VALUES (<cfqueryparam value = "#PreserveSingleQuotes(URL.Value)#">)
</cfquery>
I've read in several places that you should avoid using PreserveSingleQuotes with cfqueryparam, but seen no examples of why this would be dangerous. [Yes, there's no data type or length validation; I removed these for clarity.]
Any help is greatly appreciated.
Dave
