Skip to content

cisco_ios 2022 CVEs #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 58 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
753fd1f
Add examples_extended folder for additional test cases
May 15, 2025
7bfb216
Add SNMP trap host validation test for Cisco IOS
May 15, 2025
0660081
Add SNMP trap host validation test for Cisco IOS
May 15, 2025
3a6eb62
Add SNMP trap host validation test for Cisco IOS
May 15, 2025
5d0bfec
Add HA BGP prefix consistency test for Fortinet
May 15, 2025
0658570
Updated README with SNMP and HA BGP example descriptions
May 15, 2025
eff4e45
Added .metadata file
May 15, 2025
7ca5b9b
updated .metadata file info
May 15, 2025
f7c6201
Add SNMP config-based host validation test for IOS and Arista
May 15, 2025
46a3511
snmp config based test and corresponding README.md
May 15, 2025
c91430b
Merge branch 'main' into update-example2-final
netpicker May 15, 2025
47073eb
updated snmp_config_hosts.. to fix flake errors
May 15, 2025
167d010
fortinet CIS folder and couple of rules added
May 15, 2025
fbbca92
fix: remove trailing whitespace for flake8 compliance (W293)
May 15, 2025
1c185d0
Rename folder from cisco_wireless to cisco_wlc to match test structure
May 16, 2025
342b519
updated CIS/cisco_wlc/rule_112_configure_an_authorized_ip_address_for…
May 16, 2025
7013b54
Merge branch 'main' into update-example2-final
netpicker May 16, 2025
f157fa3
Fix flake8 W391: remove blank line at end of file
May 16, 2025
1a5391e
using str for rule_112_configure_an_authorized_ip_address_for_ntp_ser…
May 16, 2025
03bd7ae
updated test file for rule_15_ensure_webmode_is_disabled
May 16, 2025
32afaa6
Moved CVE 2023-20273 test and added matching rule
May 16, 2025
8b74019
Fix CVE-2023-20273 rule name mismatch between Python and YAML
May 16, 2025
51cc6c6
Fix CVE-2023-20273 rule name mismatch between Python and YAML-2
May 16, 2025
879f0bb
cve 2021 ios cve20211377.py
mailsanjayhere May 20, 2025
2cccf97
fixed mixxing blank lines in CVEs
mailsanjayhere May 20, 2025
dc63a32
modified cve
mailsanjayhere May 20, 2025
b9b7264
Merge branch 'main' into update-example2-final
netpicker May 20, 2025
0a73c0b
broke the long line
mailsanjayhere May 20, 2025
3bdef9b
added 2021 ios cves
mailsanjayhere May 20, 2025
d8adfe7
ios-xe cves 2021
mailsanjayhere May 20, 2025
f43eff4
Fix flake8 errors and remove broken CVE script
mailsanjayhere May 20, 2025
5511575
fixed cve20211442.py
mailsanjayhere May 20, 2025
8fa2e65
fixed cve20211442.py
mailsanjayhere May 20, 2025
fec5f75
fixed cve20211442.py
mailsanjayhere May 20, 2025
e9f89ae
fixed cve20211442.py
mailsanjayhere May 20, 2025
25664d5
xr 2021 cves
mailsanjayhere May 21, 2025
6199287
xr 2021 cves
mailsanjayhere May 21, 2025
555dad2
Renamed ios-xe to cisco_xe and ios to cisco_ios
mailsanjayhere May 21, 2025
ae565e9
Resolved merge conflicts: retained updated CVE files in cisco_ios
mailsanjayhere May 21, 2025
87e8a6c
Remove ios-xe
mailsanjayhere May 21, 2025
7aec641
added 3rd rule for cis fortinet
mailsanjayhere May 22, 2025
6dced5a
added 3rd rule for cis fortinet
mailsanjayhere May 22, 2025
c6095f6
modified: examples_extended/ha_bgp_prefix_consistency.py
mailsanjayhere May 22, 2025
200bf30
Update cisco_xr cve
mailsanjayhere May 22, 2025
395f9b0
Update cisco_xr cve
mailsanjayhere May 22, 2025
f6a2b41
Update cisco_xr cve
mailsanjayhere May 22, 2025
8f9c11c
Update cisco_xr cve
mailsanjayhere May 22, 2025
c25af46
Update cisco_xr cve
mailsanjayhere May 22, 2025
8cf4f5e
nexus os CVE 2021
mailsanjayhere May 23, 2025
5cb9383
nexus os CVE 2021
mailsanjayhere May 23, 2025
0af8014
ios-xr 2021 cves corrected versions
mailsanjayhere May 23, 2025
d224a2d
Merge branch 'main' into update-example2-final
netpicker May 23, 2025
145a58f
ios-xr 2021 cves corrected versions
mailsanjayhere May 23, 2025
59876d7
cisco_ios 2022 CVEs
mailsanjayhere May 23, 2025
de8372a
cisco_ios 2022 CVEs
mailsanjayhere May 23, 2025
354d7d3
cisco_ios 2022 CVEs
mailsanjayhere May 23, 2025
f638e9b
cisco_ios 2022 CVEs
mailsanjayhere May 23, 2025
d237ee2
arista 2021 cves
mailsanjayhere Jun 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added CVEasy/Arista/2021/__init__.py
Empty file.
70 changes: 70 additions & 0 deletions CVEasy/Arista/2021/cve202128496.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
from comfy import high


@high(
name='rule_cve202128496',
platform=['arista_eos'],
commands=dict(
show_version='show version',
show_bfd='show running-config | section bfd',
show_eapi='show management api http-commands'
),
)
def rule_cve202128496(configuration, commands, device, devices):
"""
This rule checks for CVE-2021-28496 vulnerability in Arista EOS devices.
The vulnerability allows BFD shared secret passwords to be leaked when displaying output
over eAPI or other JSON outputs to authenticated users on the device.
"""
# Extract the version information from the command output
version_output = commands.show_version

# List of vulnerable software versions
vulnerable_versions = [
# 4.22.x versions (all releases)
'4.22.0', '4.22.12',
# 4.23.x versions (up to 4.23.9)
'4.23.0', '4.23.9',
# 4.24.x versions (up to 4.24.7)
'4.24.0', '4.24.7',
# 4.25.x versions (up to 4.25.4)
'4.25.0', '4.25.4',
# 4.26.x versions (up to 4.26.1)
'4.26.0', '4.26.1'
]

# Check if the current device's software version is in the list of vulnerable versions
version_vulnerable = any(version in version_output for version in vulnerable_versions)

# If version is not vulnerable, no need to check further
if not version_vulnerable:
return

# Check if BFD is configured with shared secret profiles
bfd_config = commands.show_bfd
has_bfd_secrets = 'profile' in bfd_config and 'key-id' in bfd_config

# Check if eAPI is enabled
eapi_config = commands.show_eapi
eapi_enabled = 'enabled' in eapi_config.lower()

# Device is vulnerable if using BFD shared secrets and eAPI is enabled
is_vulnerable = has_bfd_secrets and eapi_enabled

# Assert that the device is not vulnerable
assert not is_vulnerable, (
f"Device {device.name} is vulnerable to CVE-2021-28496. "
"The device is running a vulnerable version AND has BFD shared secret profiles configured "
"with eAPI enabled, which could expose sensitive password information. "
"Recommended fixes:\n"
"1. Upgrade to one of the following fixed versions:\n"
" * 4.23.10 or later for 4.23.x train\n"
" * 4.24.8 or later for 4.24.x train\n"
" * 4.25.5 or later for 4.25.x train\n"
" * 4.26.2 or later for 4.26.x train\n"
"2. Or apply the appropriate hotfix:\n"
" * For 4.22.0 - 4.25.0: SecurityAdvisory0069Hotfix-4.22-4.25.0.swix\n"
" * For 4.25.1 - 4.26.1: SecurityAdvisory0069Hotfix-4.25.1-4.26.1.swix\n"
"3. As a workaround, restrict access to CLI show commands using role-based authorization\n"
"For more information, see https://www.arista.com/en/support/advisories-notices/security-advisory/13243-security-advisory-0069"
)
77 changes: 77 additions & 0 deletions CVEasy/Arista/2021/cve202128500.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from comfy import high


@high(
name='rule_cve202128500',
platform=['arista_eos'],
commands=dict(
show_version='show version',
show_users='show running-config | section username',
show_agents='show running-config | include openconfig|terminattr'
),
)
def rule_cve202128500(configuration, commands, device, devices):
"""
This rule checks for CVE-2021-28500 vulnerability in Arista EOS devices.
The vulnerability allows unrestricted access to the device for local users with nopassword
configuration due to incorrect use of EOS's AAA APIs by OpenConfig and TerminAttr agents.
"""
# Extract the version information from the command output
version_output = commands.show_version

# List of vulnerable software versions
vulnerable_versions = [
# 4.20.x and earlier versions
'4.20.0', '4.20.15',
# 4.21.x versions
'4.21.0', '4.21.14M',
# 4.22.x versions
'4.22.0', '4.22.11M',
# 4.23.x versions
'4.23.0', '4.23.8M',
# 4.24.x versions
'4.24.0', '4.24.6M',
# 4.25.x versions
'4.25.0', '4.25.4M',
# 4.26.x versions
'4.26.0', '4.26.1F'
]

# Check if the current device's software version is in the list of vulnerable versions
version_vulnerable = any(version in version_output for version in vulnerable_versions)

# If version is not vulnerable, no need to check further
if not version_vulnerable:
return

# Check if any users are configured with nopassword
users_config = commands.show_users
has_nopassword_users = 'nopassword' in users_config

# Check if OpenConfig or TerminAttr agents are enabled
agents_config = commands.show_agents
agents_enabled = 'openconfig' in agents_config or 'terminattr' in agents_config

# Device is vulnerable if it has nopassword users and agents enabled
is_vulnerable = has_nopassword_users and agents_enabled

# Assert that the device is not vulnerable
assert not is_vulnerable, (
f"Device {device.name} is vulnerable to CVE-2021-28500. "
"The device is running a vulnerable version AND has local users with nopassword configuration "
"while OpenConfig/TerminAttr agents are enabled, which could allow unrestricted access. "
"Recommended fixes:\n"
"1. Upgrade to one of the following fixed versions:\n"
" * 4.26.2F or later for 4.26.x train\n"
" * 4.25.5M or later for 4.25.x train\n"
" * 4.24.7M or later for 4.24.x train\n"
" * 4.23.9M or later for 4.23.x train\n"
" * 4.22.12M or later for 4.22.x train\n"
" * 4.21.15M or later for 4.21.x train\n"
"2. Until upgrade is complete, implement these workarounds:\n"
" * Remove nopassword configuration for local users\n"
" * Or apply the appropriate hotfix:\n"
" - For 32-bit systems: SecurityAdvisory0071Hotfix.i386.swix\n"
" - For 64-bit systems: SecurityAdvisory0071Hotfix.x86_64.swix\n"
"For more information, see https://www.arista.com/en/support/advisories-notices/security-advisory/13449-security-advisory-0071"
)
62 changes: 62 additions & 0 deletions CVEasy/Arista/2021/cve202128501.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from comfy import high


@high(
name='rule_cve202128501',
platform=['arista_eos'],
commands=dict(
show_version='show version',
show_terminattr='show running-config | include terminattr',
show_openconfig='show running-config | include openconfig',
show_users='show running-config | section username'
),
)
def rule_cve202128501(configuration, commands, device, devices):
"""
This rule checks for CVE-2021-28501 vulnerability in Arista EOS devices.
The vulnerability allows unrestricted access to the device for local users with nopassword
configuration due to incorrect use of EOS's AAA APIs by OpenConfig and TerminAttr agents.
"""
# Extract the version information from the command output
version_output = commands.show_version

# List of vulnerable software versions
vulnerable_versions = [
# TerminAttr versions before 1.16.2
'1.15.0', '1.15.1', '1.15.2', '1.15.3',
'1.16.0', '1.16.1'
]

# Check if the current device's software version is in the list of vulnerable versions
version_vulnerable = any(version in version_output for version in vulnerable_versions)

# If version is not vulnerable, no need to check further
if not version_vulnerable:
return

# Check if TerminAttr or OpenConfig agents are enabled
terminattr_config = commands.show_terminattr
openconfig_config = commands.show_openconfig
agents_enabled = bool(terminattr_config or openconfig_config)

# Check if any users are configured with nopassword
users_config = commands.show_users
has_nopassword_users = 'nopassword' in users_config

# Device is vulnerable if agents are enabled and has nopassword users
is_vulnerable = agents_enabled and has_nopassword_users

# Assert that the device is not vulnerable
assert not is_vulnerable, (
f"Device {device.name} is vulnerable to CVE-2021-28501. "
"The device is running a vulnerable version of TerminAttr AND has local users with nopassword configuration "
"while OpenConfig/TerminAttr agents are enabled, which could allow unrestricted access. "
"Recommended fixes:\n"
"1. Upgrade to TerminAttr v1.16.2 or later\n"
"2. Until upgrade is complete, implement these workarounds:\n"
" * Disable OpenConfig gNMI/gNOI and OpenConfig RESTCONF and TerminAttr\n"
" * Or apply the appropriate hotfix with proxy service:\n"
" - For 32-bit systems: SecurityAdvisory0071Hotfix.i386.swix\n"
" - For 64-bit systems: SecurityAdvisory0071Hotfix.x86_64.swix\n"
"For more information, see https://www.arista.com/en/support/advisories-notices/security-advisory/13449-security-advisory-0071"
)
71 changes: 71 additions & 0 deletions CVEasy/Arista/2021/cve202128503.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from comfy import high


@high(
name='rule_cve202128503',
platform=['arista_eos'],
commands=dict(
show_version='show version',
show_eapi='show management api http-commands',
show_cert_auth='show running-config | include certificate user'
),
)
def rule_cve202128503(configuration, commands, device, devices):
"""
This rule checks for CVE-2021-28503 vulnerability in Arista EOS devices.
The vulnerability allows remote attackers to bypass authentication when certificate-based
authentication is used with eAPI, due to improper credential re-evaluation.
"""
# Extract the version information from the command output
version_output = commands.show_version

# List of vulnerable software versions
vulnerable_versions = [
# 4.23.x versions before 4.23.10
'4.23.0', '4.23.1', '4.23.2', '4.23.3', '4.23.4',
'4.23.5', '4.23.6', '4.23.7', '4.23.8', '4.23.9',
# 4.24.x versions before 4.24.8
'4.24.0', '4.24.1', '4.24.2', '4.24.3', '4.24.4',
'4.24.5', '4.24.6', '4.24.7',
# 4.25.x versions before 4.25.6
'4.25.0', '4.25.1', '4.25.2', '4.25.3', '4.25.4', '4.25.5',
# 4.26.x versions before 4.26.3
'4.26.0', '4.26.1', '4.26.2'
]

# Check if the current device's software version is in the list of vulnerable versions
version_vulnerable = any(version in version_output for version in vulnerable_versions)

# If version is not vulnerable, no need to check further
if not version_vulnerable:
return

# Check if eAPI is enabled
eapi_config = commands.show_eapi
eapi_enabled = 'enabled' in eapi_config.lower()

# Check if certificate-based authentication is configured
cert_config = commands.show_cert_auth
cert_auth_enabled = 'certificate user' in cert_config

# Device is vulnerable if both eAPI and certificate auth are enabled
is_vulnerable = eapi_enabled and cert_auth_enabled

# Assert that the device is not vulnerable
assert not is_vulnerable, (
f"Device {device.name} is vulnerable to CVE-2021-28503. "
"The device is running a vulnerable version AND has eAPI enabled with certificate-based authentication, "
"which could allow remote attackers to bypass authentication. "
"Recommended fixes:\n"
"1. Upgrade to one of the following fixed versions:\n"
" * 4.26.3 or later for 4.26.x train\n"
" * 4.25.6 or later for 4.25.x train\n"
" * 4.24.8 or later for 4.24.x train\n"
" * 4.23.10 or later for 4.23.x train\n"
"2. Until upgrade is complete, implement this workaround:\n"
" * Disable certificate-based authentication for eAPI:\n"
" switch(config)#management security\n"
" switch(config-mgmt-security)#ssl profile profileEAPI\n"
" switch(config-mgmt-sec-ssl-profile-profileEAPI)#no trust certificate user.cert\n"
"For more information, see https://www.arista.com/en/support/advisories-notices/security-advisory/13605-security-advisory-0072"
)
63 changes: 63 additions & 0 deletions CVEasy/Arista/2021/cve202128504.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from comfy import high


@high(
name='rule_cve202128504',
platform=['arista_eos'],
commands=dict(
show_version='show version',
show_tcam='show hardware tcam profile',
show_acl='show running-config | section ip access-list'
),
)
def rule_cve202128504(configuration, commands, device, devices):
"""
This rule checks for CVE-2021-28504 vulnerability in Arista EOS devices.
The vulnerability occurs on Strata family products when TCAM profile is enabled and
port IPv4 access-lists contain rules matching VXLAN protocol, causing subsequent rules
to not match IP protocol fields as expected.
"""
# Extract the version information from the command output
version_output = commands.show_version

# List of vulnerable software versions
vulnerable_versions = [
# 4.26.x versions before 4.26.4F
'4.26.0', '4.26.1F', '4.26.2F', '4.26.3F',
# 4.27.x versions before 4.27.1M
'4.27.0F'
]

# Check if the current device's software version is in the list of vulnerable versions
version_vulnerable = any(version in version_output for version in vulnerable_versions)

# If version is not vulnerable, no need to check further
if not version_vulnerable:
return

# Check if TCAM profile feature is enabled
tcam_output = commands.show_tcam
tcam_enabled = 'Profile:' in tcam_output

# Check if any ACL has VXLAN protocol matching
acl_config = commands.show_acl
has_vxlan_acl = 'protocol vxlan' in acl_config.lower()

# Device is vulnerable if TCAM profile is enabled and has VXLAN protocol matching in ACLs
is_vulnerable = tcam_enabled and has_vxlan_acl

# Assert that the device is not vulnerable
assert not is_vulnerable, (
f"Device {device.name} is vulnerable to CVE-2021-28504. "
"The device is running a vulnerable version AND has TCAM profile enabled with ACLs matching VXLAN protocol, "
"which could cause subsequent ACL rules to not match IP protocol fields correctly. "
"Recommended fixes:\n"
"1. Upgrade to one of the following fixed versions:\n"
" * 4.26.4F or later for 4.26.x train\n"
" * 4.27.1M or later for 4.27.x train\n"
"2. Until upgrade is complete, implement this workaround:\n"
" * Replace 'protocol vxlan' matches in ACLs with:\n"
" - protocol udp\n"
" - destination port 4789 (or configured VXLAN port)\n"
"For more information, see https://www.arista.com/en/support/advisories-notices/security-advisory/15267-security-advisory-0073"
)
Loading
Loading