--- tags: - security - proof-of-concept - protobuf license: mit --- # Protocol Buffers CodeGeneratorResponse file materialization DoS PoC This repository contains a benign security research PoC for a `.pb` artifact that drives repeated-message materialization during `plugin_pb2.CodeGeneratorResponse.ParseFromString(...)`. Files: - `control_one_file.pb` - `malicious_response_file_5000000.pb` - `reproduce.py` Observed behavior: - control artifact: - parses successfully with one `file` entry - malicious artifact: - parses successfully with `5,000,000` `file` entries - materially increases peak RSS during normal parse Tested runtime: ```bash python3 -m pip install protobuf==7.35.1 ``` Public reproduction: ```bash curl -L -O https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/control_one_file.pb curl -L -O https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/malicious_response_file_5000000.pb curl -L -O https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/reproduce.py python3 reproduce.py --control control_one_file.pb --malicious malicious_response_file_5000000.pb ``` Public files: - `https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/control_one_file.pb` - `https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/malicious_response_file_5000000.pb` - `https://huggingface.co/hacnho/protobuf-codegeneratorresponse-file-dos-poc/resolve/main/reproduce.py`