aiohttp CookieJar Arbitrary Code Execution Vulnerability

Vulnerability

A vulnerability in the aiohttp library's CookieJar component, present in versions prior to 3.14.0, allows for arbitrary code execution when the CookieJar.load() method is used with untrusted input. Although this issue is unlikely to impact many applications, as most will use this function with the user's own data, it poses a risk if an application loads files controlled by an attacker without proper sanitization.

Impact

Exploitation of this vulnerability could lead to arbitrary code execution through the deserialization of malicious pickle payloads, as acknowledged by the aiohttp maintainers.

Reproduction

The vulnerability can be reproduced by using the CookieJar.load() method to load a pickle file that contains a crafted payload. This payload can be designed to execute arbitrary code when the pickle file is deserialized, bypassing the restrictions of the unpickler.

Remediation

Users can update to aiohttp version 3.14.0 or later, where this vulnerability has been patched. For applications that cannot be immediately updated, a workaround is to sanitize files before loading them into the CookieJar.

Added: Jun 2, 2026, 8:35 PM
Updated: Jun 2, 2026, 8:35 PM

Vulnerability Rating

Custom Algorithm
spread
7.3
impact
7.5
exploitability
7.1
remediation
7.9
relevance
9.8
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.