<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CFML Request Parameters</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: tony petruzzi</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-204295</link>
		<dc:creator>tony petruzzi</dc:creator>
		<pubDate>Thu, 04 Feb 2010 18:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-204295</guid>
		<description>your solution works unless the form is post as multipart. then you don&#039;t have access to getParameterValues(). i&#039;m dealing with this problem right now and if anyone has any suggestions, PLEASE post them here or at stackoverflow: http://stackoverflow.com/questions/2194442</description>
		<content:encoded><![CDATA[<p>your solution works unless the form is post as multipart. then you don't have access to getParameterValues(). i'm dealing with this problem right now and if anyone has any suggestions, PLEASE post them here or at stackoverflow: <a href="http://stackoverflow.com/questions/2194442" rel="nofollow">http://stackoverflow.com/questions/2194442</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183419</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Sat, 27 Jun 2009 17:01:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183419</guid>
		<description>Peter,

Nice!  That&#039;s the same way PHP does it, but I didn&#039;t know it worked on Railo as well.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Nice!  That's the same way PHP does it, but I didn't know it worked on Railo as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Boughton</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183398</link>
		<dc:creator>Peter Boughton</dc:creator>
		<pubDate>Sat, 27 Jun 2009 11:46:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183398</guid>
		<description>Barney, one way around this is Railo&#039;s url array notation.

This:
page.cfm?a[]=1&amp;a[]=2&amp;a[]=3,4

Is equivalent to:
a = Array( &#039;1&#039; , &#039;2&#039; , &#039;3,4&#039; )

Works for form variables also.


As well as capturing comma values safely, this can also be used to avoid manually building an array from sequentially named form fields.</description>
		<content:encoded><![CDATA[<p>Barney, one way around this is Railo's url array notation.</p>
<p>This:<br />
page.cfm?a[]=1&amp;a[]=2&amp;a[]=3,4</p>
<p>Is equivalent to:<br />
a = Array( '1' , '2' , '3,4' )</p>
<p>Works for form variables also.</p>
<p>As well as capturing comma values safely, this can also be used to avoid manually building an array from sequentially named form fields.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter J. Farrell</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183049</link>
		<dc:creator>Peter J. Farrell</dc:creator>
		<pubDate>Wed, 24 Jun 2009 16:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183049</guid>
		<description>@Barney, I see your point on &quot;damaged&quot; data.  There is a flip side in Django. Since you still don&#039;t know which parameter names have multiple data calling queryDict.getItem(&#039;a&#039;) will just return the last value and you&#039;d never know that there was multiple values. So the CFML argument is you don&#039;t know if one of the parameters has a comma in it and therefore the &quot;list&quot; is contaminated (or just don&#039;t don&#039;t use commas as values).  In Django, you don&#039;t know its a list unless you loop over every parameter using getList(&#039;a&#039;) and seeing if it is an Python list (akin to CFML array).</description>
		<content:encoded><![CDATA[<p>@Barney, I see your point on "damaged" data.  There is a flip side in Django. Since you still don't know which parameter names have multiple data calling queryDict.getItem('a') will just return the last value and you'd never know that there was multiple values. So the CFML argument is you don't know if one of the parameters has a comma in it and therefore the "list" is contaminated (or just don't don't use commas as values).  In Django, you don't know its a list unless you loop over every parameter using getList('a') and seeing if it is an Python list (akin to CFML array).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183047</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Wed, 24 Jun 2009 16:06:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183047</guid>
		<description>Peter,

My point was that with CFML&#039;s processing, you can&#039;t determine whether the example request had three instance of the &#039;a&#039; parameter (one of which contains a comma) or four instances of the &#039;a&#039; parameter, none of which contain commas.  Or for that matter, a single instance of &#039;a&#039; containing three commas.  With the request parameter method you CAN make that distinction.  ServletRequest&#039;s getParameter() and getParameterValues() correspond exactly to QueryDict&#039;s getItem() and getList().  

The point is that CFML&#039;s processing destroys information within the CFML environment.  You usually don&#039;t care about it, but still destroys info.  When it DOES matter you can still get back that information from the underlying Servlet container.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>My point was that with CFML's processing, you can't determine whether the example request had three instance of the 'a' parameter (one of which contains a comma) or four instances of the 'a' parameter, none of which contain commas.  Or for that matter, a single instance of 'a' containing three commas.  With the request parameter method you CAN make that distinction.  ServletRequest's getParameter() and getParameterValues() correspond exactly to QueryDict's getItem() and getList().  </p>
<p>The point is that CFML's processing destroys information within the CFML environment.  You usually don't care about it, but still destroys info.  When it DOES matter you can still get back that information from the underlying Servlet container.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Dean</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183040</link>
		<dc:creator>Jason Dean</dc:creator>
		<pubDate>Wed, 24 Jun 2009 14:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183040</guid>
		<description>@Rick,

But, for security sake, they should be treated equivalently. Their input should be equally untrusted. I don&#039;t see a reason to differentiate for functionality or for security.</description>
		<content:encoded><![CDATA[<p>@Rick,</p>
<p>But, for security sake, they should be treated equivalently. Their input should be equally untrusted. I don't see a reason to differentiate for functionality or for security.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick O</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183036</link>
		<dc:creator>Rick O</dc:creator>
		<pubDate>Wed, 24 Jun 2009 13:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183036</guid>
		<description>While you may be correctly handling GET/POST so that your apps are not vulnerable to cross-site attacks, there will almost certainly be readers of your blog that don&#039;t get that (yet).  To casually say that they should be treated as equivalent, without adding the appropriate caveat, is then dangerous.</description>
		<content:encoded><![CDATA[<p>While you may be correctly handling GET/POST so that your apps are not vulnerable to cross-site attacks, there will almost certainly be readers of your blog that don't get that (yet).  To casually say that they should be treated as equivalent, without adding the appropriate caveat, is then dangerous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter J. Farrell</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-183025</link>
		<dc:creator>Peter J. Farrell</dc:creator>
		<pubDate>Wed, 24 Jun 2009 11:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-183025</guid>
		<description>I think that the CFML engines are just being nice to you and convenience. Remember form and query string data is flat and simple values anyways.  Nothing wrong with using variables.a = ListToArray(url.a) if you want an array of parameter items in CFML.

For example in Django, you would get QueryDict object back for all parameters.  If &#039;a&#039; has multiple items in the query string as in your example, calling queryDict.getItem(&#039;a&#039;) returns only the *last* item (not all items).  So you still have to be smart enough to call queryDict.getList(&#039;a&#039;) to get all the items. (Side step: Lists in Python are like CFML arrays not a string list.)  And I wouldn&#039;t call getList() all the time to &quot;solve&quot; the issue because that method guarantees a list be returned and I wouldn&#039;t want to work with a list for each parameter.

You still have to think that the parameter has multiple values in Django and call the right methods otherwise you just get the last value in the items (which could be disastrous) .  The only difference is CFML gives you them all up front instead of having to deduce if you need to call getList() like in Django for all the items.  To me, six of one / half dozen of another.  Same result because you have to know if you should be expecting multiple items.</description>
		<content:encoded><![CDATA[<p>I think that the CFML engines are just being nice to you and convenience. Remember form and query string data is flat and simple values anyways.  Nothing wrong with using variables.a = ListToArray(url.a) if you want an array of parameter items in CFML.</p>
<p>For example in Django, you would get QueryDict object back for all parameters.  If 'a' has multiple items in the query string as in your example, calling queryDict.getItem('a') returns only the *last* item (not all items).  So you still have to be smart enough to call queryDict.getList('a') to get all the items. (Side step: Lists in Python are like CFML arrays not a string list.)  And I wouldn't call getList() all the time to "solve" the issue because that method guarantees a list be returned and I wouldn't want to work with a list for each parameter.</p>
<p>You still have to think that the parameter has multiple values in Django and call the right methods otherwise you just get the last value in the items (which could be disastrous) .  The only difference is CFML gives you them all up front instead of having to deduce if you need to call getList() like in Django for all the items.  To me, six of one / half dozen of another.  Same result because you have to know if you should be expecting multiple items.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-182992</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Wed, 24 Jun 2009 05:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-182992</guid>
		<description>Rick,

Can you provide a concrete example of why I&#039;d care?  Or more specifically, why I&#039;d ever want to treat them differently?  GET is certainly easier to maliciously request than POST, but that&#039;s a request method distinction, not a parameter source distinction.  I.e. I only allow POST for certain URLs, GET for certain other ones, and both for a third set.  But once I&#039;m inside a request, the parameters are just parameters.

For example, within an FB3Lite app where your form actions all start with &quot;do&quot;, stick this in the onRequestStart fuseaction:

&lt;pre&gt;
&lt;cfif left(attributes.originalFuseaction, 2) EQ &quot;do&quot; AND cgi.request_method NEQ &quot;POST&quot;&gt;
  &lt;cfthrow type=&quot;AccessDenied.InvalidRequestMethod&quot; /&gt;
&lt;/cfif&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Rick,</p>
<p>Can you provide a concrete example of why I'd care?  Or more specifically, why I'd ever want to treat them differently?  GET is certainly easier to maliciously request than POST, but that's a request method distinction, not a parameter source distinction.  I.e. I only allow POST for certain URLs, GET for certain other ones, and both for a third set.  But once I'm inside a request, the parameters are just parameters.</p>
<p>For example, within an FB3Lite app where your form actions all start with "do", stick this in the onRequestStart fuseaction:</p>
<pre>
&lt;cfif left(attributes.originalFuseaction, 2) EQ "do" AND cgi.request_method NEQ "POST"&gt;
  &lt;cfthrow type="AccessDenied.InvalidRequestMethod" /&gt;
&lt;/cfif&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick O</title>
		<link>https://www.barneyb.com/barneyblog/2009/06/23/cfml-request-parameters/comment-page-1/#comment-182991</link>
		<dc:creator>Rick O</dc:creator>
		<pubDate>Wed, 24 Jun 2009 05:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1008#comment-182991</guid>
		<description>Just to be obstinate, you may want to reconsider your point about GET/POST, and &quot;they&#039;re all just parameters&quot;.  It was an okay idea for a while, and it led to much cleaner code, but it also opens the door for XSS/XSRF/etc attacks.  More often than not these days, you do want to ensure that you&#039;re getting your parameters from the correct source/scope.</description>
		<content:encoded><![CDATA[<p>Just to be obstinate, you may want to reconsider your point about GET/POST, and "they're all just parameters".  It was an okay idea for a while, and it led to much cleaner code, but it also opens the door for XSS/XSRF/etc attacks.  More often than not these days, you do want to ensure that you're getting your parameters from the correct source/scope.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
