John Lam 1997 — 2026

Obscure ASP security hole

While reading the IIS 6.0 Resource Kit today (no I don’t actually read resource kits for fun, but we should all do it more often), I came across this following security nugget for folks who are still writing ASP code: Global.asa events are run under different security contexts - and not the ones that you would necessarily expect!

Application_OnStart() and Session_OnStart() run under the security context of the impersonated user. However, the Application_OnEnd() and Session_OnEnd() events run using the process identity. Now, if you are running your IIS application under Low isolation then those two events are running as SYSTEM. If you are an ISP that lets folks upload global.asa files, then those folks could conceivably use the FileSystemObject to access arbitrary files (including other web application files) with impunity. Ooops.

PS This is fixed in IIS 6.0 - where these events now run as Anonymous User.

Shop at Amazon.com

2 archived reader comments

**** (2004-08-12)

ryty

**** (2004-12-01)

Please check some relevant pages about- Tons of interesdting stuff!!!