K03125360: F5 iRules ‘RESOLV::lookup’ command vulnerability CVE-2020-5941
Original Publication Date: Nov 03, 2020
Security Advisory Description
Using the RESOLV::lookup command within an iRule may cause the Traffic Management Microkernel (TMM) to generate a core file and restart. This issue occurs when data exceeding the maximum limit of a host name passes to the RESOLV::lookup command.(CVE-2020-5941)
Impact
An authenticated attacker may be able to store JavaScript, which is executed when another authenticated user accesses the Configuration utility. If the victim is an administrator user with Advanced Shell (bash) access, an attacker can use Remote Code Execution to leverage a successful exploit of this vulnerability into a complete compromise of the BIG-IP system. All authenticated users can store this attack, regardless of role.
Security Advisory Status
F5 Product Development has assigned ID 814953 (BIG-IP) to this vulnerability.
To determine if your product and version have been evaluated for this vulnerability, refer to the (Applies to (see versions) box. To determine if your release is known to be vulnerable, the components or features that are affected by the vulnerability, and for information about releases, point releases, or hotfixes that address the vulnerability, refer to F5’s security advisory below. For more information about security advisory versioning, refer to K51812227: Understanding security advisory versioning.
Affected and fixed versions: F5 maintains the authoritative version matrix for this advisory, and it changes over time. For the current list of affected and fixed versions, see F5’s security advisory K03125360.
Security Advisory Recommended Actions
If you are running a version listed in the Versions known to be vulnerable column, you can eliminate this vulnerability by upgrading to a version listed in the Fixes introduced in column. If the table lists only an older version than what you are currently running, or does not list a non-vulnerable version, then no upgrade candidate currently exists.
Mitigation
To mitigate this vulnerability, you can validate all limits of untrusted data passed into the RESOLV::lookup command in the affected iRule. F5 recommends that you reject and not pass any string that has 254 or more characters to the RESOLV::lookup command.
For example, the following sample displays the string length check in an iRule:
# this pseudo code shows a general way to check for the string length and handle failure.
# the main idea is to check string length before sending to resolv::lookup command.
when SOME_GENERAL_EVENT {
set string_check [string tolower [HTTP::uri]]
if {([string length $string_check] > 253)} {
log local0. “Hostname Length Check FAIL”
# HANDLE FAILURE
}
else {
log local0. “Hostname Length Check PASS”
# PROCEED TO resolv::lookup
}
}
Supplemental Information
- K41942608: Overview of security advisory articles
- K4602: Overview of the F5 security vulnerability response policy
- K4918: Overview of the F5 critical issue hotfix policy
- K9502: BIG-IP hotfix and point release matrix
- K13123: Managing BIG-IP product hotfixes (11.x – 16.x)
- K48955220: Installing an OPSWAT Endpoint Security update on BIG-IP APM systems (11.4.x and later)
- K167: Downloading software and firmware from F5
- K9970: Subscribing to email notifications regarding F5 products
- K9957: Creating a custom RSS feed to view new and updated documents