Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- security
|
| 4 |
+
- proof-of-concept
|
| 5 |
+
- protobuf
|
| 6 |
+
license: mit
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Protocol Buffers MessageOptions uninterpreted_option materialization DoS PoC
|
| 10 |
+
|
| 11 |
+
This repository contains a benign security research PoC for a `.pb` artifact
|
| 12 |
+
that drives repeated-message materialization during
|
| 13 |
+
`descriptor_pb2.MessageOptions.ParseFromString(...)`.
|
| 14 |
+
|
| 15 |
+
Files:
|
| 16 |
+
|
| 17 |
+
- `control_one_uninterpreted_option.pb`
|
| 18 |
+
- `malicious_uninterpreted_option_5000000.pb`
|
| 19 |
+
- `reproduce.py`
|
| 20 |
+
|
| 21 |
+
Observed behavior:
|
| 22 |
+
|
| 23 |
+
- control artifact:
|
| 24 |
+
- parses successfully with one `uninterpreted_option` entry
|
| 25 |
+
- malicious artifact:
|
| 26 |
+
- parses successfully with `5,000,000` `uninterpreted_option` entries
|
| 27 |
+
- materially increases peak RSS during normal parse
|
| 28 |
+
|
| 29 |
+
Tested runtime:
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
python3 -m pip install protobuf==7.35.1
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
Public reproduction:
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
curl -L -O https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/control_one_uninterpreted_option.pb
|
| 39 |
+
curl -L -O https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/malicious_uninterpreted_option_5000000.pb
|
| 40 |
+
curl -L -O https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/reproduce.py
|
| 41 |
+
python3 reproduce.py --control control_one_uninterpreted_option.pb --malicious malicious_uninterpreted_option_5000000.pb
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Public files:
|
| 45 |
+
|
| 46 |
+
- `https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/control_one_uninterpreted_option.pb`
|
| 47 |
+
- `https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/malicious_uninterpreted_option_5000000.pb`
|
| 48 |
+
- `https://huggingface.co/hacnho/protobuf-messageoptions-uninterpreted-option-dos-poc/resolve/main/reproduce.py`
|