Preventing ViewCode.asp from Viewing Known Server FilesID: Q231656
|
Default installations of Microsoft Site Server include ViewCode.asp, a tool provided so that users can view files in the sample sites. However, a Web visitor can also view any file on the server whose Access Control List (ACL) allows access by Web visitors and whose name the visitor knows or guesses.
Please note, however, that the Web visitor cannot change, delete, or add any files.
The ViewCode.asp tool does not restrict which files a visitor to a Web site can view.
Remove all copies of ViewCode.asp from the production server, or set the ACLs for them so that only the appropriate users can use them.
NOTE: Per normal security practices, the ACLs on the server should always be set to enable Web visitors to view only the files they need anyway, and to deny access to all others.
A supported fix that corrects this problem is now available from Microsoft, but
it has not been fully regression tested and should be applied only to systems
experiencing this specific problem. If you are not severely affected by this
specific problem, Microsoft recommends that you wait for the next Site Server service pack
that contains this fix.
To resolve this problem immediately, contact Microsoft Product Support Services
to obtain the fix. For a complete list of Microsoft Product Support Services
phone numbers and information on support costs, please go to the following
address on the World Wide Web:
http://support.microsoft.com/support/supportnet/default.aspThe English version of this fix should have the following file attributes or later:
Date Time Size File name Platform
-------------------------------------------------------------
05/06/99 11:56a 29,088 Common_viewcode.asp (x86)
07/02/98 12:27p 913 Eula.txt (x86)
05/06/99 11:37a 22,636 PubSys_viewcode.asp (x86)
01/27/99 11:02a 62,544 Update.exe (x86)
05/06/99 01:42p 7,166 Update.inf (x86)
05/06/99 11:56a 29,088 Common_viewcode.asp (alpha)
07/02/98 12:27p 913 Eula.txt (alpha)
05/06/99 11:37a 22,636 PubSys_viewcode.asp (alpha)
01/27/99 11:56a 80,144 Update.exe (alpha)
05/06/99 01:42p 7,166 Update.inf (alpha)
This hotfix has been posted to the following Internet location as Viewfixi.exe (x86):ftp://ftp.microsoft.com/bussys/sitesrv/sitesrv-public/fixes/usa/siteserver3/hotfixes-postsp2/Viewcode-fix/NOTE: A version for Alpha platforms will be available shortly.
Q154871 Determining If You Are Eligible for No-Charge Technical Support
Microsoft has confirmed this to be a problem in Site Server 3.0.
Microsoft highly recommends that customers evaluate the degree of risk that this vulnerability poses to their systems and determine whether to download and install the fix.
This fix corrects the vulnerability by restricting ViewCode.asp to viewing only files in the current directory. However, Web site operators who do not have a need to provide the file viewing capability may choose to remove all copies ViewCode.asp from the server altogether.
'Limit function to .asp and .vbo files in current and child directories
If instr(1, strVirtualPath, "..", 1) <> 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
ElseIf instr(1, strVirtualPath, ".asp", 1) = 0 And instr(1, strVirtualPath, ".vbo", 1) = 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
ElseIf Left( strVirtualPath, 1) = "/" or Left( strVirtualPath, 1) = "\" Then
If instr(1, strVirtualPath, "/siteserver/publishing", 1) = 0 And instr(1, strVirtualPath, "/sites/knowledge/membership", 1) = 0 And instr(1, strVirtualPath, "/sites/samples/knowledge", 1) = 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
End If
End If
For the Publishing sample sites, a slightly different modification is required (these lines of code may wrap):
'Limit function to .asp, .vbo, .inc, .txt, and .prf files in current, cmsample, fpsample, and child directories
If instr(1, strVirtualPath, "..", 1) <> 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
ElseIf instr(1, strVirtualPath, ".asp", 1) = 0 And instr(1, strVirtualPath, ".vbo", 1) = 0 And instr(1, strVirtualPath, ".inc", 1) = 0 And instr(1, strVirtualPath, ".txt", 1) = 0 And instr(1, strVirtualPath, ".prf", 1) = 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
ElseIf Left( strVirtualPath, 1) = "/" or Left( strVirtualPath, 1) = "\" Then
If instr(1, strVirtualPath, "/siteserver/publishing", 1) = 0 And instr(1, strVirtualPath, "/cmsample", 1) = 0 And instr(1, strVirtualPath, "/fpsample", 1) = 0 Then
Response.Write("<HR> The path to the requested file cannot be mapped.<HR>")
fFileError = TRUE
End If
End If
Additional query words: patch hotfix hot fix qfe default setup set up viewcode utility hacker breach read see source
Keywords :
Version : winnt:3.0
Platform : winnt
Issue type : kbbug
Last Reviewed: May 19, 1999