Summary
ADB Explorer for Windows deserializes its App.txt settings file with Newtonsoft.Json configured using TypeNameHandling.Objects, enabling instantiation of arbitrary .NET types during JSON parsing.
If an attacker can replace or modify the settings file with a crafted JSON payload, they may trigger remote code execution when ADB Explorer launches and processes its configuration.
Affected context
The vulnerability appears in the settings-loading logic of ADB Explorer prior to Beta 0.9.26020, specifically when the application reads and writes the App.txt configuration file.
It becomes relevant in environments where:
- The App.txt settings file is writable or replaceable by an attacker (e.g., shared workstations, compromised user profiles, or insecure sync/backup locations).
- File integrity of user-specific application data is not strongly enforced.
- ADB Explorer is launched normally by the user, causing automatic deserialization of the configuration file.
Exploit preconditions
- Attack surface: Local file-based configuration (App.txt) consumed on application startup.
- Required access: Ability to create, modify, or replace the App.txt settings file in the user's ADB Explorer configuration directory.
- Trigger point: Application launch or any code path that causes the settings to be deserialized and subsequently saved.
- Why exploitation is possible: Newtonsoft.Json is configured with
TypeNameHandling.Objects, enabling polymorphic deserialization of attacker-controlled$typemetadata into dangerous .NET gadget types (e.g.,ObjectDataProvider) without restricting allowed types or performing additional safety checks.
Why this happens
This issue is a classic instance of CWE-502: Insecure Deserialization, in which untrusted data is transformed into live objects with behavioral side effects.
By enabling TypeNameHandling.Objects, the deserializer trusts type information embedded in the JSON payload and attempts to materialize those types directly from input.
Without a constrained type binder or an allowlist of safe target types, an attacker can embed a gadget chain—such as WPF's ObjectDataProvider or other side-effect-capable .NET classes—that executes arbitrary code during object construction or property evaluation.
The unsafe pattern is: "Deserialize attacker-controlled data into arbitrary runtime types with elevated capabilities, rather than into simple data-only DTOs."
Potential impact
- Execution of arbitrary code under the context of the user running ADB Explorer.
- Installation of additional malware or backdoors on the affected Windows system.
- Reading, modification, or exfiltration of user data accessible to the compromised process.
- Use of the compromised machine as a pivot point for lateral movement within the network.
- Tampering with ADB Explorer behavior, including manipulating device interactions or collected data.
General mitigation guidance
Mitigation generally focuses on limiting what deserialization can do and reducing trust in external settings files:
- Avoid using
TypeNameHandlingfor data that might be influenced by an attacker; prefer simple DTOs without polymorphic type metadata. - If polymorphism is required, use a custom serialization scheme or a safe type discriminator, combined with an explicit allowlist of permissible types via a custom
SerializationBinder. - Treat configuration files as untrusted input: validate structure, enforce strict schemas, and reject or ignore unexpected fields or type information.
- Store settings under directories with appropriate access controls, minimizing the chance that other users or processes can write to them.
- Run the application with least-privilege and avoid granting it unnecessary access to sensitive paths or system resources so that impact is limited if deserialization fails securely.
How teams detect issues like this
Detection efforts can target both code and runtime environments:
- Static analysis: Search for Newtonsoft.Json usage with
TypeNameHandlingset toObjects,All, or similar, especially when deserializing data from files or other external sources. - Code review signals: Look for:
- Deserialization of configuration or user-controlled data directly into domain objects without validation.
- Use of powerful framework types or reflection-based constructs during or immediately after deserialization.
- Absence of custom
SerializationBinderor type allowlists when polymorphic deserialization is enabled. - Automated tooling: Configure SAST tools to flag dangerous Newtonsoft.Json patterns and add CI checks that fail builds when insecure deserialization configurations are introduced.
- Runtime monitoring: Log deserialization failures, suspicious configuration file changes, and unexpected type names if diagnostic hooks or telemetry are available.

