Overview
A security review of httpdbg 2.2.0 identified a local remote-code-execution vulnerability in the multiprocess recording mechanism.
The parent process deserializes .httpdbgrecords files using pickle.load() without integrity verification or validation. A malicious pickle can execute arbitrary Python code when the watcher processes the file.
1. Local RCE via Unsafe Deserialization — hooks/external.py — HIGH
The watcher loads .httpdbgrecords files using:
newrecords: HTTPRecords = pickle.load(dumpfile)
Affected line: hooks/external.py L83
Because Python pickle allows arbitrary callable execution during deserialization, a malicious .httpdbgrecords file can execute commands with the privileges of the httpdbg process.
Exploitation
An attacker who can write a malicious .httpdbgrecords file into the httpdbg multiprocess directory can trigger code execution when the background watcher processes it.
The multiprocess directory is created at:
Affected lines: hooks/external.py L35–38
self.directory = tempfile.TemporaryDirectory(prefix="httpdbg_")
os.environ["HTTPDBG_MULTIPROCESS_DIR"] = self.directory.name
The watcher continuously checks the directory and processes matching files.
Affected line: hooks/external.py L91
A malicious pickle can use a __reduce__ gadget such as:
class RCE:
def __reduce__(self):
return (os.system, ("id",))
payload = pickle.dumps(RCE())
Writing the resulting payload as:
into the monitored directory causes pickle.load() to execute the command.
Attack Chain
Attacker-controlled .httpdbgrecords
↓
httpdbg multiprocess directory
↓
Watcher detects file
↓
external.py:83 → pickle.load()
↓
Pickle gadget executes
↓
Arbitrary command execution
↓
httpdbg process privileges
Impact
Successful exploitation provides arbitrary code execution with the privileges of the process running httpdbg.
This could allow access to files, environment variables, credentials, network resources, and other data available to the httpdbg process.
Fix
Avoid deserializing untrusted data with pickle. Replace the IPC format with a safe serialization format such as JSON and reconstruct the expected record objects explicitly.
If pickle must be retained, authenticate the serialized data before deserialization and ensure the IPC directory cannot be modified by unauthorized processes.
Environment
- httpdbg:
2.2.0
- Python:
3.14.0
- OS: Windows 11
- Windows build:
10.0.26200
The vulnerability was reproduced successfully and arbitrary command execution was confirmed.
Request
Please treat this as a security issue. I can provide the complete reproduction/PoC privately if required.
Overview
A security review of httpdbg
2.2.0identified a local remote-code-execution vulnerability in the multiprocess recording mechanism.The parent process deserializes
.httpdbgrecordsfiles usingpickle.load()without integrity verification or validation. A malicious pickle can execute arbitrary Python code when the watcher processes the file.1. Local RCE via Unsafe Deserialization —
hooks/external.py— HIGHThe watcher loads
.httpdbgrecordsfiles using:Affected line:
hooks/external.pyL83Because Python pickle allows arbitrary callable execution during deserialization, a malicious
.httpdbgrecordsfile can execute commands with the privileges of the httpdbg process.Exploitation
An attacker who can write a malicious
.httpdbgrecordsfile into the httpdbg multiprocess directory can trigger code execution when the background watcher processes it.The multiprocess directory is created at:
Affected lines:
hooks/external.pyL35–38The watcher continuously checks the directory and processes matching files.
Affected line:
hooks/external.pyL91A malicious pickle can use a
__reduce__gadget such as:Writing the resulting payload as:
into the monitored directory causes
pickle.load()to execute the command.Attack Chain
Impact
Successful exploitation provides arbitrary code execution with the privileges of the process running httpdbg.
This could allow access to files, environment variables, credentials, network resources, and other data available to the httpdbg process.
Fix
Avoid deserializing untrusted data with
pickle. Replace the IPC format with a safe serialization format such as JSON and reconstruct the expected record objects explicitly.If pickle must be retained, authenticate the serialized data before deserialization and ensure the IPC directory cannot be modified by unauthorized processes.
Environment
2.2.03.14.010.0.26200The vulnerability was reproduced successfully and arbitrary command execution was confirmed.
Request
Please treat this as a security issue. I can provide the complete reproduction/PoC privately if required.