gpt4 book ai didi

asp.net - 用户对 Temporary ASP.NET Files 文件夹的写入权限是否会造成任何安全问题?

转载 作者:行者123 更新时间:2023-12-03 17:21:35 24 4
gpt4 key购买 nike

由于对 Temporary ASP.NET Files 文件夹的权限不足,我遇到了程序集绑定(bind)失败。

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

根据ASP.NET Identity Matrix ,这意味着 WindowsIdentity 解析为 Domain\UserName 并根据 ASP.NET Required Access Control Lists (ACLs) ,WindowsIdentity 需要对 Temporary ASP.NET Files 文件夹的读/写权限。

使用 Fusion 日志查看器,我可以确认程序集绑定(bind)失败是由于 Domain\UserName(属于安全中的“用户”组)只有对该文件夹的读取权限,但没有写入权限。

问题是:

将写入权限分配给 Temporary ASP.Net Files 文件夹是否存在任何安全隐患?

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

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

最佳答案

ASP.NET 需要对临时 ASP.NET 文件夹的写入权限,如果您只授予对该文件夹的权限而不是更高权限,因为它位于 c:\windows 文件夹中,这不应该是安全风险。
这个MSDN article about securing ASP.NET applications建议将临时编译目录的完全控制权授予 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.

关于asp.net - 用户对 Temporary ASP.NET Files 文件夹的写入权限是否会造成任何安全问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1096400/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com