Vulnerabilities > CVE-2016-0277 - Improper Access Control vulnerability in IBM Domino

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

Summary

Heap-based buffer overflow in the KeyView PDF filter in IBM Domino 8.5.x before 8.5.3 FP6 IF13 and 9.x before 9.0.1 FP6 allows remote attackers to execute arbitrary code via a crafted PDF document, a different vulnerability than CVE-2016-0278, CVE-2016-0279, and CVE-2016-0301.

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Embedding Scripts within Scripts
    An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute scripts. The attacker leverages this capability to execute scripts to execute his/her own script by embedding it within other scripts that the target software is likely to execute. The attacker must have the ability to inject script into script that is likely to be executed. If this is done, then the attacker can potentially launch a variety of probes and attacks against the web server's local environment, in many cases the so-called DMZ, back end resources the web server can communicate with, and other hosts. With the proliferation of intermediaries, such as Web App Firewalls, network devices, and even printers having JVMs and Web servers, there are many locales where an attacker can inject malicious scripts. Since this attack pattern defines scripts within scripts, there are likely privileges to execute said attack on the host. Of course, these attacks are not solely limited to the server side, client side scripts like Ajax and client side JavaScript can contain malicious scripts as well. In general all that is required is for there to be sufficient privileges to execute a script, but not protected against writing.
  • Signature Spoofing by Key Theft
    An attacker obtains an authoritative or reputable signer's private signature key by theft and then uses this key to forge signatures from the original signer to mislead a victim into performing actions that benefit the attacker.

Nessus

  • NASL familyMisc.
    NASL idDOMINO_9_0_1_FP6.NASL
    descriptionAccording to its banner, the version of IBM Domino (formerly IBM Lotus Domino) running on the remote host is 9.0.x prior to 9.0.1 Fix Pack 6 (FP6). It is, therefore, affected by the following vulnerabilities : - Multiple heap-based buffer overflow conditions exist in the KeyView PDF filter when parsing a PDF document due to improper validation of user-supplied input. An unauthenticated, remote attacker can exploit these, by convincing a user to open a specially crafted PDF document, to cause a denial of service condition or the execution of arbitrary code. (CVE-2016-0277, CVE-2016-0278, CVE-2016-0279, CVE-2016-0301) - A security restriction bypass vulnerability exists in the remote console due to an error that occurs when an unspecified unsupported configuration is used involving UNC share path names. An unauthenticated, remote attacker can exploit this to bypass authentication and possibly execute arbitrary code with SYSTEM privileges. (CVE-2016-0304)
    last seen2020-06-01
    modified2020-06-02
    plugin id92787
    published2016-08-08
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/92787
    titleIBM Domino 9.0.x < 9.0.1 Fix Pack 6 Multiple Vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(92787);
      script_version("1.6");
      script_cvs_date("Date: 2019/11/14");
    
      script_cve_id(
        "CVE-2016-0277",
        "CVE-2016-0278",
        "CVE-2016-0279",
        "CVE-2016-0301",
        "CVE-2016-0304"
      );
      script_bugtraq_id(
        90804,
        91098,
        91099,
        91142,
        91149
      );
    
      script_name(english:"IBM Domino 9.0.x < 9.0.1 Fix Pack 6 Multiple Vulnerabilities");
      script_summary(english:"Checks the version of IBM Domino.");
    
      script_set_attribute(attribute:"synopsis", value:
    "A business collaboration application running on the remote host is
    affected by multiple vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "According to its banner, the version of IBM Domino (formerly IBM
    Lotus Domino) running on the remote host is 9.0.x prior to 9.0.1 Fix
    Pack 6 (FP6). It is, therefore, affected by the following
    vulnerabilities :
    
      - Multiple heap-based buffer overflow conditions exist in
        the KeyView PDF filter when parsing a PDF document due
        to improper validation of user-supplied input. An
        unauthenticated, remote attacker can exploit these, by
        convincing a user to open a specially crafted PDF
        document, to cause a denial of service condition or the
        execution of arbitrary code. (CVE-2016-0277,
        CVE-2016-0278, CVE-2016-0279, CVE-2016-0301)
    
      - A security restriction bypass vulnerability exists in
        the remote console due to an error that occurs when an
        unspecified unsupported configuration is used involving
        UNC share path names. An unauthenticated, remote
        attacker can exploit this to bypass authentication and
        possibly execute arbitrary code with SYSTEM privileges.
        (CVE-2016-0304)");
      script_set_attribute(attribute:"see_also", value:"https://www-01.ibm.com/support/docview.wss?uid=swg21983292");
      script_set_attribute(attribute:"see_also", value:"https://www-01.ibm.com/support/docview.wss?uid=swg21983328");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to IBM Domino version 9.0.1 FP6 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/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:"cvss_score_source", value:"CVE-2016-0304");
    
      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:"2016/06/07");
      script_set_attribute(attribute:"patch_publication_date", value:"2016/06/07");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/08/08");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:ibm:domino");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:ibm:lotus_domino");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("domino_installed.nasl");
      script_require_keys("Domino/Version", "Settings/ParanoidReport");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    
    # Check the version of Domino installed.
    app_name = "IBM Domino";
    ver = get_kb_item_or_exit("Domino/Version");
    port = get_kb_item("Domino/Version_provided_by_port");
    if (!port) port = 0;
    version = NULL;
    fix = NULL;
    fix_ver = NULL;
    fix_pack = NULL;
    hotfix = NULL;
    
    # Do not have data on special fixes
    if (report_paranoia < 2) audit(AUDIT_PARANOID); 
    # Ensure sufficient granularity.
    if (ver !~ "^(\d+\.){1,}\d+.*$") audit(AUDIT_VER_NOT_GRANULAR, app_name, port, ver);
    
    # Only check for 9.0.0.x and 9.0.1.x
    if (ver =~ "^9\.0\.[0-1]($|[^0-9])")
    {
      fix = "9.0.1 FP6";
      fix_ver = "9.0.1";
      fix_pack = 6;
    }
    else audit(AUDIT_LISTEN_NOT_VULN, app_name, port, ver);
    
    # Breakdown the version into components.
    version = eregmatch(string:ver, pattern:"^((?:\d+\.){1,}\d+)(?: FP(\d+))?$");
    if (isnull(version)) audit(AUDIT_UNKNOWN_APP_VER, app_name);
    
    # Use 0 if no FP number. Version number itself was
    # checked for in the granularity check.
    if (!version[2]) version[2] = 0;
    else version[2] = int(version[2]);
    
    # Compare current to fix and report as needed.
    if (
      ver_compare(ver:version[1], fix:fix_ver, strict:FALSE) < 1 &&
      version[2] < fix_pack
    )
    {
      security_report_v4(
        port:port,
        severity:SECURITY_WARNING,
        extra:
          '\n' +
          '\n  Installed version : ' + ver +
          '\n  Fixed version     : ' + fix +
          '\n'
      );
    }
    else audit(AUDIT_LISTEN_NOT_VULN, app_name, port, ver);
    
  • NASL familyMisc.
    NASL idDOMINO_8_5_3FP6_IF13.NASL
    descriptionAccording to its banner, the version of IBM Domino (formerly IBM Lotus Domino) running on the remote host is 8.5.x prior to 8.5.3 Fix Pack 6 (FP6) Interim Fix 13 (IF13). It is, therefore, affected by the following vulnerabilities : - Multiple heap-based buffer overflow conditions exist in the KeyView PDF filter when parsing a PDF document due to improper validation of user-supplied input. An unauthenticated, remote attacker can exploit these, by convincing a user to open a specially crafted PDF document, to cause a denial of service condition or the execution of arbitrary code. (CVE-2016-0277, CVE-2016-0278, CVE-2016-0279, CVE-2016-0301) - A security restriction bypass vulnerability exists in the remote console due to an error that occurs when an unspecified unsupported configuration is used involving UNC share path names. An unauthenticated, remote attacker can exploit this to bypass authentication and possibly execute arbitrary code with SYSTEM privileges. (CVE-2016-0304)
    last seen2020-06-01
    modified2020-06-02
    plugin id92786
    published2016-08-08
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/92786
    titleIBM Domino 8.5.x < 8.5.3 Fix Pack 6 Interim Fix 13 Multiple Vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(92786);
      script_version("1.6");
      script_cvs_date("Date: 2019/11/14");
    
      script_cve_id(
        "CVE-2016-0277",
        "CVE-2016-0278",
        "CVE-2016-0279",
        "CVE-2016-0301",
        "CVE-2016-0304"
      );
      script_bugtraq_id(
        90804,
        91098,
        91099,
        91142,
        91149
      );
    
      script_name(english:"IBM Domino 8.5.x < 8.5.3 Fix Pack 6 Interim Fix 13 Multiple Vulnerabilities");
      script_summary(english:"Checks the version of IBM Domino.");
    
      script_set_attribute(attribute:"synopsis", value:
    "A business collaboration application running on the remote host is
    affected by multiple vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "According to its banner, the version of IBM Domino (formerly IBM
    Lotus Domino) running on the remote host is 8.5.x prior to 8.5.3 Fix
    Pack 6 (FP6) Interim Fix 13 (IF13). It is, therefore, affected by the
    following vulnerabilities :
    
      - Multiple heap-based buffer overflow conditions exist in
        the KeyView PDF filter when parsing a PDF document due
        to improper validation of user-supplied input. An
        unauthenticated, remote attacker can exploit these, by
        convincing a user to open a specially crafted PDF
        document, to cause a denial of service condition or the
        execution of arbitrary code. (CVE-2016-0277,
        CVE-2016-0278, CVE-2016-0279, CVE-2016-0301)
    
      - A security restriction bypass vulnerability exists in
        the remote console due to an error that occurs when an
        unspecified unsupported configuration is used involving
        UNC share path names. An unauthenticated, remote
        attacker can exploit this to bypass authentication and
        possibly execute arbitrary code with SYSTEM privileges.
        (CVE-2016-0304)");
      script_set_attribute(attribute:"see_also", value:"https://www-01.ibm.com/support/docview.wss?uid=swg21983292");
      script_set_attribute(attribute:"see_also", value:"https://www-01.ibm.com/support/docview.wss?uid=swg21983328");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to IBM Domino version 8.5.3 FP6 IF13 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/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:"cvss_score_source", value:"CVE-2016-0304");
    
      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:"2016/06/07");
      script_set_attribute(attribute:"patch_publication_date", value:"2016/06/07");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/08/08");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:ibm:domino");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:ibm:lotus_domino");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("domino_installed.nasl");
      script_require_keys("Domino/Version", "Settings/ParanoidReport");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    
    app_name = "IBM Domino";
    ver = get_kb_item_or_exit("Domino/Version");
    port = get_kb_item("Domino/Version_provided_by_port");
    if (!port) port = 0;
    version = NULL;
    fix = NULL;
    fix_ver = NULL;
    fix_pack = NULL;
    hotfix = NULL;
    
    # Do not have data on special fixes
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    # Ensure sufficient granularity
    if (ver !~ "^(\d+\.){1,}\d+.*$") audit(AUDIT_VER_NOT_GRANULAR, app_name, port, ver);
    
    # Only check for 8.5.0.x through 8.5.3.x versions
    if (ver =~ "^8\.5\.[0-3]($|[^0-9])")
    {
      fix = "8.5.3 FP6 IF13";
      fix_ver = "8.5.3";
      fix_pack = 6;
      hotfix = 2698;
    }
    else audit(AUDIT_LISTEN_NOT_VULN, app_name, port, ver);
    
    # Breakdown the version into components.
    version = eregmatch(string:ver, pattern:"^((?:\d+\.){1,}\d+)(?: FP(\d+))?(?: HF(\d+))?$");
    if (isnull(version)) audit(AUDIT_UNKNOWN_APP_VER, app_name);
    
    # Use 0 as a placeholder if no FP or HF. Version number itself was
    # checked for in the granularity check.
    if (!version[2]) version[2] = 0;
    else version[2] = int(version[2]);
    if (!version[3]) version[3] = 0;
    else version[3] = int(version[3]);
    
    # Compare current to fix and report as needed.
    if (
      ver_compare(ver:version[1], fix:fix_ver, strict:FALSE) == -1 ||
      (ver_compare(ver:version[1], fix:fix_ver, strict:FALSE) == 0  && version[2] < fix_pack) ||
      (ver_compare(ver:version[1], fix:fix_ver, strict:FALSE) == 0  && version[2] == fix_pack && version[3] < hotfix)
    )
    {
      security_report_v4(
        port:port,
        severity:SECURITY_WARNING,
        extra:
          '\n' +
          '\n  Installed version : ' + ver +
          '\n  Fixed version     : ' + fix +
          '\n'
      );
    }
    else audit(AUDIT_LISTEN_NOT_VULN, app_name, port, ver);
    

Seebug

bulletinFamilyexploit
description### Summary A stack overflow vulnerability present in the PDF filter of KeyView as used by Domino can lead to process crash and possible arbitrary code execution. ### Tested Versions KeyView 10.16 as used by IBM Domino 9.0.1 ### Product URLs http://www-03.ibm.com/software/products/en/ibmdomino ### Details While parsing a specially crafted PDF file, a user controlled length field is used in a write loop with fixed destination size leading to a stack based buffer overflow. The vulnerability is triggered while parsing the PDF file that specifies an encrypted stream. As per the PDF specification, the Length value specifies the key `length` and is at most 16 bytes long. In the vulnerable function a stack buffer 16 bytes in length is reserved, but unchecked `Length` value is used during the copy operation which allows adjacent stack data to be overwritten, including the return address. The minimized test case that triggers the vulnerability is as follows: ``` %PDF-1.4 trailer <</Size 9 /Root 1 0 R /Encrypt 8 0 R 8 0 obj<< /Length 768 /Filter/Standard /Type/Catalog /O (41414141414141414141414141414141) /U (42424242424242424242424242424242) /P 0 /R 3 >> >> obj<< >> endobj %%EOF ``` In the above test case, the PDF `trailer` specifies that object 8 is encrypted. Further, object 8 specifies that it is using a standard filter for encryption (`/Filter/Standard`) and is using a revision 3 (`/R 3`) of the algorithm. Owner password (`/O`) and user password ('/U'), as well as object type don't play a significant role in this test case. While parsing the supplied test case, the `CPDFConvertToUserPassword` function in `pdfsr.so` will be called. This function implements the algorithm for deriving the decryption key. The overflow happens in the following code (image base being 0xB79BA00): ``` .text:B79E97A5 loc_B79E97A5: .text:B79E97A5 movzx eax, [ebp+edx+var_40] [1] .text:B79E97AA xor eax, esi [2] .text:B79E97AC mov [ebp+edx+var_20], al [3] .text:B79E97B0 add edx, 1 .text:B79E97B3 .text:B79E97B3 loc_B79E97B3: .text:B79E97B3 mov ecx, [ebp+var_3E0] .text:B79E97B9 mov eax, [ecx+13CCh] .text:B79E97BF cmp edx, eax [4] .text:B79E97C1 jl short loc_B79E97A5 ``` In the above code, `edx` serves as a counter. At [1], a byte is zero extended from a stack based buffer, is xored with `esi` at [2] and written to a stack buffer at [3]. The value of `esi` comes from an outer loop counter, starts at 19 and is decreased untill 0. At [4], the counter in `edx` is compared against a maximum value in `eax` which comes straight from the `Length` value divided by 8. To reiterate, the PDF specification states that `Length` will be at most 128 bits, so the maximum value in `eax` should be 16. Appropriate ly, 16 bytes are allocated for `var_20` buffer. If the value of `Length` is more, a buffer overflow will occur, overwriting the adjacent stack memory. The supplied test case triggers the vulnerability and leads to a crash as the buffer overflow overwrites the return address as well as the stack cookie present on the stack. There are two mitigating factors that lower the chance of successful exploitation of this vulnerability. First, the function is protected with a stack cookie making a straight forward return address overwrite difficult. And second, the bytes that end up overflowing the buffer are constant. To elaborate on the second point, a shortened pseudo code of the algorithm follows: ``` if Revision == 3: if len(UserPassword) > 0: if len(UserPassword) < 32: #add padding to UserPassword else: #UserPassword = padding UserPassword = md5(UserPassword) if Revision == 3: for i in range(50): UserPassword = md5(UserPassword) for esi in range(13): for edx in range(Length/8): key[edx] = UserPassword[edx] ^ esi #here is the overflow initialize_arc4_key(key) ``` As can be seen from the pseudocode above, algorithm revision must be set to 3. Also, in examined use cases of this function, the `UserPassword` will always be blank, length 0, meaning that the UserPassword will be initialized to the fixed value of padding which is equal to magic value "28bf4e5e4e758a4164004e56fffa01082e2e00b6d0683e802f0ca9fe6453697a" that comes from PDF specification. This means that the attacker has limited control over overflowing bytes as it always depends on this fixed string (51 iterations of md5 of it, to be precise) and past contents of the stack. By controlling the size of the overwrite, data past the stack cookie and return address can be overwritten potentially leading to further abuse in certain circumstances. Detection of PDF files specifically crafted to trigger this vulnerability can be based on the presence of objects encrypted with revision 3 of the encryption algorithm (the exact algorithm is specified in PDF specification version 1.4) with abnormally, illegally, large `Length` value. ### Exploit Proof-of-Concept The vulnerability can be triggered with the supplied test case in the `filter` standalone KeyView binary shipped with IBM Domino, or by sending it as an attachment with an email to a Domino mail server. Timeline * 2016-02-09 - Vendor Notification * 2016-06-08 – Public Disclosure
idSSV:96761
last seen2017-11-19
modified2017-10-20
published2017-10-20
reporterRoot
titleIBM Domino KeyView PDF Filter Encrypted Stream Code Execution Vulnerability(CVE-2016-0277)

Talos

idTALOS-2016-0089
last seen2019-05-29
published2016-06-08
reporterTalos Intelligence
sourcehttp://www.talosintelligence.com/vulnerability_reports/TALOS-2016-0089
titleIBM Domino KeyView PDF Filter Encrypted Stream Code Execution Vulnerability