Mac OS X : Java for OS X Lion 2012-001

2012-04-05T00:00:00
ID MACOSX_JAVA_10_7_2012-001.NASL
Type nessus
Reporter Tenable
Modified 2017-05-30T00:00:00

Description

The remote Mac OS X host is running a version of Java for Mac OS X 10.7 that is missing update 2012-001, which updates the Java version to 1.6.0_31. As such, it is affected by several security vulnerabilities, the most serious of which may allow an untrusted Java applet to execute arbitrary code with the privileges of the current user outside the Java sandbox.

                                        
                                            #TRUSTED 6ad662cd04941301c11a6cfba51d3f02664b65ca2e82316e119c050609f9da3864f626753c5544961d9456859b2a2545fc98883077185ab1237eae5249b05a53aeb371714607a5cfa4a884f02a6dcf61ff482c68b481b3c310126e379e297e99560c2aadc7c3d977a11c61ec4c09574d93a817a65c912d28e82a9c2769e2c7e18a4b7be05da8d1c7b0213f6912a4a8a8a6ba96fb753f1f8d8ef46476693ffca5e7312d88903ef2b36df5c7d4399592074af708205f65f07c9f0007262277ce2e339743c5b34b75cd713693c437510621cad1bb05db4739daeb316a79455f2551585716a8110337f7ee4624b0f53d47791450af12fa053b86fc58303c8a505c54a075d0e498aad933c06c83f4e6c9270440b497f56399c1bb618f06b9582ad1a943da2ee7a203410cd6d4ea01ecf135db10a5c4e4c4277e9b06692d718dd9dc42f3d2b5853fdb6ff98c9b3487d5e60d6fd55da1e3bfc029b6b58a85162e3a9b4ac2808e0ba1aa6738c1045e7bdad4b2022a399b5c24c5509951a3b6d6b549433689f234b3a4016d3f6f9494ebc83ced091252d6f057d093bd5ee014a14296fb118d79fe0ee4cf49ff85a925bb36388dfd8c54348e99fca3e0024103b4bca095d768da16588e04a9952a4a2aa4691964a2bf108a9bb9bff00623bad3d1be4c03ef6aaab55703d3fbfe97ba2906c1fb00f0b0a51499696ab676f12accdff0969ee9
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(58606);
  script_version("1.14");
  script_set_attribute(attribute:"plugin_modification_date", value:"2017/05/30");

  script_cve_id(
    "CVE-2011-3563",
    "CVE-2011-5035",
    "CVE-2012-0497",
    "CVE-2012-0498",
    "CVE-2012-0499",
    "CVE-2012-0500",
    "CVE-2012-0501",
    "CVE-2012-0502",
    "CVE-2012-0503",
    "CVE-2012-0505",
    "CVE-2012-0506",
    "CVE-2012-0507"
  );
  script_bugtraq_id(
    51194,
    52009,
    52011,
    52012,
    52013,
    52014,
    52015,
    52016,
    52017,
    52018,
    52019,
    52161
  );
  script_osvdb_id(
    78114,
    79225,
    79226,
    79227,
    79228,
    79229,
    79230,
    79232,
    79233,
    79235,
    79236,
    80724,
    89190
  );

  script_name(english:"Mac OS X : Java for OS X Lion 2012-001");
  script_summary(english:"Checks version of the JavaVM framework");

  script_set_attribute(
    attribute:"synopsis",
    value:
"The remote host has a version of Java that is affected by multiple
vulnerabilities."
  );
  script_set_attribute(
    attribute:"description",
    value:
"The remote Mac OS X host is running a version of Java for Mac OS X
10.7 that is missing update 2012-001, which updates the Java version
to 1.6.0_31.  As such, it is affected by several security
vulnerabilities, the most serious of which may allow an untrusted Java
applet to execute arbitrary code with the privileges of the current
user outside the Java sandbox."
  );
  script_set_attribute(
    attribute:"see_also",
    value:"http://support.apple.com/kb/HT5228"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"http://lists.apple.com/archives/security-announce/2012/Apr/msg00000.html"
  );
  script_set_attribute(
    attribute:"see_also",
    value:"http://lists.apple.com/archives/java-dev/2012/Apr/msg00022.html"
  );
  script_set_attribute(
    attribute:"solution",
    value:
"Upgrade to Java for OS X Lion 2012-002, which includes version
14.2.1 of the JavaVM Framework.

Note that these vulnerabilities are actually addressed with Java for
OS X Lion 2012-001.  That update was found to have some non-security
bugs, though, and has been re-released as 2012-002."
  );
  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:ND/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:"exploit_framework_core", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:'CANVAS');
  script_set_attribute(attribute:"metasploit_name", value:'Java AtomicReferenceArray Type Violation Vulnerability');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2011/12/28");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/04/03");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/04/05");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:apple:java_1.6");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"MacOS X Local Security Checks");

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version");

  exit(0);
}


include("global_settings.inc");
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();

if (!get_kb_item("Host/local_checks_enabled")) exit(0, "Local checks are not enabled.");

os = get_kb_item("Host/MacOSX/Version");
if (!os) exit(0, "The host does not appear to be running Mac OS X.");
if (!ereg(pattern:"Mac OS X 10\.7([^0-9]|$)", string:os))
  exit(0, "The host is running "+os+" and therefore is not affected.");

cmd = 'ls /System/Library/Java';
results = exec_cmd(cmd:cmd);
if (isnull(results)) exit(1, "Unable to determine if the Java runtime is installed.");

if ('JavaVirtualMachines' >!< results) exit(0, "The Java runtime is not installed on the remote host.");


plist = "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/version.plist";
cmd =
  'plutil -convert xml1 -o - \'' + plist + '\' | ' +
  'grep -A 1 CFBundleVersion | ' +
  'tail -n 1 | ' +
  'sed \'s/.*string>\\(.*\\)<\\/string>.*/\\1/g\'';
version = exec_cmd(cmd:cmd);
if (!strlen(version)) exit(1, "Failed to get the version of the JavaVM Framework.");

version = chomp(version);
if (!ereg(pattern:"^[0-9]+\.", string:version)) exit(1, "The JavaVM Framework version does not appear to be numeric ("+version+").");

fixed_version = "14.2.0";
if (ver_compare(ver:version, fix:fixed_version, strict:FALSE) == -1)
{
  if (report_verbosity > 0)
  {
    report =
      '\n  Framework         : JavaVM' +
      '\n  Installed version : ' + version +
      '\n  Fixed version     : ' + fixed_version + '\n';
    security_hole(port:0, extra:report);
  }
  else security_hole(0);
}
else exit(0, "The host is not affected since it is running Mac OS X 10.7 and has JavaVM Framework version "+version+".");