Vulnerabilities > CVE-2007-3504 - Path Traversal vulnerability in SUN Jdk, JRE and SDK

047910
CVSS 9.3 - CRITICAL
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
microsoft
sun
CWE-22
critical
nessus

Summary

Directory traversal vulnerability in the PersistenceService in Sun Java Web Start in JDK and JRE 5.0 Update 11 and earlier, and Java Web Start in SDK and JRE 1.4.2_13 and earlier, for Windows allows remote attackers to perform unauthorized actions via an application that grants file overwrite privileges to itself. NOTE: this can be leveraged to execute arbitrary code by overwriting a .java.policy file.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Relative Path Traversal
    An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
  • Directory Traversal
    An attacker with access to file system resources, either directly or via application logic, will use various file path specification or navigation mechanisms such as ".." in path strings and absolute paths to extend their range of access to inappropriate areas of the file system. The attacker attempts to either explore the file system for recon purposes or access directories and files that are intended to be restricted from their access. Exploring the file system can be achieved through constructing paths presented to directory listing programs, such as "ls" and 'dir', or through specially crafted programs that attempt to explore the file system. The attacker engaging in this type of activity is searching for information that can be used later in a more exploitive attack. Access to restricted directories or files can be achieved through modification of path references utilized by system applications.
  • File System Function Injection, Content Based
    An attack of this type exploits the host's trust in executing remote content including binary files. The files are poisoned with a malicious payload (targeting the file systems accessible by the target software) by the attacker and may be passed through standard channels such as via email, and standard web content like PDF and multimedia files. The attacker exploits known vulnerabilities or handling routines in the target processes. Vulnerabilities of this type have been found in a wide variety of commercial applications from Microsoft Office to Adobe Acrobat and Apple Safari web browser. When the attacker knows the standard handling routines and can identify vulnerabilities and entry points they can be exploited by otherwise seemingly normal content. Once the attack is executed, the attackers' program can access relative directories such as C:\Program Files or other standard system directories to launch further attacks. In a worst case scenario, these programs are combined with other propagation logic and work as a virus.
  • Using Slashes and URL Encoding Combined to Bypass Validation Logic
    This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL. An URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
  • Manipulating Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

Nessus

  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_JAVA_REL6.NASL
    descriptionThe remote Mac OS X 10.4 host is running a version of Java for Mac OS X that is older than release 6. The remote version of this software contains several security vulnerabilities that may allow a rogue Java applet to escalate its privileges and to add or remove arbitrary items from the user
    last seen2019-10-28
    modified2007-12-17
    plugin id29702
    published2007-12-17
    reporterThis script is Copyright (C) 2007-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/29702
    titleMac OS X : Java for Mac OS X 10.4 Release 6
    code
    #TRUSTED 4b9c0ad1a24c4115f7b7fff011d8e3264a484e45f31eb2f1e6c2ad4f1f2501d5974dc3e96b6a810cf6e83813c36e309d909fe1075f7760b90957d20fd6746a7953259e5100844ae499acb1d55cf802b13af93ac438a584db1414ff772b69258724293706f0797468e7ede5205d4821b57f9723c1552c569dd5ebefbedf77411f79f0557f75ec26475fd07728ff158025cdab53dab5b7cb5a4dc9b7372b55f78f8cabe36b918d4f86f4a7502580f78ebda9ec376091efdd701e911015ead821b7f8059e8b7d571665ec49738ddf13543b53cfc12cafcb9f9aa3a8750feadc829eea8bc4c70f0c7f2e1ae84669f207ef3f27dc2b109333dc4739a58e80f350bc335e78814793eb5f637e4371c5196bfc530510f94317ef7ffb8da4933841f97eff0d58df4bb1cf34cfa756eff4e024027b2a358bb21a82e5b2729e91d832f05c4bab539872dd89b67dc7bbb7646dcb3b17c1038a5c0297ed5dedf7f5bca73320abfddb36e3b0c498fba6ab90b2193811c4822b638aa06a4bb7d39a443ea29dde32c73fbc86461c9632d7baa8d5902b5101c7d1ed07f79acc36a5307223d43f1d40c7b2b9d76d8c3446970f53c56054cb37d7f08ee0db7ede4070c261792315d9cd5758fb3889a766076cfa13e27b0d7be9801e8ce854abf230989931b264c562c2ed590fb7dcae1d98e9677ce7c3ca7903b400dd393f9c6f255ba5f540d7ec8469
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
     script_id(29702);
     script_version("1.18");
     script_set_attribute(attribute:"plugin_modification_date", value:"2018/07/14");
    
     script_cve_id(
      "CVE-2006-4339",
      "CVE-2006-6731",
      "CVE-2006-6736",
      "CVE-2006-6745",
      "CVE-2007-0243",
      "CVE-2007-2435",
      "CVE-2007-2788",
      "CVE-2007-2789",
      "CVE-2007-3503",
      "CVE-2007-3504",
      "CVE-2007-3655",
      "CVE-2007-3698",
      "CVE-2007-3922",
      "CVE-2007-4381",
      "CVE-2007-5232",
      "CVE-2007-5862"
     );
     script_bugtraq_id(
      21673,
      21674,
      21675,
      22085,
      24690,
      24695,
      24832,
      24846,
      25054,
      25340,
      25918,
      26877
     );
     script_xref(name:"EDB-ID", value:"30284");
    
     script_name(english:"Mac OS X : Java for Mac OS X 10.4 Release 6");
     script_summary(english:"Check for Java Release 6");
    
     script_set_attribute(attribute:"synopsis", value:"The remote host is affected by multiple vulnerabilities.");
     script_set_attribute(attribute:"description", value:
    "The remote Mac OS X 10.4 host is running a version of Java for Mac OS
    X that is older than release 6.
    
    The remote version of this software contains several security
    vulnerabilities that may allow a rogue Java applet to escalate its
    privileges and to add or remove arbitrary items from the user's
    KeyChain.
    
    To exploit these flaws, an attacker would need to lure an attacker
    into executing a rogue Java applet.");
     script_set_attribute(attribute:"see_also", value:"http://docs.info.apple.com/article.html?artnum=307177");
     script_set_attribute(attribute:"solution", value:"Upgrade to Java for Mac OS X 10.4 release 6.");
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
     script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
     script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
     script_set_attribute(attribute:"exploit_available", value:"true");
     script_set_attribute(attribute:"exploited_by_malware", value:"true");
     script_set_attribute(attribute:"exploit_framework_core", value:"true");
     script_cwe_id(310);
    
     script_set_attribute(attribute:"vuln_publication_date", value:"2006/09/05");
     script_set_attribute(attribute:"patch_publication_date", value:"2007/07/09");
     script_set_attribute(attribute:"plugin_publication_date", value:"2007/12/17");
    
     script_set_attribute(attribute:"plugin_type", value:"local");
     script_end_attributes();
    
     script_category(ACT_GATHER_INFO);
    
     script_copyright(english:"This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.");
     script_family(english:"MacOS X Local Security Checks");
    
     script_dependencies("ssh_get_info.nasl");
     script_require_keys("Host/MacOSX/packages");
     exit(0);
    }
    
    
    include("misc_func.inc");
    include("ssh_func.inc");
    include("macosx_func.inc");
    
    
    if(sshlib::get_support_level() >= sshlib::SSH_LIB_SUPPORTS_COMMANDS)
      enable_ssh_wrappers();
    else disable_ssh_wrappers();
    
    function exec(cmd)
    {
     local_var ret, buf;
    
     if ( islocalhost() )
      buf = pread(cmd:"/bin/bash", argv:make_list("bash", "-c", cmd));
     else
     {
      ret = ssh_open_connection();
      if ( ! ret ) exit(0);
      buf = ssh_cmd(cmd:cmd);
      ssh_close_connection();
     }
    
     if ( buf !~ "^[0-9]" ) exit(0);
    
     buf = chomp(buf);
     return buf;
    }
    
    
    packages = get_kb_item("Host/MacOSX/packages");
    if ( ! packages ) exit(0);
    
    uname = get_kb_item("Host/uname");
    # Mac OS X 10.4.10, 10.4.11 only
    if ( egrep(pattern:"Darwin.* 8\.(10|11)\.", string:uname) )
    {
     cmd = _GetBundleVersionCmd(file:"JavaPluginCocoa.bundle", path:"/Library/Internet Plug-Ins", label:"CFBundleVersion");
     buf = exec(cmd:cmd);
     if ( ! strlen(buf) ) exit(0);
     array = split(buf, sep:'.', keep:FALSE);
     if ( int(array[0]) < 11 ||
         (int(array[0]) == 11 && int(array[1]) <= 7 ) )
     {
      cmd = _GetBundleVersionCmd(file:"JavaPluginCocoa.bundle", path:"/Library/Internet Plug-Ins", label:"SourceVersion");
      buf = exec(cmd:cmd);
      if ( strlen(buf) && int(buf) < 1120000 ) security_hole(0);
     }
    }
    
  • NASL familyWindows
    NASL idSUN_JAVA_JRE_102957.NASL
    descriptionAccording to its version number, the Sun Java Runtime Environment (JRE) installed on the remote host reportedly may allow an untrusted application to elevate its privileges by first granting itself permission to overwrite any file that is writable by the user running the application.
    last seen2020-06-01
    modified2020-06-02
    plugin id25627
    published2007-06-29
    reporterThis script is Copyright (C) 2007-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/25627
    titleSun Java Web Start PersistenceService Application Traversal Arbitrary File Overwrite (102957)
    code
    #
    #  (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(25627);
      script_version("1.29");
      script_cvs_date("Date: 2018/11/15 20:50:28");
    
      script_cve_id("CVE-2007-3504");
      script_bugtraq_id(24695);
    
      script_name(english:"Sun Java Web Start PersistenceService Application Traversal Arbitrary File Overwrite (102957)");
      script_summary(english:"Checks version of Sun JRE"); 
     
      script_set_attribute(attribute:"synopsis", value:
    "The remote Windows host has an application that is affected by a
    privilege escalation vulnerability." );
      script_set_attribute(attribute:"description", value:
    "According to its version number, the Sun Java Runtime Environment
    (JRE) installed on the remote host reportedly may allow an untrusted
    application to elevate its privileges by first granting itself
    permission to overwrite any file that is writable by the user running
    the application." );
      script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2007/Jul/12");
      # http://web.archive.org/web/20080604163024/http://sunsolve.sun.com/search/document.do?assetkey=1-26-102957-1
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?14d648d6");
      script_set_attribute(attribute:"solution", value:
    "Update to Sun Java 2 JDK and JRE 5.0 Update 12 / SDK and JRE 1.4.2_14
    / SDK or later and remove, if necessary, any affected versions." );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
      script_cwe_id(22);
      script_set_attribute(attribute:"plugin_publication_date", value: "2007/06/29");
      script_set_attribute(attribute:"vuln_publication_date", value: "2007/06/29");
      script_set_attribute(attribute:"patch_publication_date", value: "2007/06/28");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:oracle:jre");
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_end_attributes();
     
      script_category(ACT_GATHER_INFO);
      script_family(english:"Windows");
    
      script_copyright(english:"This script is Copyright (C) 2007-2018 Tenable Network Security, Inc.");
    
      script_dependencies("sun_java_jre_installed.nasl");
      script_require_keys("SMB/Java/JRE/Installed");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("misc_func.inc");
    
    
    # Check each installed JRE.
    installs = get_kb_list("SMB/Java/JRE/*");
    if (isnull(installs)) exit(1, "The 'SMB/Java/JRE/' KB item is missing.");
    
    info = "";
    vuln = 0;
    installed_versions = "";
    
    foreach install (list_uniq(keys(installs)))
    {
      ver = install - "SMB/Java/JRE/";
      if (ver =~ "^[0-9.]+")
        installed_versions = installed_versions + " & " + ver;
      if (
        ver =~ "^1\.5\.0_(0[0-9]|1[01])[^0-9]?" ||
        ver =~ "^1\.4\.([01]_|2_(0[0-9]|1[0-3][^0-9]?))"
      )
      {
        dirs = make_list(get_kb_list(install));
        vuln += max_index(dirs);
    
        foreach dir (dirs)
          info += '\n  Path              : ' + dir;
    
        info += '\n  Installed version : ' + ver;
        info += '\n  Fixed version     : 1.5.0_12 / 1.4.2_14\n';
      }
    }
    
    
    # Report if any were found to be vulnerable.
    if (info)
    {
      port = get_kb_item("SMB/transport");
      if (!port) port = 445;
    
      if (report_verbosity > 0)
      {
        if (vuln > 1) s = "s of Java are";
        else s = " of Java is";
    
        report =
          '\n' +
          'The following vulnerable instance'+s+' installed on the\n' +
          'remote host :\n' +
          info;
        security_hole(port:port, extra:report);
      }
      else security_hole(port);
      exit(0);
    }
    else
    {
      installed_versions = substr(installed_versions, 3);
      if (" & " >< installed_versions)
        exit(0, "The Java "+installed_versions+" installs on the remote host are not affected.");
      else
        exit(0, "The Java "+installed_versions+" install on the remote host is not affected.");
    }