我可以忽略子目录中的 application.cfc 并仅使用根目录中的 application.cfc
众所周知,ColdFusion 将在目录树中从子目录到父目录查找 application.cfc 文件。
这允许“锁定”所有 cfm 文件,除非首先找到的 application.cfc 文件允许处理这些文件。
有没有办法告诉 ColdFusion 不要停在子目录并始终转到根目录?
原因是这种情况通过简单地在文件结构中的某处创建目录并添加 application.cfc 文件而产生“后门”安全问题。
服务器永远不会到达正确的application.cfc,因此永远不会正确设置安全性。
It is pretty publicized that an ColdFusion will look up the directory tree from child to parent directories for an application.cfc file.
This allows all cfm files to be "Locked" unless the application.cfc file that is first found allows the processing of the files.
Is there a way to tell ColdFusion to NOT stop at a sub directory and ALWAYS go to the root?
The reason being is that this situation creates a "Back Door" security problem by simply creating a directory somewhere in the file structure and adding an application.cfc file.
The server would never get to the proper application.cfc and thus the security would never be set properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,没有办法告诉 ColdFusion 始终在根目录使用 application.cfc。
请小心保护您的网络服务器,上传到网络根目录之外,应该没问题。
no, there is no way to tell ColdFusion to ALWAYS use application.cfc at the root.
Please secure your web server carefully, upload to outside of webroot, and you should be fine.
正如 Henry 所说,目前您无法使用 CF 来做到这一点。然而,这个确切的功能是 Railo 支持的方便的额外功能之一。
您可以更改默认行为,使其仅直接在当前目录中查找,或仅直接在根目录中查找。
(来源:hybridchill.com)
当然,这是一项性能功能,而不是安全功能 - 您不应该允许任何不受信任的来源创建恶意应用程序文件!
As Henry says, you can't currently do this with CF. However, this exact feature is one of the handy extra features which Railo supports.
You can change the default behaviour so it looks in current directly only, or root directly only.
(source: hybridchill.com)
Of course, this is a performance feature, not a security one - you shouldn't be allowing any untrusted source to create rogue Application files!
不过,您可以在 ColdFusion 9 中执行此操作。 ColdFusion 9 将允许您指定搜索 Application.cfc 文件的位置,就像 Railo 一样。
You will be able to do this in ColdFusion 9 though. ColdFusion 9 will allow you to specify the where to search for Application.cfc files, just like Railo.