用户对Temporary ASP.NET Files文件夹的写权限是否引起任何安全问题?

Does user write permissions to the Temporary ASP.NET Files folder pose any security problems?

由于对"临时ASP.NET文件"文件夹的权限不足,我遇到程序集绑定失败。

该应用程序使用(web.config)具有Impersonate = True和IIS Windows集成身份验证的表单身份验证。

根据ASP.NET Identity Matrix,这意味着WindowsIdentity解析为Domain \ UserName,并且根据ASP.NET必需的访问控制列表(ACL),WindowsIdentity需要对Temporary ASP.NET Files文件夹的读/写权限。

使用Fusion日志查看器,我可以确认程序集绑定失败是由于Domain \ UserName(属于安全性中的" Users"组)仅具有对此文件夹的读取权限,而没有写权限。

问题是:

将写权限分配给"临时ASP.Net文件"文件夹有任何安全隐患吗?

是否经常使用这种服务器配置更改?如果不是,对于这种web.config设置组合,为什么WindowsIdentity解析为Domain \ UserName?或者在这种情况下不应该使用此组合?

注意:仅当非管理员用户第一个访问该页面时,才会出现此问题。如果由于管理员用户点击该程序集而将该程序集已经编译并存储在Temporary ASP.NET Files中,则后续用户没有任何问题。我不希望将程序集放置在GAC中。


ASP.NET要求对Temporary ASP.NET文件文件夹具有写权限,如果您只授予对该文件夹的权限,而不授予它在c:\ windows文件夹中的权限,那么这不会带来安全风险。

有关保护ASP.NET应用程序安全的MSDN文章建议将对临时编译目录的完全控制权授予ASP.NET进程标识。 我引用了相关部分:

By default, temporary files are created and compiled in the following directory:

%winnt%\\Microsoft.NET\\Framework{version}\\Temporary ASP.NET Files

You can specify the location on a per application basis using the tempDirectory attribute, although this provides no security benefit.

Note The ASP.NET process identity specified on the element requires Full Control access rights on the temporary compilation directory.