Vulnerabilities > CVE-2013-0127 - Permissions, Privileges, and Access Controls vulnerability in IBM Lotus Notes

047910
CVSS 5.8 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
NONE
network
ibm
CWE-264
nessus

Summary

IBM Lotus Notes 8.x before 8.5.3 FP4 Interim Fix 1 and 9.0 before Interim Fix 1 does not block APPLET elements in HTML e-mail, which allows remote attackers to bypass intended restrictions on Java code execution and X-Confirm-Reading-To functionality via a crafted message, aka SPRs JMOY95BLM6 and JMOY95BN49.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • 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.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.

Nessus

NASL familyWindows
NASL idLOTUS_NOTES_ACCEPTS_JAVA.NASL
descriptionThe IBM Notes application installed on the remote Windows host accepts Java applet tags and JavaScript tags inside HTML emails, making it possible to load Java applets and scripts from a remote location.
last seen2020-06-01
modified2020-06-02
plugin id66637
published2013-05-28
reporterThis script is Copyright (C) 2013-2018 Tenable Network Security, Inc.
sourcehttps://www.tenable.com/plugins/nessus/66637
titleIBM Notes Accepts JavaScript Tags Inside HTML Emails
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(66637);
  script_version("1.6");
  script_cvs_date("Date: 2018/11/15 20:50:27");

  script_cve_id("CVE-2013-0127", "CVE-2013-0538");
  script_bugtraq_id(59589, 59590);
  script_xref(name:"CERT", value:"912420");

  script_name(english:"IBM Notes Accepts JavaScript Tags Inside HTML Emails");
  script_summary(english:"Checks variables in notes.ini file");

  script_set_attribute(attribute:"synopsis", value:
"The version of IBM Notes installed on the remote Windows host accepts
Java applet tags and JavaScript tags inside HTML emails.");
  script_set_attribute(attribute:"description", value:
"The IBM Notes application installed on the remote Windows host accepts
Java applet tags and JavaScript tags inside HTML emails, making it
possible to load Java applets and scripts from a remote location.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2013/Apr/262");
  # https://www.ibm.com/blogs/psirt/security-bulletin-ibm-notes-accepts-java-applet-and-javascript-tags-inside-html-emails-cve-2013-0127-cve-2013-0538-2/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4ab23674");
  script_set_attribute(attribute:"see_also", value:"https://www-304.ibm.com/support/docview.wss?uid=swg21633819");
  script_set_attribute(attribute:"solution", value:
"Upgrade to IBM Notes 8.5.3 Fix Pack 4 / 9.0 Interim Fix 1 or apply the
workaround.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"false");

  script_set_attribute(attribute:"vuln_publication_date", value:"2013/04/30");
  script_set_attribute(attribute:"patch_publication_date", value:"2013/05/02");
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/28");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:ibm:lotus_notes");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Windows");

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

  script_dependencies("smb_hotfixes.nasl", "lotus_notes_installed.nasl");
  script_require_keys("SMB/Registry/Enumerated", "SMB/Lotus_Notes/Installed");
  script_require_ports(139, 445);

  exit(0);
}

include("audit.inc");
include("misc_func.inc");
include("smb_func.inc");
include("smb_hotfixes.inc");
include("smb_hotfixes_fcheck.inc");
include("smb_reg_query.inc");

# Walk up the path and check if each directory
# in the path is a reparse point.
function reparse_points_exist_in_path(check_path)
{
  local_var check_ret;

  while (check_path != '\\' && strlen(check_path) > 0)
  {
    check_ret = FindFirstFile(pattern:check_path);

    # Look for reparse point directories
    # in file attributes.
    if (!isnull(check_ret[2]) &&
      # FILE_ATTRIBUTE_DIRECTORY
      ((check_ret[2] >> 4) & 0x1) &&
      # FILE_ATTRIBUTE_REPARSE_POINT
      ((check_ret[2] >> 10) & 0x1)
    )
      return TRUE;

    check_path = ereg_replace(
      pattern:"^(.*)\\([^\\]*)?$",
      replace:"\1",
      string:check_path
    );
  }
  return FALSE;
}
appname = 'IBM Lotus Notes';
kb_base = 'SMB/Lotus_Notes';

version = get_kb_item_or_exit(kb_base + '/Version');
ver_ui = get_kb_item_or_exit(kb_base + '/Version_UI');
apppath = get_kb_item_or_exit(kb_base + '/Path');

# Connect to the appropriate share.
name    =  kb_smb_name();
port    =  kb_smb_transport();
if (!get_port_state(port)) audit(AUDIT_PORT_CLOSED, port);
login   =  kb_smb_login();
pass    =  kb_smb_password();
domain  =  kb_smb_domain();

path = ereg_replace(pattern:"^(.+)\\$", replace:"\1", string:apppath);
share = hotfix_path2share(path:path);

# In case we need it later, get the user directories
registry_init();
hklm = registry_hive_connect(hive:HKEY_LOCAL_MACHINE, exit_on_fail:TRUE);

key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory";
pdir = get_registry_value(handle:hklm, item:key);
if (!isnull(pdir))
{
  if (stridx(tolower(pdir), "%systemdrive%") == 0)
  {
    key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot";
    systemroot = get_registry_value(handle:hklm, item:key);
    if (isnull(systemroot)) exit(1, 'Failed to get the system root on the remote host.');
    systemroot = ereg_replace(pattern:'^([A-Za-z]:).*', replace:"\1", string:systemroot);
    pdir = systemroot + substr(pdir, strlen("%systemdrive%"));
  }
}
RegCloseKey(handle:hklm);
close_registry(close:FALSE);

rc = NetUseAdd(login:login, password:pass, domain:domain, share:share);
if (rc != 1)
{
  NetUseDel();
  audit(AUDIT_SHARE_FAIL, share);
}


vuln = FALSE;
ver = split(version, sep:'.', keep:FALSE);
for (i=0; i < max_index(ver); i++)
  ver[i] = int(ver[i]);

fix = '';
# Only check for a patched version if the installed
# version is either 8.x or 9.x.
if (version =~ '^8\\.0\\.[0-2][^0-9]')
{
  vuln = TRUE;
  fix = '8.5.34.13086';
}
if (version =~ '^8\\.5\\.' && ver_compare(ver:version, fix:'8.5.34.13086') < 0)
{
  vuln = TRUE;
  fix = '8.5.34.13086';
}
else if (ver[0] == 9)
{
  exe = ereg_replace(pattern:'^[A-Za-z]:(.*)', replace:"\1\nsd.exe", string:apppath);
  fh = CreateFile(
    file:exe,
    desired_access:GENERIC_READ,
    file_attributes:FILE_ATTRIBUTE_NORMAL,
    share_mode:FILE_SHARE_READ,
    create_disposition:OPEN_EXISTING
  );
  if (isnull(fh))
  {
    NetUseDel();
    audit(AUDIT_VER_FAIL, exe);
  }
  ret = GetFileVersionEx(handle:fh);
  CloseFile(handle:fh);
  if (!isnull(ret))
  {
    timestamp = ret['dwTimeDateStamp'];
  }
  if (isnull(timestamp))
    exit(1, 'Failed to get the timestamp of ' + apppath + "\nsd.exe.");
  if (timestamp < 1367003838)
  {
    fixtimestamp = 1367003838;
    vuln = TRUE;
  }
}

# If the version is vulnerable, check for the workaround
if (vuln)
{
  ini =  ereg_replace(pattern:"^[A-Za-z]:(.*)", replace:"\1\notes.ini", string:path);
  fh = CreateFile(
    file:ini,
    desired_access:GENERIC_READ,
    file_attributes:FILE_ATTRIBUTE_NORMAL,
    share_mode:FILE_SHARE_READ,
    create_disposition:OPEN_EXISTING
  );
  if (isnull(fh))
  {
    # If Notes is installed for multiple users, the configuration is on a per-user basis
    if (isnull(pdir))
    {
      NetUseDel();
      exit(1, 'Failed to get the user directories.');
    }
    share2 = hotfix_path2share(path:pdir);
    if (share2 != share)
    {
      NetUseDel(close:FALSE);
      share = hotfix_path2share(path:pdir);
    }
    dirpat = ereg_replace(pattern:'^[A-Za-z]:(.*)', replace:"\1\*", string:pdir);

    rc = NetUseAdd(login:login, password:pass, domain:domain, share:share);
    if (rc != 1)
    {
      close_registry();
      audit(AUDIT_SHARE_FAIL, share);
    }

    paths = make_array();
    # Loop over user directories
    retx = FindFirstFile(pattern:dirpat);
    while (!isnull(retx[1]))
    {
      path = NULL;
      user = retx[1];
      if ((retx[2] && FILE_ATTRIBUTE_DIRECTORY) && user != '.' && user != '..')
      {
        # 2k / 2k3 / XP
        if (winver < 6)
          path = pdir + '\\' + user;
        else path = pdir + '\\' + user + "\AppData";

        if (!isnull(path))
        {
          lcpath = tolower(path);
          if (!paths[user]) paths[user] = path;
        }
      }
      retx = FindNextFile(handle:retx);
    }

    if (max_index(keys(paths)))
    {
      foreach user (keys(paths))
      {
        info = '';
        strip_path = dirpath - "\*";
        if (reparse_points_exist_in_path(check_path:strip_path))
          continue;
        path = paths[user];

        if (winver < 6)
          path = path + "\Local Settings\Application Data\Lotus\Notes\Data";
        else
          path = path + "\Local\Lotus\Notes\Data";
        ini = ereg_replace(pattern:'^[A-Za-z]:(.*)', string:path, replace:"\1\notes.ini");

        fh = CreateFile(
          file:ini,
          desired_access:GENERIC_READ,
          file_attributes:FILE_ATTRIBUTE_NORMAL,
          share_mode:FILE_SHARE_READ,
          create_disposition:OPEN_EXISTING
        );
        if (!isnull(fh))
        {
          data = '';
          settings = make_list();
          fsize = GetFileSize(handle:fh);
          off = 0;
          while (off <= fsize)
          {
            data = ReadFile(handle:fh, length:10240, offset:off);
            if (strlen(data) == 0) break;
            settings = make_list(settings, split(data, keep:FALSE));

            off += 10240;
          }
          CloseFile(handle:fh);

         foundconfigs = make_array('EnableJavaApplets', FALSE, 'EnableJavaScript', FALSE, 'EnableLiveConnect', FALSE);
         found = 0;
         # Loop over the settings and check if JavaScript has been disabled
         for (i=0; i < max_index(settings); i++)
         {
           if ('EnableJavaApplets=' >< settings[i])
           {
             found++;
             foundconfigs['EnableJavaApplets'] = TRUE;
             setting = split(settings[i], sep:'=', keep:FALSE);
               if (setting[1])
                 info += '\n    - EnableJavaApplets';
           }
           else if ('EnableJavaScript=' >< settings[i])
           {
             found++;
             foundconfigs['EnableJavaScript'] = TRUE;
             setting = split(settings[i], sep:'=', keep:FALSE);
             if (setting[1])
               info += '\n    - EnableJavaScript';
           }
           else if ('EnableLiveConnect=' >< settings[i])
           {
             found++;
             foundconfigs['EnableLiveConnect'] = TRUE;
             setting = split(settings[i], sep:'=', keep:FALSE);
             if (setting[1])
               info += '\n    - EnableLiveConnect';
           }
           if (found == 3) break;
         }

         # If any of the settings weren't found in notes.ini, assume
         # they are enabled
         foreach key (keys(foundconfigs))
         {
           if (!foundconfigs[key])
             info += '\n  - ' + key;
         }
         if (info)
         {
           report +=
             '\n  ' + user + info;
         }
        }
      }
    }
    NetUseDel();
    if (report)
    {
      if (report_verbosity > 0)
      {
        extra =
          '\n  Path              : ' + apppath +
          '\n  Installed version : ' + version;
        if (fixtimestamp)
        {
          extra +=
            '\n  File              : ' + apppath + "\nsd.exe" +
            '\n  File Timestamp    : ' + timestamp +
            '\n  Fixed Timestamp   : ' + fixtimestamp + '\n';
        }
        else
          extra += '\n  Fixed version     : ' + fix + '\n';
        report =
          extra +
          '\n  Further, the following configuration settings are enabled for the' +
          '\n  listed users :' +
          '\n' +
          report + '\n';
        security_warning(port:port, extra:report);
      }
      else security_warning(port);
      exit(0);
    }
    else exit(0, 'The host is not affected because the workaround is in place.');
  }
  else
  {
    data = '';
    settings = make_list();
    fsize = GetFileSize(handle:fh);
    off = 0;
    while (off <= fsize)
    {
      data = ReadFile(handle:fh, length:10240, offset:off);
      if (strlen(data) == 0) break;
      settings = make_list(settings, split(data, keep:FALSE));

      off += 10240;
    }
    CloseFile(handle:fh);
    NetUseDel();

    foundconfigs = make_array('EnableJavaApplets', FALSE, 'EnableJavaScript', FALSE, 'EnableLiveConnect', FALSE);
    found = 0;
    # Loop over the settings and check if JavaScript has been disabled
    for (i=0; i < max_index(settings); i++)
    {
      if ('EnableJavaApplets=' >< settings[i])
      {
        found++;
        foundconfigs['EnableJavaApplets'] = TRUE;
        setting = split(settings[i], sep:'=', keep:FALSE);
        if (setting[1])
          info += '\n  - EnableJavaApplets';
      }
      else if ('EnableJavaScript=' >< settings[i])
      {
        found++;
        foundconfigs['EnableJavaScript'] = TRUE;
        setting = split(settings[i], sep:'=', keep:FALSE);
        if (setting[1])
          info += '\n  - EnableJavaScript';
      }
      else if ('EnableLiveConnect=' >< settings[i])
      {
        found++;
        foundconfigs['EnableLiveConnect'] = TRUE;
        setting = split(settings[i], sep:'=', keep:FALSE);
        if (setting[1])
          info += '\n  - EnableLiveConnect';
      }
      if (found == 3) break;
    }

    # If any of the settings weren't found in notes.ini, assume
    # they are enabled
    foreach key (keys(foundconfigs))
    {
      if (!foundconfigs[key])
         info += '\n  - ' + key;
    }
    if (info)
    {
      if (report_verbosity > 0)
      {
        report =
          '\n  Path              : ' + apppath +
          '\n  Installed version : ' + version;
        if (fixtimestamp)
        {
          report +=
            '\n  File              : ' + apppath + "\nsd.exe" +
            '\n  File Timestamp    : ' + timestamp +
            '\n  Fixed Timestamp   : ' + fixtimestamp + '\n';
        }
        else
          report += '\n  Fixed version     : ' + fix + '\n';
          report +=
            '\n  Further, the following configuration settings are enabled : ' +
            info;
        security_warning(port:port, extra:report);
      }
      else security_warning(port);
      exit(0);
    }
    else exit(0, 'The host is not affected because the workaround is in place.');
  }
}
else
{
  NetUseDel();
  audit(AUDIT_INST_PATH_NOT_VULN, appname, ver_ui, apppath);
}