|
| 1 | +from comfy import high |
| 2 | + |
| 3 | + |
| 4 | +@high( |
| 5 | + name='rule_cve202220683', |
| 6 | + platform=['cisco_xe'], |
| 7 | + commands=dict( |
| 8 | + show_version='show version', |
| 9 | + check_platform='show inventory | include Chassis', |
| 10 | + check_fnf='show running-config | include flow|performance monitor' |
| 11 | + ), |
| 12 | +) |
| 13 | +def rule_cve202220683(configuration, commands, device, devices): |
| 14 | + """ |
| 15 | + This rule checks for the CVE-2022-20683 vulnerability in Cisco IOS XE Software. |
| 16 | + The vulnerability is due to insufficient packet verification for traffic inspected by the AVC feature |
| 17 | + in Cisco Catalyst 9800 Series Wireless Controllers. An unauthenticated, remote attacker could exploit |
| 18 | + this vulnerability by sending crafted packets from the wired network to a wireless client, causing |
| 19 | + the wireless controller to reload and resulting in a denial of service (DoS) condition. |
| 20 | + """ |
| 21 | + # Extract the platform information |
| 22 | + platform_output = commands.check_platform |
| 23 | + |
| 24 | + # Check if the device is a Catalyst 9800 Series |
| 25 | + is_cat9800 = 'C9800' in platform_output |
| 26 | + |
| 27 | + # If not a Catalyst 9800 device, it's not vulnerable |
| 28 | + if not is_cat9800: |
| 29 | + return |
| 30 | + |
| 31 | + # Extract the output of the command to check AVC/FNF configuration |
| 32 | + fnf_output = commands.check_fnf |
| 33 | + |
| 34 | + # Check if AVC/FNF is configured |
| 35 | + fnf_configured = any(feature in fnf_output for feature in ['flow', 'performance monitor']) |
| 36 | + |
| 37 | + # Device is vulnerable if it's a Cat9800 and has AVC/FNF configured |
| 38 | + is_vulnerable = is_cat9800 and fnf_configured |
| 39 | + |
| 40 | + # Assert that the device is not vulnerable |
| 41 | + assert not is_vulnerable, ( |
| 42 | + f"Device {device.name} is vulnerable to CVE-2022-20683. " |
| 43 | + "The device is a Catalyst 9800 Series wireless controller with AVC/FNF configured, " |
| 44 | + "which could allow an unauthenticated attacker to cause a denial of service through crafted packets. " |
| 45 | + "For more information, see" |
| 46 | + "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-c9800-fnf-dos-bOL5vLge" |
| 47 | + ) |
0 commit comments