As we already know that the URL and FORM scope variables can be modified using external proxy tools.
For example if someone makes a request like this - http:\\website\index.cfm?a=1&b=2
This way one can add values to URL scope of a .cfm
page.
Similarly is there any way to add/alter value to request scope in ColdFusion without it being set in code explicitly.
I am asking this because we have a code like this in one of CFM page.
<cfset request.uploadFileDir = application.fileDir & "\upload" />
<cffile action="upload" accept="application/pdf" destination="#REQUEST.uploadFileDir#" filefield="brochure" nameconflict="makeunique"/>
The security team is saying that the above code is vulnerable because REQUEST
scope in JAVA can be tampered/altered by external proxy tools. And since ColdFusion is build on JAVA, ColdFusion's REQUEST
can also be tampered by external proxy tools. Is this a right assumption? Is JAVA and ColdFusion REQUEST
scope same?
And finally the main question - Is there any way an external request to the page mentioned above in the example, modify the REQUEST
scope or to be more precise REQUEST.uploadFileDir
variable?
request
do they say can be tampered with? With jsp/servlets, I get the impression there's two parts of therequest
scope: get/setParameter() and get/SetAttribute(). The "parameters" are more like the URL scope, and like you said, can be modified. Whereas "attributes" are local server variables and can't be modified AFAIK. https://mcmap.net/q/98230/-difference-between-getattribute-and-getparameter – MoriahREQUEST.uploadFileDir
receives it's value. – Emsmusapplication.fileDir
doesn't use client supplied values (like hard coded string, etc...) it's safe. – MoriahREQUEST.uploadFileDir
is not using any URL or FORM scope variables for setting it's value. Only application scope is being used to set it. So it cannot be modified by any proxy tool or request to the page. You can post it as answer. – Tinfoilrequest.get/setAttributes()
and can't be modified outside the server (other than indirectly as Dan mentioned later). CF's URL/FORM is like request.get/setParameters. You can also run some tests to see the behavior yourself using a JSP page: helpx.adobe.com/coldfusion/developing-applications/ – Moriah