Vulnerabilities > CVE-2004-1423 - Code Injection vulnerability in PHP-Calendar

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
php-calendar
CWE-94
nessus
exploit available

Summary

Multiple PHP remote file inclusion vulnerabilities in Sean Proctor PHP-Calendar before 0.10.1, as used in Commonwealth of Massachusetts Virtual Law Office (VLO) and other products, allow remote attackers to execute arbitrary PHP code via a URL in the phpc_root_path parameter to (1) includes/calendar.php or (2) includes/setup.php.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Exploit-Db

  • descriptionPHP-Calendar < 0.10.1 - Arbitrary File Inclusion. CVE-2004-1423. Webapps exploit for PHP platform
    idEDB-ID:43819
    last seen2018-01-24
    modified2014-12-29
    published2014-12-29
    reporterExploit-DB
    sourcehttps://www.exploit-db.com/download/43819/
    titlePHP-Calendar < 0.10.1 - Arbitrary File Inclusion
  • idEDB-ID:2608

Nessus

NASL familyCGI abuses
NASL idPHPCALENDAR_FILE_INCLUDE.NASL
descriptionThe remote web server is running PHP-Calendar, a web-based calendar written in PHP. The remote version of this software is vulnerable to a file inclusion flaw that could allow an attacker to execute arbitrary PHP commands on the remote host.
last seen2020-06-01
modified2020-06-02
plugin id16071
published2004-12-29
reporterThis script is Copyright (C) 2004-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/16071
titlePHP-Calendar Multiple Script phpc_root_path Parameter Remote File Inclusion
code
#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");

if (description)
{
  script_id(16071);
  script_version ("1.23");

  script_cve_id("CVE-2004-1423");
  script_bugtraq_id(12127, 20657);

  script_name(english:"PHP-Calendar Multiple Script phpc_root_path Parameter Remote File Inclusion");
  script_summary(english:"Determines if PHP-Calendar can include third-party files");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script that is affected by a
remote file include vulnerability." );
  script_set_attribute(attribute:"description", value:
"The remote web server is running PHP-Calendar, a web-based calendar
written in PHP. 

The remote version of this software is vulnerable to a file inclusion
flaw that could allow an attacker to execute arbitrary PHP commands on
the remote host." );
  # http://web.archive.org/web/20061010145640/http://www.gulftech.org/?node=research&article_id=00060-12292004
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f3abcef5" );
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2004/Dec/436" );
  # http://sourceforge.net/project/shownotes.php?release_id=296020&group_id=46800
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?62470ca6" );
  script_set_attribute(attribute:"solution", value:"Upgrade to PHP-Calendar version 0.10.1 or later." );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2004-1423");
  script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
  script_set_attribute(attribute:"exploit_available", value:"false");

  script_set_attribute(attribute:"plugin_publication_date", value: "2004/12/29");
  script_set_attribute(attribute:"vuln_publication_date", value: "2004/12/29");
  script_cvs_date("Date: 2019/06/03 10:01:42");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe",value:"cpe:/a:php-calendar:php-calendar");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");
  script_copyright(english:"This script is Copyright (C) 2004-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("http_version.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);
  script_require_keys("www/PHP");
  exit(0);
}

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

port = get_http_port(default:80);
if(!can_host_php(port:port))exit(0);

foreach d (cgi_dirs())
{
 url = string(d, "/includes/calendar.php?phpc_root_path=http://example.com/");
 r = http_send_recv3(method:"GET", item:url, port:port);
 if (isnull(r)) exit(0);
 buf = r[2];
 if ( "http://example.com/includes/html.php" >< buf )
 {
  security_hole(port);
  exit(0);
 }
}