国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

Security Hole In ASP.NET Beta 1 (from angryCoder)

2024-07-10 12:58:19
字體:
來源:轉載
供稿:網友
security hole in asp.net beta 1
jonathan goodyear, mcsd, mcp, cls
4/30/2001

background
in the beta 1 version of the .net framework, configuration settings for asp.net web applications are kept in an xml formatted file named config.web. there is one config.web file at the machine level, with the option of having copies with overriding settings in any directory of your web application. settings in a config.web file cascade to all sub-directories in your web application, unless overridden by another config.web file.

for beta 2, microsoft changed things around. asp.net settings at the machine level will now live in a file named computer.config, while settings at the web application level will be contained in files named web.config. microsoft is encouraging the use of the ".config" file extension for xml based configuration files; even those that are custom built. some examples of this are the portal.config file used in the ibuyspy portal application, and the ezine_settings.config file used in the ezine.framework upon which the angrycoder site is built.

the hole
the security hole comes into play due to the fact that the new naming convention for xml based configuration files didn't come about until after beta 1 was released. this means that the default asp.net settings allow files with the ".config" extension to be browsed as clear text. i was made aware of this situation when an angrycoder reader (luckily an honest one) emailed me my user name and password that he had obtained by navigating to my ezine_settings.config with his browser. one of the disadvantages of giving away the source code for the ezine.framework is that aspiring hackers have a convenient roadmap of my entire site. it gave me a rather unsettling feeling in my gut to find out that i had been careless enough to leave my site so exposed.

the fix
there are two bright spots to this security hole. first, it is limited to beta 1 because files with the ".config" extension will be guarded by default in beta 2. second, there are two different, yet equally easy, fixes for the hole that you can implement right now.

the first fix option is the one that the ibuyspy portal application implemented. they placed their portal.config file in a directory that the anonymous user account does not have "read" privileges for. using this method, their business logic components can still import and use the xml settings in the file, while keeping it from the prying eyes of hackers.

the second fix option is the one that i implemented for angrycoder. the first step is to open up the internet services manager mmc snap-in and configure files with the ".config" extension to be handled by the asp.net isapi application. you do this by right-clicking your web application, and choosing the "properties" menu option. then, select the "home directory" tab, and click the "configuration button". the "app mappings" tab of the application configuration screen should now be showing. click the "add" button. on the dialogue that pops up, browse to the c:/winnt/microsoft .net/framework/v1.0.2204/ directory and select the xspisapi.dll file (hint: you'll probably have to click the "files of type" drop-down and select "dynamic link libraries" to make the file browsable). after you've selected the xspisapi.dll file, enter ".config" in the "extension" box, then click the "ok" button. click the "ok" button again at the application configuration screen, and again at the web application properties screen.

now that you've told iis that the asp.net isapi application should handle files with the ".config" file extension, the next step is to tell your web application what, specifically, to do when a user browses to one of these files. this entails adding a setting to your config.web file:
<configuration>
  <httphandlers>
    <add verb="*" path="*.config" type="system.web.httpnotfoundhandler" />
  </httphandlers>
</configuration>

what this does is tell the asp.net engine to invoke the system.web.httpnotfoundhandler httphandler when a file with the ".config" file extension is browsed. this displays a message to the person browsing for the file that it could not be located.

the rub
if you are going to follow microsoft's naming convention for xml configuration files using beta 1 of the .net framework, take the proper steps to prevent exposing your web application's private settings to the world by implementing one of the two fixes outlined above. in beta 2, this will all be handled for you by default. my name is jonathan goodyear, and i am the angrycoder.

have you found any security holes in beta 1 of the .net framework? are there any security issues that you would like to see fixed by the time version 1 of the .net framework is released? share your experiences and voice your opinions by clicking the "post your comments" link below, or talk it over with others in either the angrycoder forums (which can be found in the menu bar to your left), or the angrycoder listserv. 
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 鸡东县| 璧山县| 宁津县| 札达县| 台江县| 南部县| 巧家县| 桐乡市| 张家港市| 武城县| 垦利县| 兴业县| 岱山县| 辽阳市| 鞍山市| 河西区| 台中县| 青州市| 河津市| 天祝| 什邡市| 乐山市| 葫芦岛市| 平武县| 宝坻区| 宣威市| 扎赉特旗| 湘潭县| 夏河县| 商丘市| 西乌珠穆沁旗| 舟山市| 新竹市| 康定县| 周至县| 加查县| 郯城县| 天长市| 丹棱县| 海南省| 灵璧县|