使用 Windows 身份验证进行会话管理
在 ASP.NET Web 应用程序中,使用集成 Windows 身份验证,会话是否与 Windows 身份相关联?
换句话说,如果我登录(使用 IWA)该应用程序,并且该应用程序在我的会话中存储了一些“内容”,那么这些内容是否可以单独通过会话 ID 访问?例如,如果恶意者设法窃取了我的会话 ID,但没有窃取我的凭据,那么他可以访问我的会话内容吗?或者此会话是否只能由相同的身份访问,需要两者会话 ID 和 Windows 身份才能访问它?
In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity?
In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my session, is this stuff accessible by session id alone? For instance, if a malicious someone managed to steal my session id, but NOT my credentials, can he then access my session stuff? Or is this session accessible only to the same identity, requiring both the session id AND the windows identity to access it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很好的问题。在写这个答案之前,我刚刚进行了测试以确认。
如果我是“A 人”,而您是“B 人”,那么将会发生以下情况:
请注意,网站仍将人员 B 识别为“人员 B”,即使他们正在使用人员 A 的会话详细信息。因此,如果您有检查用户权限等的代码,那么这些检查仍然是在人员 B 的上下文中完成的。
这听起来可能是一个大问题,但只要程序员不粗心,问题就不是真的。例如,B 在我上面的测试中获得的唯一效果是他们继承了 A 设置的屏幕和网格布局,因为我们实时进行权限检查(即它们不被缓存)。如果您在会话中存储敏感数据,那么这可能是一个问题,但只有当显示这些数据的字段每次显示时都没有进行权限检查时,这才是问题。仅当 A 的会话尚未过期时,这才会成为问题。
Excellent question. I just ran a test to confirm before i wrote this answer.
If i am 'Person A', and you are 'Person B', then this is what has to happen:
Note that Person B is still recognised as 'Person B' by the website, even though they are using Person A's session details. So if you have code that checks user permissions etc, then those checks are still done in the context of Person B.
This might sound like a huge issue, but it isn't really as long as the programmers are not careless. For instance, the only effect that Person B got in my test above was that they inherited the screen and grid layouts that Person A had set up, because we do our permission checks live (i.e. they are not cached). If you store sensitive data in the session then it could be a problem, but it is only a problem if they fields showing it are not permission checked every single time they are shown. It's also only an issue if the session for Person A hasn't expired.