Bugtraq mailing list archives
Re: Vulnerability in Glimpse HTTP
From: jct () EDELWEB FR (Jean-Christophe Touvet)
Date: Thu, 3 Jul 1997 12:17:43 +0200
As the poster pointed out, the "open(..." line below is the problem. If we simply look for shell metacharacters and exit if we find any, the security problem is abated. Here's the code I used to do this. Insert this code directly above the open line below. In fact, the code goes exactly where I have it placed in this message. if($indexdir =~ tr/;<>*|`&$!#()[]{}:'"//) { print "<H1>Evil characters found! Exiting.</H1>"; exit(1); }
There is at least one very dangerous shell metacharacter missing in this list. As said in the tutorial where you found this code fragment, the security policy should be "that which is not expressly permitted is forbidden". It's much safer to use the "complement" of a set of allowed chars, for example: $indexdir =~ tr/a-zA-Z0-9//cd; or if ($indexdir =~ /[^a-zA-Z0-9]/) { print "<H1>Evil characters found! Exiting.</H1>"; die "Warning ",$ENV{REMOTE_HOST},": $indexdir\n"; }
open(CONF,"$indexdir/archive.cfg") || &err_conf; --end--I had seen this tr "test" before and went looking for it. I found it in a pretty good tutorial on cgi security. You can read it at: http://www.go2net.com/people/paulp/cgi-security/safe-cgi.txt
Maybe the author should be notified about this error. Cheers, -JCT-
Current thread:
- Vulnerability in Glimpse HTTP Razvan Dragomirescu (Jul 02)
- Re: Vulnerability in Glimpse HTTP Brian Gentry (Jul 02)
- Re: Vulnerability in Glimpse HTTP Jean-Christophe Touvet (Jul 03)
- Re: Vulnerability in Glimpse HTTP Paul Phillips (Jul 08)
- Re: Vulnerability in Glimpse HTTP Oliver Friedrichs (Jul 09)
- CERT Vendor-Initiated Bulletin VB-97.05 - Vul in Lynx Temporary Nicolas Dubee (Jan 01)
- Re: Vulnerability in Glimpse HTTP Martin Pool (Jul 10)
- It's not over yet. Aleph One (Jul 11)
- It's not over yet. Manley, Jim W (Jul 11)
- More information about JavaScript bug Dominick Matthias PN OIL 6 (Jul 11)
- new post SP3 hotfix: lm-fix Alex Libenson (Jul 12)
- Minor PGP vulnerability Harald Weidner (Jul 15)
- GetAdmin - Hotfix silent release ? Olivier Gerschel (Jul 16)
- Re: Vulnerability in Glimpse HTTP Brian Gentry (Jul 02)