Vulnerabilities > CVE-2015-1682 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Microsoft products

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
CWE-119
critical
nessus

Summary

Microsoft Office 2010 SP2, Excel 2010 SP2, PowerPoint 2010 SP2, Word 2010 SP2, Office 2013 SP1, Excel 2013 SP1, PowerPoint 2013 SP1, Word 2013 SP1, Office 2013 RT SP1, Excel 2013 RT SP1, PowerPoint 2013 RT SP1, Word 2013 RT SP1, Office for Mac 2011, Excel for Mac 2011, PowerPoint for Mac 2011, Word for Mac 2011, PowerPoint Viewer, Word Automation Services on SharePoint Server 2010 SP2 and 2013 SP1, Excel Services on SharePoint Server 2010 SP2 and 2013 SP1, Office Web Apps 2010 SP2, Excel Web App 2010 SP2, Office Web Apps Server 2013 SP1, SharePoint Foundation 2010 SP2, and SharePoint Server 2013 SP1 allow remote attackers to execute arbitrary code via a crafted document, aka "Microsoft Office Memory Corruption Vulnerability."

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Msbulletin

bulletin_idMS15-046
bulletin_url
date2015-05-12T00:00:00
impactRemote Code Execution
knowledgebase_id3057181
knowledgebase_url
severityImportant
titleVulnerabilities in Microsoft Office Could Allow Remote Code Execution

Nessus

  • NASL familyWindows : Microsoft Bulletins
    NASL idSMB_NT_MS15-046.NASL
    descriptionThe remote Windows host has a version of Microsoft Office, Microsoft Word, Microsoft Excel, Microsoft PowerPoint, SharePoint Server, SharePoint Foundation Server, or Microsoft Office Web Apps installed that is affected by multiple remote code execution vulnerabilities due to improper handling of objects in memory. A remote attacker can exploit these vulnerabilities by convincing a user to open a specially crafted file, resulting in execution of arbitrary code in the context of the current user.
    last seen2020-06-01
    modified2020-06-02
    plugin id83416
    published2015-05-13
    reporterThis script is Copyright (C) 2015-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/83416
    titleMS15-046: Vulnerabilities in Microsoft Office Could Allow Remote Code Execution (3057181)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(83416);
      script_version("1.17");
      script_cvs_date("Date: 2018/07/30 15:31:33");
    
      script_cve_id("CVE-2015-1682", "CVE-2015-1683");
      script_bugtraq_id(74481, 74484);
      script_xref(name:"MSFT", value:"MS15-046");
      script_xref(name:"MSKB", value:"2975808");
      script_xref(name:"MSKB", value:"2986216");
      script_xref(name:"MSKB", value:"2975816");
      script_xref(name:"MSKB", value:"2965307");
      script_xref(name:"MSKB", value:"3023055");
      script_xref(name:"MSKB", value:"3039725");
      script_xref(name:"MSKB", value:"3039748");
      script_xref(name:"MSKB", value:"3039736");
      script_xref(name:"MSKB", value:"3054833");
      script_xref(name:"MSKB", value:"3054834");
      script_xref(name:"MSKB", value:"3054835");
      script_xref(name:"MSKB", value:"3054838");
      script_xref(name:"MSKB", value:"3054839");
      script_xref(name:"MSKB", value:"3054840");
      script_xref(name:"MSKB", value:"3054841");
      script_xref(name:"MSKB", value:"3054842");
      script_xref(name:"MSKB", value:"3054843");
      script_xref(name:"MSKB", value:"3054845");
      script_xref(name:"MSKB", value:"3054847");
      script_xref(name:"MSKB", value:"3054848");
      script_xref(name:"MSKB", value:"3085544");
      script_xref(name:"IAVA", value:"2015-A-0103");
    
      script_name(english:"MS15-046: Vulnerabilities in Microsoft Office Could Allow Remote Code Execution (3057181)");
      script_summary(english:"Checks the Office, SharePoint, and OWA versions.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote host is affected by multiple remote code execution
    vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "The remote Windows host has a version of Microsoft Office, Microsoft
    Word, Microsoft Excel, Microsoft PowerPoint, SharePoint Server,
    SharePoint Foundation Server, or Microsoft Office Web Apps installed
    that is affected by multiple remote code execution vulnerabilities due
    to improper handling of objects in memory. A remote attacker can
    exploit these vulnerabilities by convincing a user to open a specially
    crafted file, resulting in execution of arbitrary code in the context
    of the current user.");
      script_set_attribute(attribute:"see_also", value:"https://technet.microsoft.com/library/security/ms15-046");
      script_set_attribute(attribute:"solution", value:
    "Microsoft has released a set of patches for Office 2007, Office 2010,
    Office 2013, Word 2010, Word 2013, Excel 2010, Excel 2013, PowerPoint
    2010, PowerPoint 2013, PowerPoint Viewer, SharePoint Server Foundation
    2010, SharePoint Server 2013, and Office Web Apps.");
      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_set_attribute(attribute:"vuln_publication_date", value:"2015/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2015/05/12");
      script_set_attribute(attribute:"plugin_publication_date", value:"2015/05/13");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:excel");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:office");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:office_web_apps");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:office_web_apps_server");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:powerpoint");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:powerpoint_viewer");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:sharepoint_server");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:word");
      script_set_attribute(attribute:"stig_severity", value:"II");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Windows : Microsoft Bulletins");
    
      script_copyright(english:"This script is Copyright (C) 2015-2018 Tenable Network Security, Inc.");
    
      script_dependencies("office_installed.nasl", "microsoft_sharepoint_installed.nbin", "smb_hotfixes.nasl", "ms_bulletin_checks_possible.nasl");
      script_require_keys("SMB/MS_Bulletin_Checks/Possible");
      script_require_ports(139, 445, "Host/patch_management_checks");
    
      exit(0);
    }
    
    include("audit.inc");
    include("smb_func.inc");
    include("smb_hotfixes.inc");
    include("smb_hotfixes_fcheck.inc");
    include("smb_reg_query.inc");
    include("misc_func.inc");
    include("install_func.inc");
    include("datetime.inc");
    
    global_var bulletin, vuln;
    
    get_kb_item_or_exit("SMB/MS_Bulletin_Checks/Possible");
    
    bulletin = 'MS15-046';
    kbs = make_list(
      2975808, # Office 2013 SP1
      2986216, # Excel 2013 SP1
      2975816, # PowerPoint 2013 SP1
      2965307, # Word 2013 SP1
      3023055, # SharePoint 2013 Word Automation Services SP1
      3039725, # SharePoint 2013 Excel Automation Services SP1
      3039748, # Office Web Apps 2013 SP1
      3039736, # SharePoint Server 2013 SP1
      3054833, # SharePoint 2010 Word Automation Services SP2 replaces 2965233
      3054834, # Office 2010 SP2 replaces 2999412
      3054835, # PowerPoint 2010 SP2 replaces 2999420
      3054838, # Excel Web Apps 2010 SP2 replaces 2956193
      3054839, # SharePoint 2010 Excel Automation Services SP2 replaces 2956194
      3054840, # PowerPoint Viewer replaces 2956195
      3054841, # Office 2010 SP2 replaces 2965311
      3054842, # Word 2010 SP2 replaces 2965237
      3054843, # Office Web Apps 2010 SP2 replaces 2956140
      3054845, # Excel 2010 SP2 replaces 2965240
      3054847, # SharePoint Server 2010 SP2 replaces 3017815
      3054848, # Office 2010 SP2 replaces 2965242
      3085544  # Offcie 2007 SP3 replaces 2965282
    );
    
    ######################################################################
    # Main
    if (get_kb_item("Host/patch_management_checks")) hotfix_check_3rd_party(bulletin:bulletin, kbs:kbs, severity:SECURITY_HOLE);
    
    get_kb_item_or_exit("SMB/Registry/Enumerated", exit_code:1);
    
    # Get path information for Windows.
    windir = hotfix_get_systemroot();
    if (isnull(windir)) exit(1, "Failed to determine the location of %windir%.");
    registry_init();
    
    # Generic Office Checks
    function perform_office_checks()
    {
      local_var office_vers, office_sp, path;
      office_vers = hotfix_check_office_version();
      if (office_vers["12.0"])
      {
        office_sp = get_kb_item("SMB/Office/2007/SP");
        if (!isnull(office_sp) && office_sp == 3)
        {
          path = hotfix_append_path(path:hotfix_get_officecommonfilesdir(officever:"12.0"), value:"Microsoft Shared\Office12");
          if (hotfix_check_fversion(file:"Mso.dll", version:"12.0.6734.5000", path:path, bulletin:bulletin, kb:"3085544", product:"Microsoft Office 2007 SP3") == HCF_OLDER)
            vuln = TRUE;
        }
      }
      if (office_vers["14.0"])
      {
        office_sp = get_kb_item("SMB/Office/2010/SP");
        if (!isnull(office_sp) && office_sp == 2)
        {
          path = hotfix_append_path(path:hotfix_get_officeprogramfilesdir(officever:"14.0"), value:"Microsoft Office\Office14");
          if (hotfix_check_fversion(file:"Wwlib.dll", version:"14.0.7151.5001", path:path, bulletin:bulletin, kb:"3054841", product:"Microsoft Office 2010") == HCF_OLDER)
            vuln = TRUE;
          if (hotfix_check_fversion(file:"Oart.dll", version:"14.0.7151.5001", path:path, bulletin:bulletin, kb:"3054834", product:"Microsoft Office 2010") == HCF_OLDER)
            vuln = TRUE;
          if (hotfix_check_fversion(file:"Oartconv.dll", version:"14.0.7151.5001", path:path, bulletin:bulletin, kb:"3054848", product:"Microsoft Office 2010") == HCF_OLDER)
            vuln = TRUE;
        }
      }
      if (office_vers["15.0"])
      {
        office_sp = get_kb_item("SMB/Office/2013/SP");
        if (!isnull(office_sp) && int(office_sp) <= 1)
        {
          path = hotfix_append_path(path:hotfix_get_officeprogramfilesdir(officever:"15.0"), value:"Microsoft Office\Office15");
          if (hotfix_check_fversion(file:"Oart.dll", version:"15.0.4719.1000", path:path, bulletin:bulletin, kb:"2975808", product:"Microsoft Office 2013") == HCF_OLDER)
            vuln = TRUE;
        }
      }
    }
    
    function perform_office_product_checks()
    {
      local_var excel_checks, ppt_checks, word_checks, ppt_vwr_checks;
    
      ######################################################################
      # Excel
      ######################################################################
      excel_checks = make_array(
        "14.0", make_array("sp", 2, "version", "14.0.7151.5001", "kb", "3054845"),
        "15.0", make_array("sp", 1, "version", "15.0.4719.1000", "kb", "2986216")
      );
      if (hotfix_check_office_product(product:"Excel", checks:excel_checks, bulletin:bulletin))
        vuln = TRUE;
    
      ######################################################################
      # PowerPoint
      ######################################################################
      ppt_checks = make_array(
        "14.0", make_array("sp", 2, "version", "14.0.7151.5001", "kb", "3054835"),
        "15.0", make_array("sp", 1, "version", "15.0.4719.1000", "kb", "2975816")
      );
      if (hotfix_check_office_product(product:"PowerPoint", checks:ppt_checks, bulletin:bulletin))
        vuln = TRUE;
    
      ######################################################################
      # Word
      ######################################################################
      word_checks = make_array(
        "14.0", make_array("sp", 2, "version", "14.0.7151.5001", "kb", "3054842"),
        "15.0", make_array("sp", 1, "version", "15.0.4719.1000", "kb", "2965307")
      );
      if (hotfix_check_office_product(product:"Word", checks:word_checks, bulletin:bulletin))
        vuln = TRUE;
    
      ######################################################################
      # PowerPoint Viewer 2010
      # KB: 2956195 Fix Ver: 14.0.7149.5000
      ######################################################################
      ppt_vwr_checks = make_array(
        "14.0", make_array("sp", 2, "version", "14.0.7151.5001", "kb", "3054840")
      );
      if (hotfix_check_office_product(product:"PowerPointViewer", display_name:"PowerPoint Viewer", checks:ppt_vwr_checks, bulletin:bulletin))
        vuln = TRUE;
    }
    
    ######################################################################
    # SharePoint
    ######################################################################
    function perform_sharepoint_checks()
    {
      local_var sps_2010_path, sps_2013_path, sps_2010_sp, sps_2013_sp, sps_2010_edition, sps_2013_edition;
      local_var installs, install, sp, path;
      local_var share, name, port, login, pass, domain, rc;
      local_var file, timestamp, file_timestamp, kb, info;
    
      # Get installs of SharePoint
      sps_2010_path = NULL;
      sps_2013_path = NULL;
      sp = NULL;
    
      installs = get_installs(app_name:"Microsoft SharePoint Server");
      foreach install (installs[1])
      {
        if (install['Product'] == "2010")
        {
          sps_2010_path = install['path'];
          sps_2010_sp = install['SP'];
          sps_2010_edition = install['Edition'];
        }
        else if (install['Product'] == "2013")
        {
          sps_2013_path = install['path'];
          sps_2013_sp = install['SP'];
          sps_2013_edition = install['Edition'];
        }
      }
    
      ######################################################################
      # SharePoint Server 2010 SP2 - Word Automation Service
      # KB: 3054833  File: sword.dll Fix Ver: 14.0.7151.5001
      # SharePoint Server 2010 SP2 - Excel Services
      # KB: 3054839 File: xlsrv.dll Fix Ver: 14.0.7151.5001
      ######################################################################
      if (sps_2010_path && sps_2010_sp == "2" && sps_2010_edition == "Server")
      {
        path = hotfix_append_path(path:sps_2010_path, value:"WebServices\WordServer\Core");
        if (hotfix_check_fversion(file:"sword.dll", version:"14.0.7151.5001", path:path, bulletin:bulletin, kb:"3054833", product:"Office SharePoint Server 2010 Word Automation Services") == HCF_OLDER)
          vuln = TRUE;
        path = hotfix_append_path(path:sps_2010_path, value:"Bin");
        if (hotfix_check_fversion(file:"xlsrv.dll", version:"14.0.7151.5001", path:path, bulletin:bulletin, kb:"3054839", product:"Office SharePoint Server 2010 Excel Services") == HCF_OLDER)
          vuln = TRUE;
      }
    
      ######################################################################
      # SharePoint Foundation 2010 SP2
      # KB: 3054847 File: Onetutil.dll Fix Ver: 14.0.7151.5001
      ######################################################################
      if (sps_2010_path && sps_2010_sp == "2" && sps_2010_edition == "Foundation")
      {
        NetUseDel(close:FALSE);
    
        share = hotfix_path2share(path:windir);
        name   = kb_smb_name();
        port   = kb_smb_transport();
        login  = kb_smb_login();
        pass   = kb_smb_password();
        domain = kb_smb_domain();
    
        rc = NetUseAdd(login:login, password:pass, domain:domain, share:share);
        if (rc == 1)
        {
          path = hotfix_append_path(path:sps_2010_path, value:"TEMPLATE\LAYOUTS\entityeditor.debug.js");
    
          file_timestamp = hotfix_get_timestamp(path:path);
    
          hotfix_handle_error(error_code:file_timestamp['error'],
                        file:path,
                        appname:"SharePoint Foundation 2010 SP2",
                        exit_on_fail:false);
    
          timestamp = file_timestamp['value'];
    
          NetUseDel(close:FALSE);
    
          if (!isnull(timestamp))
          {
            if(timestamp < 1431493088)
            {
              vuln = TRUE;
              kb = "3054847";
              info =
                '\n  Product             : Sharepoint Foundation 2010 SP2\n' +
                '\n  File                : ' + path +
                '\n  Installed timestamp : ' + strftime(timestamp) +
                '\n  Fixed timestamp     : ' + strftime(1431493088) + '\n';
              hotfix_add_report(info, bulletin:bulletin, kb:kb);
            }
          }
        }
        NetUseDel(close:FALSE);
      }
    
      ######################################################################
      # SharePoint Server 2013 SP1 - Word Automation Services
      # KB: 3023055 File: sword.dll Fix Ver: 15.0.4719.1000
      # SharePoint Server 2013 SP1 - Excel Services
      # KB: 3039725 File: xlsrv.dll Fix Ver: 15.0.4719.1000
      # SharePoint Server 2013 SP1
      # KB: 3039736 File:Microsoft.Office.Server.PowerPoint.dll Fix Ver:15.0.4553.1000
      ######################################################################
      if (sps_2013_path && sps_2013_sp == "1" && sps_2013_edition == "Server")
      {
        path = hotfix_append_path(path:sps_2013_path, value:"WebServices\ConversionServices");
        if (hotfix_check_fversion(file:"sword.dll", version:"15.0.4719.1000", path:path, bulletin:bulletin, kb:"3023055", product:"Office SharePoint Server 2013 Word Automation Services") == HCF_OLDER)
          vuln = TRUE;
        path = hotfix_append_path(path:sps_2013_path, value:"Bin");
        if (hotfix_check_fversion(file:"xlsrv.dll", version:"15.0.4719.1000", path:path, bulletin:bulletin, kb:"3039725", product:"Office SharePoint Server 2013 Excel Services") == HCF_OLDER)
          vuln = TRUE;
        path = hotfix_append_path(path:windir, value:"Microsoft.NET\assembly\GAC_MSIL\Microsoft.Office.Server.PowerPoint\v4.0_15.0.0.0__71e9bce111e9429c");
        if (hotfix_check_fversion(file:"Microsoft.Office.Server.PowerPoint.dll", version:"15.0.4553.1000", path:path, bulletin:bulletin, kb:"3039736", product:"Office SharePoint Server 2013") == HCF_OLDER)
          vuln = TRUE;
      }
    }
    
    ######################################################################
    # Office Web Apps
    ######################################################################
    function perform_owa_checks()
    {
      local_var owa_installs, owa_install, owa_2010_path, owa_2010_sp, owa_2013_path, owa_2013_sp;
      local_var path;
      # Get installs of Office Web Apps
      owa_installs = get_installs(app_name:"Office Web Apps");
      if (!empty_or_null(owa_installs))
      {
        foreach owa_install (owa_installs[1])
        {
          if (owa_install['Product'] == "2010")
          {
            owa_2010_path = owa_install['path'];
            owa_2010_sp = owa_install['SP'];
          }
          else if (owa_install['Product'] == "2013")
          {
            owa_2013_path = owa_install['path'];
            owa_2013_sp = owa_install['SP'];
          }
        }
      }
      ######################################################################
      # Office Web Apps 2010 SP2
      # KB: 2956140 File: sword.dll Fix Ver: 14.0.7149.5000
      # Excel Web Apps 2010 SP2
      # KB: 2956193 File: xlsrv.dll Fix Ver: 14.0.7149.5000
      ######################################################################
      if (owa_2010_path && owa_2013_sp == "2")
      {
        path = hotfix_append_path(path:owa_2010_path, value:"WordConversionService\Bin\Converter");
        if (hotfix_check_fversion(file:"sword.dll", version:"14.0.7151.5001", min_version:"14.0.7015.1000", path:path, bulletin:bulletin, kb:"3054843", product:"Office Web Apps 2010") == HCF_OLDER)
          vuln = TRUE;
        path = hotfix_append_path(path:owa_2010_path, value:"Bin");
        if (hotfix_check_fversion(file:"xlsrv.dll", version:"14.0.7151.5001", min_version:"14.0.7015.1000", path:path, bulletin:bulletin, kb:"3054838", product:"Office Web Apps 2010") == HCF_OLDER)
          vuln = TRUE;
      }
    
      ######################################################################
      # Office Web Apps 2013 SP1
      # KB: 3039748 File: sword.dll Fix Ver: 15.0.4719.1000
      ######################################################################
      if (owa_2013_path && owa_2013_sp == "1")
      {
        path = hotfix_append_path(path:owa_2013_path, value:"WordConversionService\Bin\Converter");
        if (hotfix_check_fversion(file:"xlsrv.dll", version:"15.0.4719.1000", min_version:"15.0.4571.1500", path:path, bulletin:bulletin, kb:"3039748", product:"Office Web Apps 2013") == HCF_OLDER)
          vuln = TRUE;
      }
    }
    
    perform_office_checks();
    perform_office_product_checks();
    perform_sharepoint_checks();
    perform_owa_checks();
    
    if (vuln)
    {
      set_kb_item(name:'SMB/Missing/'+bulletin, value:TRUE);
      hotfix_security_hole();
      hotfix_check_fversion_end();
      exit(0);
    }
    else
    {
      hotfix_check_fversion_end();
      audit(AUDIT_HOST_NOT, 'affected');
    }
    
  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_MS15-046_OFFICE_2011.NASL
    descriptionThe remote Mac OS X host has a version of Microsoft Word installed that is affected by a remote code execution vulnerability due to improper handling of objects in memory. A remote attacker can exploit this vulnerability by convincing a user to open a specially crafted file, resulting in execution of arbitrary code in the context of the current user.
    last seen2020-06-01
    modified2020-06-02
    plugin id83415
    published2015-05-13
    reporterThis script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/83415
    titleMS15-046: Vulnerability in Microsoft Office Could Allow Remote Code Execution (3057181)
    code
    #TRUSTED a831ff3e9c2a5e8adc22a2df830c313529272445420a87e1cf7f050e3ad83b8357bfcd2731a73ee306dc8dd07f1c5df74db7571ad37217108f4228d32791c75c729986073e5d52376d552b1d26354594193b336820577b35d4bbd8fcafc8196d95b4c1deadb11402b695b5de9cfa4b1f754a3e05e306f3a73fc12896db9e93c83b6cf1ade61d7e4f48ad73701a1d28bd245488f297d760cae9072f321e66fd800c18dd6ed28627fdc0fc0201744b9935c1e630f2e84dfd8949f74d0c89e9791606b037c4c4fd30f10cf05901d8c726d5ca42f91124142a74c0136a666c9c737b38ff76be2ec8adc274ef31a9f46900a1807dcf96dc369ef8134eb5054128bd6bff63391d0589d2fa06a8f03496eff82ae42d216c8674dd5da8b05ef2f1a20abc0525b51a3b1d4ff584eaa5ce397c5b443cbcddc6ca5534a0f9bb112d3c1365daee246afbb980b4c103d3ea2d49e37c3361b74ea130043ba44f5165e753c134e7cebb8029958dec4dc1b19529fc2e1399d672ccfaea5eb6c9cae39bb087d2c1f9f2909dfd215bb71ca69b110737a17de95a47a5bfc95d657965da68d716902f9ade462d00fc6239d7ba356ac1eb0eb25ffbe69a0de6c79f3491201b37b4c527dc611101f97936475295a56be86bd50da434be2183f62bd099a50ff2dd3815cd26e8b9b24f67cc90ad9169be9ae43f5616e5edfa25c193b3a60be07b18aa65861d
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(83415);
      script_version("1.11");
      script_cvs_date("Date: 2019/11/22");
    
      script_cve_id("CVE-2015-1682");
      script_bugtraq_id(74481);
      script_xref(name:"MSFT", value:"MS15-046");
      script_xref(name:"IAVA", value:"2015-A-0103");
      script_xref(name:"MSKB", value:"3048688");
    
      script_name(english:"MS15-046: Vulnerability in Microsoft Office Could Allow Remote Code Execution (3057181)");
      script_summary(english:"Checks the version of Microsoft Office.");
    
      script_set_attribute(attribute:"synopsis", value:
    "An application installed on the remote Mac OS X host is affected by a
    remote code execution vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The remote Mac OS X host has a version of Microsoft Word installed
    that is affected by a remote code execution vulnerability due to
    improper handling of objects in memory. A remote attacker can exploit
    this vulnerability by convincing a user to open a specially crafted
    file, resulting in execution of arbitrary code in the context of the
    current user.");
      script_set_attribute(attribute:"see_also", value:"https://technet.microsoft.com/library/security/ms15-046");
      script_set_attribute(attribute:"solution", value:
    "Microsoft has released a patch for Office for Mac 2011.
    
    Note that Microsoft has re-released the patch to update the version
    of Microsoft Office for Mac to version 14.5.1 to address a potential
    issue with Microsoft Outlook for Mac. Microsoft recommends that this
    update is applied.");
      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_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2015/05/12");
      script_set_attribute(attribute:"patch_publication_date", value:"2015/05/12");
      script_set_attribute(attribute:"plugin_publication_date", value:"2015/05/13");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:office:2011::mac");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:word_for_mac:2011");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:excel_for_mac:2011");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:powerpoint_for_mac:2011");
      script_set_attribute(attribute:"stig_severity", value:"II");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"MacOS X Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version");
    
      exit(0);
    }
    
    include("audit.inc");
    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")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    
    os = get_kb_item("Host/MacOSX/Version");
    if (!os) audit(AUDIT_OS_NOT, "Mac OS X");
    
    # Gather version info.
    info = '';
    installs = make_array();
    
    prod = 'Office for Mac 2011';
    plist = "/Applications/Microsoft Office 2011/Office/MicrosoftComponentPlugin.framework/Versions/14/Resources/Info.plist";
    cmd =  'cat \'' + plist + '\' | ' +
      'grep -A 1 CFBundleShortVersionString | ' +
      'tail -n 1 | ' +
      'sed \'s/.*string>\\(.*\\)<\\/string>.*/\\1/g\'';
    version = exec_cmd(cmd:cmd);
    if (version && version =~ "^[0-9]+\.")
    {
      version = chomp(version);
      if (version !~ "^14\.") exit(1, "Failed to get the version for "+prod+" - '"+version+"'.");
    
      installs[prod] = version;
    
      ver = split(version, sep:'.', keep:FALSE);
      for (i=0; i<max_index(ver); i++)
        ver[i] = int(ver[i]);
    
      fixed_version = '14.5.0';
      fix = split(fixed_version, sep:'.', keep:FALSE);
      for (i=0; i<max_index(fix); i++)
        fix[i] = int(fix[i]);
    
      for (i=0; i<max_index(fix); i++)
        if ((ver[i] < fix[i]))
        {
          info +=
            '\n  Product           : ' + prod +
            '\n  Installed version : ' + version +
            '\n  Fixed version     : ' + fixed_version + '\n';
          break;
        }
        else if (ver[i] > fix[i])
          break;
    }
    
    # Report findings.
    if (info)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:info);
      else security_hole(0);
    
      exit(0);
    }
    else
    {
      if (max_index(keys(installs)) == 0) exit(0, "Office for Mac 2011 is not installed.");
      else
      {
        msg = 'The host has ';
        foreach prod (sort(keys(installs)))
          msg += prod + ' ' + installs[prod] + ' and ';
        msg = substr(msg, 0, strlen(msg)-1-strlen(' and '));
    
        msg += ' installed and thus is not affected.';
    
        exit(0, msg);
      }
    }