#!/bin/bash # Copyright 2026 Tailwind Resource Group # SPDX-License-Identifier: Apache-2.0 # Provided as is, with no warranty. License: https://everythingsfine.io/license/ # # bigip_k000164058_check.sh # # Purpose: compare the configuration of one BIG-IP system with the conditions # in the BIG-IP articles of F5 article K000164058, Out-of-band Security # Notification (November 18, 2026). # # Run as root in the bash shell of the BIG-IP system. The script reads the # configuration with tmsh. It changes nothing. # # Result: one line for each article. # FOUND the configuration agrees with the condition in the article # NOT FOUND the script did not find the condition # FIXED the software has the correction for the article # ALL the article applies to all configurations of this version # This script is not from F5. A NOT FOUND line is not a statement that the # system is safe. Not tested: BIG-IP 17.1.x and 21.1.x. t() { tmsh -q -c "cd /; $1" 2>/dev/null; } line() { printf '%-11s %-15s %-10s %s\n' "$1" "$2" "$3" "$4"; } ver=$(tmsh -q show sys version 2>/dev/null | awk '$1 == "Version" { print $2; exit }') build=$(tmsh -q show sys version 2>/dev/null | awk '$1 == "Build" { print $2; exit }') echo "BIG-IP $ver build $build" # 1 = this build is one of the engineering hotfixes of November 18, 2026. ehf=0 case "$ver/$build" in 17.5.1.11/0.61.12 | 17.5.1.10/0.80.35 | 17.1.3.7/0.21.4 | 17.1.3.6/0.14.20 | 21.1.0.4/0.19.3) ehf=1 ;; esac # ge A B: true if version A is the same as B or later. ge() { [ "$(printf '%s\n%s\n' "$1" "$2" | sort -V | head -1)" = "$2" ]; } # rel F175 F171 F211: 1 = this version has a correction that F5 put in a # release. The arguments are the first fixed version of each branch. rel() { case "$ver" in 17.5.*) ge "$ver" "$1" && echo 1 || echo 0 ;; 17.1.*) ge "$ver" "$2" && echo 1 || echo 0 ;; 21.1.*) ge "$ver" "$3" && echo 1 || echo 0 ;; *) echo 2 ;; esac } case "$ver" in 17.5.* | 17.1.* | 21.1.*) ;; *) echo "F5 examined BIG-IP 17.1.x, 17.5.x and 21.1.x only. The lines below can be incorrect for this version." ;; esac agents=$(t "list apm policy agent recursive one-line") items=$(t "list apm policy policy-item recursive one-line") policies=$(t "list apm policy access-policy recursive one-line") prp=$(printf '%s\n' "$policies" | grep -E "type (per-rq-policy|subroutine)") virtuals=$(t "list ltm virtual recursive one-line") prp_virtuals=$(printf '%s\n' "$virtuals" | grep "per-flow-request-access-policy" \ | awk '{ for (i = 1; i <= NF; i++) if ($i == "per-flow-request-access-policy") print $3 " uses " $(i + 1) }') # in_prp TYPE: the agents of this type that are in a per-request policy or # in a subroutine. One line for each: "agent policy". in_prp() { local agent item pol for agent in $(printf '%s\n' "$agents" | awk -v ty="$1" '$4 == ty { print $5 }'); do item=$(printf '%s\n' "$items" | grep -F " $agent {" | awk '{ print $4 }' | head -1) [ -n "$item" ] || continue pol=$(printf '%s\n' "$prp" | grep -F " $item {" | awk '{ print $4 }' | head -1) [ -n "$pol" ] || continue echo "$agent $pol" done } # K000163937: Client Information agent in a per-request policy. if [ "$ehf" = 1 ]; then line K000163937 CVE-2026-123637 FIXED "This build is an engineering hotfix of November 18, 2026." else r=$(in_prp client-information) if [ -n "$r" ]; then line K000163937 CVE-2026-123637 FOUND "Client Information agent in a per-request policy:" printf '%s\n' "$r" | awk '{ print " agent " $1 " in " $2 }' echo " The article also names Endpoint Security agents. The script does not examine them." else line K000163937 CVE-2026-123637 "NOT FOUND" "No Client Information agent in a per-request policy." fi fi # K000163938: Logon Page in a per-request policy. if [ "$ehf" = 1 ]; then line K000163938 CVE-2026-125272 FIXED "This build is an engineering hotfix of November 18, 2026." else r=$(in_prp logon-page) if [ -n "$r" ]; then line K000163938 CVE-2026-125272 FOUND "Logon Page agent in a per-request policy:" printf '%s\n' "$r" | while read -r a p; do if printf '%s\n' "$agents" | grep -F " $a {" | grep "publish-credentials-prefix" | grep -qv "publish-credentials-prefix none"; then echo " agent $a in $p, with a credentials prefix" else echo " agent $a in $p, with no credentials prefix" fi done else line K000163938 CVE-2026-125272 "NOT FOUND" "No Logon Page agent in a per-request policy." fi fi # K000163939, K000163940, K000163941, K000163945, K000163946: iRule commands. rules=$(t "list ltm rule recursive" | awk ' /^ltm rule / { name = $3; next } /^[ \t]*#/ { next } /PSC::ip_address/ { print "PSC::ip_address " name } /MR::message[ \t]+route/ { print "MR::message_route " name } /GENERICMESSAGE::route/ { print "GENERICMESSAGE::route " name } /DNS::scrape/ { print "DNS::scrape " name } /PEM::subscriber/ { print "PEM::subscriber " name }' | sort -u) irule() { local article="$1" cve="$2" key="$3" text="$4" names name used any=0 out="" if [ "$ehf" = 1 ]; then line "$article" "$cve" FIXED "This build is an engineering hotfix of November 18, 2026." return fi names=$(printf '%s\n' "$rules" | awk -v k="$key" '$1 == k { print $2 }') for name in $names; do used=$(printf '%s\n' "$virtuals" | awk -v r="$name" '{ on = 0 for (i = 1; i <= NF; i++) { if ($i == "rules" && $(i + 1) == "{") { on = 1; i++; continue } if (on && $i == "}") break if (on && $i == r) { print $3; break } } }' | tr '\n' ' ') if [ -n "$used" ]; then any=1 out="$out iRule $name on virtual server: $used"$'\n' else out="$out iRule $name has the command. It is not on a virtual server."$'\n' fi done if [ "$any" = 1 ]; then line "$article" "$cve" FOUND "iRule with $text on a virtual server:" else line "$article" "$cve" "NOT FOUND" "No iRule with $text on a virtual server." fi printf '%s' "$out" } irule K000163939 CVE-2026-120285 "PSC::ip_address" "PSC::ip_address" irule K000163940 CVE-2026-120292 "MR::message_route" "MR::message route" irule K000163941 CVE-2026-116953 "GENERICMESSAGE::route" "GENERICMESSAGE::route" irule K000163945 CVE-2026-120722 "DNS::scrape" "DNS::scrape" irule K000163946 CVE-2026-121805 "PEM::subscriber" "PEM::subscriber" # K000163942: SAML service provider. saml=$(printf '%s\n' "$agents" | awk '$4 == "aaa-saml" { print $5 }' | tr '\n' ' ') if [ "$ehf" = 1 ]; then line K000163942 CVE-2026-126822 FIXED "This build is an engineering hotfix of November 18, 2026." elif [ -n "$saml" ]; then line K000163942 CVE-2026-126822 FOUND "SAML Auth agent in an access policy: $saml" else line K000163942 CVE-2026-126822 "NOT FOUND" "No SAML Auth agent." fi # K000163943: SAML service provider with encrypted assertions. enc=$(t "list apm aaa saml recursive one-line" | grep "want-assertion-encrypted true" | awk '{ print $4 }' | tr '\n' ' ') case "$(rel 17.5.1.10 17.1.3.6 21.1.0.3)" in 1) line K000163943 CVE-2026-126336 FIXED "F5 corrected this in a release that this version includes." ;; *) if [ -n "$enc" ]; then line K000163943 CVE-2026-126336 FOUND "SAML service provider with encrypted assertions: $enc" else line K000163943 CVE-2026-126336 "NOT FOUND" "No SAML service provider with encrypted assertions." fi ;; esac # K000163944: per-request policy and the tmm.access.policytrace key. trace=$(tmsh -q list sys db tmm.access.policytrace value 2>/dev/null | awk '$1 == "value" { gsub(/"/, "", $2); print $2 }') if [ "$ehf" = 1 ]; then line K000163944 CVE-2026-121812 FIXED "This build is an engineering hotfix of November 18, 2026." elif [ "$trace" = enable ] && [ -n "$prp_virtuals" ]; then line K000163944 CVE-2026-121812 FOUND "tmm.access.policytrace is enable, and a virtual server has a per-request policy." else line K000163944 CVE-2026-121812 "NOT FOUND" "tmm.access.policytrace is ${trace:-not known}." fi # K000163929 and K000163936: iControl. No configuration condition. case "$(rel 17.5.1.10 17.1.3.6 21.1.0.2)" in 1) line K000163929 CVE-2026-120718 FIXED "F5 corrected this in a release that this version includes." ;; *) line K000163929 CVE-2026-120718 ALL "iControl REST. See the article for the mitigation." ;; esac case "$(rel 17.5.1.10 17.1.3.6 21.1.0.3)" in 1) line K000163936 CVE-2026-125274 FIXED "F5 corrected this in a release that this version includes." ;; *) line K000163936 CVE-2026-125274 ALL "iControl SOAP. See the article for the mitigation." ;; esac if [ -n "$prp_virtuals" ]; then echo "Virtual servers with a per-request policy:" printf '%s\n' "$prp_virtuals" | sed 's/^/ /' fi