>> <cfparam name="attributes.join" default="left">
>> <cfquery name="getStuff" ...>
>>      select b.*, j.columns
>>      from basetable b
>>      #attributes.join# jointable j on (j.x = b.x)
>> </cfquery>
>>
>> I don't use this syntax because it's insecure... This is
>> simplified to

> Why is this insecure?  Does it have something to do with
> you using the
> attributes scope?  Sorry if it's a stupid question, but
> I'm really not
> sure why it is insecure and I figure it's a good thing to
> know ;)

Well... it might make more sense if I'd used #url.join# instead of
#attributes.join# in the example... So... I should qualify by saying
the above example may or may not be secure. :P But by itself this is
not secure if you simply pass a user-provided value into it as in:

<cf_querytag join="#url.join#">

Because then it would still allow a user to perform a sql injection
attack by using the join variable. The boolean value by contrast
doesn't allow this -- the page may produce an error if the user
provided a non-boolean value, but you would never be able to inject
sql into the query as long as the variable is validated and/or used as
a boolean value somewhere before the query is executed (preferably
when defining the tag arguments). There are of course other ways to
ensure that the value is valid for the particular context of the query
being executed, this is just one example.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210677
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to