I have a ColdFusion application in which I want to restrict access to certain pages based on some criteria. I am currently doing it like this: Application.cfc:
<cffunction name="OnRequestStart" access="public" returntype="boolean" output="true">
<cfargument name="TargetPage" type="string" required="true" />
<cfif not SESSION.isAdmin and REFindNoCase("/admin",ARGUMENTS.TargetPage) >
<cfinclude template="/notauth.cfm">
<cfreturn false />
</cfif>
<cfreturn true />
</cffunction>
My main problem: how vulnerable is the general approach of TargetPage validation to regular expressions and are there ways to improve the security of this design? In particular, I am interested in avoiding "canonical representation vulnerabilities." See here .
For example, using only REFind instead of REFindNoCase will allow people to go down directly if they go to "/ ADMIN /". Are there any other things to keep track of this?
, , , Application.cfc . . , , , , , - . .