Cisco IOS and IOS XE Software Quality of Service Remote Code Execution

Authors:Cisco ASA           Risk:Critical

CVE:CVE-2018-0151          0day:Remote Code Execution 

0day -id:0DAY-176111        Date:2018-04-27

Summary

A vulnerability in the quality of service (QoS) subsystem of Cisco IOS Software and Cisco IOS XE Software could allow an unauthenticated, remote attacker to cause a denial of service (DoS) condition or execute arbitrary code with elevated privileges.

The vulnerability is due to incorrect bounds checking of certain values in packets that are destined for UDP port 18999 of an affected device. An attacker could exploit this vulnerability by sending malicious packets to an affected device. When the packets are processed, an exploitable buffer overflow condition may occur. A successful exploit could allow the attacker to execute arbitrary code on the affected device with elevated privileges. The attacker could also leverage this vulnerability to cause the device to reload, causing a temporary DoS condition while the device is reloading.

The malicious packets must be destined to and processed by an affected device. Traffic transiting a device will not trigger the vulnerability.

Cisco has released software updates that address this vulnerability. There are workarounds for most affected Cisco products that address this vulnerability.

This advisory is part of the March 28, 2018, release of the Cisco IOS and IOS XE Software Security Advisory Bundled Publication, which includes 20 Cisco Security Advisories that describe 22 vulnerabilities. For a complete list of the advisories and links to them, see Cisco Event Response: March 2018 Semiannual Cisco IOS and IOS XE Software Security Advisory Bundled Publication.

Affected Products

Vulnerable Products

This vulnerability affects Cisco devices that are running a vulnerable release of Cisco IOS Software or Cisco IOS XE Software.

For information about which Cisco IOS and IOS XE Software releases are vulnerable, see the Fixed Software section of this advisory.

Assessing a Device

To determine whether a device that is running Cisco IOS Software or Cisco IOS XE Software may be affected by this vulnerability, administrators can log in to the device and use the show udpcommand in the CLI. On devices that do not support the show udp command, the show ip sockets command may be used as an alternative.

The device may be affected by this vulnerability if the show udp command returns output similar to the following example:

Router> show udp

Proto  Remote   Port   Local   Port  In Out  Stat TTY OutputIF
17     0.0.0.0   0    --any--  18999  0   0    11   0

The Adaptive QoS for Dynamic Multipoint VPN (DMVPN) feature of Cisco IOS Software and Cisco IOS XE Software uses UDP port 18999 and may be open due to the provisioning of this feature on unaffected platforms. If UDP port 18999 is bound to a listening port on a device, use the Cisco IOS Software Checker to determine whether the device is running a vulnerable software release.

Determining the Cisco IOS Software Release

To determine which Cisco IOS Software release is running on a device, administrators can log in to the device, use the show version command in the CLI, and then refer to the system banner that appears. If the device is running Cisco IOS Software, the system banner displays text similar to Cisco Internetwork Operating System Software or Cisco IOS Software. The banner also displays the installed image name in parentheses, followed by the Cisco IOS Software release number and release name. Some Cisco devices do not support the show version command or may provide different output.

The following example shows the output of the command for a device that is running Cisco IOS Software Release 15.5(2)T1 and has an installed image name of C2951-UNIVERSALK9-M:

Router> show version

Cisco IOS Software, C2951 Software (C2951-UNIVERSALK9-M), Version 15.5(2)T1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Mon 22-Jun-15 09:32 by prod_rel_team
.
.
.

For information about the naming and numbering conventions for Cisco IOS Software releases, see the Cisco IOS and NX-OS Software Reference Guide.

Determining the Cisco IOS XE Software Release

To determine which Cisco IOS XE Software release is running on a device, administrators can log in to the device, use the show version command in the CLI, and then refer to the system banner that appears. If the device is running Cisco IOS XE Software, the system banner displays Cisco IOS SoftwareCisco IOS XE Software, or similar text.

The following example shows the output of the command for a device that is running Cisco IOS XE Software Release 16.2.1 and has an installed image name of CAT3K_CAA-UNIVERSALK9-M:

ios-xe-device# show version

Cisco IOS Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version Denali 16.2.1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Sun 27-Mar-16 21:47 by mcpre
.
.
.
  • For information about the naming and numbering conventions for Cisco IOS XE Software releases, see the Cisco IOS and NX-OS Software Reference Guide.

    Products Confirmed Not Vulnerable

    No other Cisco products are currently known to be affected by this vulnerability.

    Cisco has confirmed that this vulnerability does not affect Cisco IOS XR Software or Cisco NX-OS Software.

Workarounds

  • The following workaround is applicable on devices that support configurable inbound ports for Control Plane Policing (CoPP). Some families of Cisco devices such as the Cisco ASR 900 Series support CoPP only on specific ports and protocols. On these platforms, no workaround is available and customers should upgrade to a fixed software version.

    Customers who do not use the Adaptive QoS for DMVPN feature can deny all traffic destined to UDP port 18999 on an affected device by using a CoPP policy similar to the following:

    ! -- ACL for CoPP Undesirable UDP class-map
    ! -- Ignore fragments to prevent them from being misclassified by the policy
      access-list 199 deny ip any any fragments
    ! -- Classify traffic destined to UDP Port 18999 so that we can drop it prior to being processed
      access-list 199 permit udp any any eq 18999
    
    ! -- CoPP Undesirable UDP class-map
    class-map match-all undesirable-udp
     match access-group 199
    
    ! -- Undesirable UDP Policy Map
    policy-map drop-udp
     class undesirable-udp
      drop
    
    ! -- Apply Undesirable UDP policy Map
    control-plane
     service-policy input drop-udp

    On platforms that do not support the drop keyword within the Policy Map, customers may consider using a policy similar to the following as an alternative:

    ! -- ACL for CoPP Undesirable UDP class-map
    ! -- Ignore fragments to prevent them from being misclassified by the policy
      access-list 199 deny ip any any fragments
    ! -- Classify traffic destined to UDP Port 18999 so that we can drop it prior to being processed
      access-list 199 permit udp any any eq 18999
    
    ! -- CoPP Undesirable UDP class-map
    class-map match-all undesirable-udp
     match access-group 199
    
    ! -- Undesirable UDP Policy Map - Drop on Police Rate
    policy-map drop-udp
     class undesirable-udp
      police rate 8000
       conform-action drop
       exceed-action drop
       violate-action drop
    
    ! -- Apply Undesirable UDP policy Map
    control-plane
     service-policy input drop-udp

    If the Adaptive QoS for DMVPN feature is later configured, the device must be upgraded to an unaffected release of Cisco IOS Software or Cisco IOS XE Software and the CoPP policy must be removed.

    Customers integrating this workaround into their environment are encouraged to test the adaptation in their lab prior to deployment and to reference the CoPP Best Practice Document at the following link: https://www.cisco.com/c/en/us/about/security-center/copp-best-practices.html

    Cisco IOS and IOS XE Software

    To help customers determine their exposure to vulnerabilities in Cisco IOS and IOS XE Software, Cisco provides a tool, the Cisco IOS Software Checker, that identifies any Cisco Security Advisories that impact a specific software release and the earliest release that fixes the vulnerabilities described in each advisory (“First Fixed”). If applicable, the tool also returns the earliest release that fixes all the vulnerabilities described in all the advisories identified (“Combined First Fixed”).

    Customers can use this tool to perform the following tasks:

    • Initiate a search by choosing one or more releases from a drop-down list or uploading a file from a local system for the tool to parse
    • Enter the output of the show version command for the tool to parse
    • Create a custom search by including all previously published Cisco Security Advisories, a specific advisory, or all advisories in the most recent bundled publication

    To determine whether a release is affected by any published Cisco Security Advisory, use the Cisco IOS Software Checker on Cisco.com or enter a Cisco IOS Software or Cisco IOS XE Software release—for example, 15.1(4)M2 or 3.13.8S—in the following field:

     

    For a mapping of Cisco IOS XE Software releases to Cisco IOS Software releases, refer to the Cisco IOS XE 2 Release NotesCisco IOS XE 3S Release Notes, or Cisco IOS XE 3SG Release Notes, depending on the Cisco IOS XE Software release.

    Exploitation and Public Announcements
    • The Cisco Product Security Incident Response Team (PSIRT) is not aware of any public announcements or malicious use of the vulnerability that is described in this advisory.

    Source
    • This vulnerability was found during internal security testing.

      Revision History

      • Version Description Section Status Date
        1.4 Updated to indicate that some Cisco platforms may not contain the required features to implement the workaround for this vulnerability. Added an alternative command to identify listening ports. Addressed spelling error. Summary, Assessing a Device, and Workarounds Final 2018-April-27
        1.3 Updated metadata. Final 2018-April-26

Leave a Reply