
Path TraversalCVSS 6.7€0
Path Traversal in writeFile via Unsafe Prefix Containment Check Allows Out-of-Directory Writes
tipsen
Disclosed on HackerOne · March 31, 2026
Publicly disclosed report · by tipsen
View original on HackerOneSummary:
protodump uses descriptor-controlled paths (name/go_package) in output filename construction and then enforces containment with a lexical strings.HasPrefix check after EvalSymlinks. That check is bypassable with ../ traversal into existing prefix-matching sibling directories, enabling writes outside the intended output directory.
Steps To Reproduce:
- First of all, build the protodump
- Then, create a malicious input blob (descriptor name =
../out_pwn/evil.proto):
name = b'../out_pwn/evil.proto'
with open('/tmp/evil.bin', 'wb') as f:
f.write(bytes([0x0a, len(name)]) + name + b'\x00')