#  This script was written by David Maciejak <david dot maciejak at kyxar dot fr>
#  based on work from
#  (C) Tenable Network Security
#
# This script is released under the GNU GPLv2


if(description)
{
 script_id(14289);
 script_version ("$Revision: 7198 $");
 script_tag(name:"risk_factor", value:"Medium");
 script_xref(name:"OSVDB", value:"8646");
 name = "CVSTrac malformed URI infinite loop DoS";

 script_name(name);
 
 desc = "
The remote host seems to be running cvstrac, 
a web-based bug and patch-set tracking system for CVS.

This version contains a flaw related to the parameter parser 
that may allow an attacker to create a malformed URL, 
which causes the application to hang.  An attacker, exploiting
this flaw, would only need network access to the cvstrac server.
Upon sending a malformed link, the cvstrac server would go into
an infinite loop, rendering the services as unavailable.

***** OpenVAS has determined the vulnerability exists on the target
***** simply by looking at the version number(s) of CVSTrac
***** installed there. 


Solution : Update to version 1.1.4 or disable this CGI suite
Risk factor : Medium";


 script_description(desc);
 
 summary = "Checks for CVSTrac version";
 
 script_summary(summary);
 
 script_category(ACT_ATTACK);
 
 
 script_copyright("This script is Copyright (C) 2004 David Maciejak");
 family = "Web application abuses";
 script_family(family);
 script_dependencie("find_service.nes", "http_version.nasl");
 script_require_ports("Services/www", 80);
 exit(0);
}

#
# The script code starts here
#

include("http_func.inc");

port = get_http_port(default:80);
kb = get_kb_item("www/" + port + "/cvstrac" );
if ( ! kb ) exit(0);
stuff = eregmatch(pattern:"(.*) under (.*)", string:kb );
version = stuff[1]; 
if(ereg(pattern:"^(0\.|1\.(0|1\.[0-3]([^0-9]|$)))", string:version))
	security_warning(port);
