Vulnerabilities > CVE-2004-1746 - Cross-Site Scripting vulnerability in PHP Code Snippet Library PHP Code Snippet Library 0.8

047910
CVSS 4.3 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
PARTIAL
Availability impact
NONE
network
php-code-snippet-library
nessus
exploit available

Summary

Cross-site scripting (XSS) vulnerability in index.php in PHP Code Snippet Library allows remote attackers to inject arbitrary web script or HTML via the (1) cat_select or (2) show parameters.

Vulnerable Configurations

Part Description Count
Application
Php_Code_Snippet_Library
1

Exploit-Db

descriptionPHP Code Snippet Library 0.8 Multiple Cross-Site Scripting Vulnerabilities. CVE-2004-1746. Webapps exploit for php platform
idEDB-ID:24410
last seen2016-02-02
modified2004-08-24
published2004-08-24
reporterNikyt0x Argentina
sourcehttps://www.exploit-db.com/download/24410/
titlePHP Code Snippet Library 0.8 - Multiple Cross-Site Scripting Vulnerabilities

Nessus

NASL familyCGI abuses : XSS
NASL idPHPCSL_XSS.NASL
descriptionThe remote host is running PHP Code Snippet Library (PHP-CSL), a library written in PHP. The remote version of this software fails to sanitize input to the
last seen2020-06-01
modified2020-06-02
plugin id14368
published2004-08-25
reporterThis script is Copyright (C) 2004-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/14368
titlePHP Code Snippet Library index.php Multiple Parameter XSS
code
#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");

if(description)
{
 script_id(14368);
 script_version("1.21");
 script_cve_id("CVE-2004-1746");
 script_bugtraq_id(11038);
 
 script_name(english:"PHP Code Snippet Library index.php Multiple Parameter XSS");

 script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script affected by a cross-site
scripting vulnerability." );
 script_set_attribute(attribute:"description", value:
"The remote host is running PHP Code Snippet Library (PHP-CSL), a
library written in PHP. 

The remote version of this software fails to sanitize input to the
'cat_select' parameter of the 'index.php' script.  This can be used to
take advantage of the trust between a client and server allowing the
malicious user to execute malicious JavaScript on the client's
machine." );
 script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2004/Aug/338" );
 script_set_attribute(attribute:"solution", value:
"Upgrade to PHP-CSL version 0.9.1 or later as that is rumored to
address the issue." );
 script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:P/A:N");
 script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
 script_set_attribute(attribute:"exploit_available", value:"false");
 script_cwe_id(20, 74, 79, 442, 629, 711, 712, 722, 725, 750, 751, 800, 801, 809, 811, 864, 900, 928, 931, 990);

 script_set_attribute(attribute:"plugin_publication_date", value: "2004/08/25");
 script_set_attribute(attribute:"vuln_publication_date", value: "2004/08/24");
 script_cvs_date("Date: 2018/11/15 20:50:20");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe",value:"cpe:/a:php_code_snippet_library:php_code_snippet_library");
 script_end_attributes();

 
 script_summary(english:"Checks for the presence of an XSS bug in PHP-CSL");
 script_category(ACT_GATHER_INFO);
 script_copyright(english:"This script is Copyright (C) 2004-2018 Tenable Network Security, Inc.");
 script_family(english:"CGI abuses : XSS");
 script_dependencie("cross_site_scripting.nasl", "http_version.nasl");
 script_require_ports("Services/www", 80);
 script_exclude_keys("Settings/disable_cgi_scanning");
 script_require_keys("www/PHP");
 exit(0);
}

#
# The script code starts here
#

include("global_settings.inc");
include("misc_func.inc");
include("http.inc");

global_var	port;

port = get_http_port(default:80, php: 1, no_xss: 1);

function check(loc)
{
 local_var r, w;

 w = http_send_recv3(method:"GET", item:string(loc, "/index.php?cat_select=<script>foo</script>"), port:port, exit_on_fail: 1);
 r = w[2];
 
 if('<script>foo</script>' >< r && "PHP-CSL" >< r)
 {
 	security_warning(port:port, extra:'\nThe following URL is vulnerable :\n' + loc + "/index.php?cat_select=<script>foo</script>");
	set_kb_item(name: 'www/'+port+'/XSS', value: TRUE);
	exit(0);
 }
}

foreach dir (cgi_dirs())
{
 check(loc:dir);
}