Summary
rConfig contains a PHP object injection vulnerability in which decrypted attribute values are unserialized without restricting the classes that can be instantiated. An authenticated attacker who can store a serialized gadget chain in an encrypted field may trigger command execution as the web server user when the value is read through the device API.
Affected context
The issue is in rConfig Core's app/Casts/EncryptStringCast.php and affects rConfig Core versions before 8.2.17 and rConfig Pro versions before 8.4.0. It becomes a risk when an encrypted attribute containing attacker-controlled serialized data is decrypted and unserialized without class restrictions, such as when device data is retrieved through GET /api/devices.
Exploit preconditions
- Attack surface: The application's device API and encrypted attribute handling
- Required access: An authenticated account able to store attacker-controlled data in a relevant encrypted field, such as a device password
- Trigger point: A request that reads the affected attribute through
GET /api/devices - Why exploitation is possible: The application decrypts and unserializes the stored value without restricting object classes, allowing a usable gadget chain to execute in the web server process
Why this happens
The application treats decrypted attribute contents as trusted serialized data and uses PHP unserialization without restricting which classes may be instantiated. Encryption does not establish that the decrypted value is safe or untampered with. This is CWE-502: Deserialization of Untrusted Data; object construction during deserialization can activate application or dependency behavior that may lead to code execution.
Potential impact
- An attacker may execute commands with the privileges of the web server process.
- The application runtime could be compromised, potentially exposing accessible data or credentials.
- An attacker could use the compromised process to affect other systems reachable from the application.
General mitigation guidance
Mitigation generally focuses on avoiding unsafe object deserialization and reducing trust in data that can be influenced by users.
- Prefer non-executable data formats and parsing methods that do not instantiate arbitrary objects.
- Where deserialization cannot be avoided, restrict accepted types and validate values against an explicit schema before use.
- Protect the integrity and access controls of stored encrypted attributes; encryption alone should not be treated as input validation.
- Limit the web server process to the minimum filesystem, command, and network privileges required.
- Avoid returning sensitive attributes through broadly accessible API paths.
How teams detect issues like this
- Use static analysis to identify calls to PHP
unserialize()on values derived from storage, requests, or other mutable sources. - Review custom casts and data-access paths for decryption followed by deserialization without class restrictions or schema validation.
- Enforce code-review and CI policies that flag unsafe deserialization APIs and require justification for their use.
- Monitor API access and application behavior for unexpected command execution or anomalous activity by the web server process.

