CVE-2025-71463
Scapy <2.7.0 insecure deserialization via malicious pickle session file.
- CVSS 5.4
- CWE-502
- Input Validation and Sanitization
- Remote
Scapy before 2.7.0 contains an insecure deserialization vulnerability in the load_session function that allows attackers to execute code by supplying a malicious pickle session file. Attackers can trick users into loading a crafted .pkl.gz file via the -s option or conf.session, executing embedded Python code through __reduce__().
- CWE
- CWE-502
- CVSS base score
- 5.4
- Published
- 2026-11-13
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Serialization Issues
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Scapy
- Fixed by upgrading
- Yes
Solution
Upgrade Scapy to version 2.7.0 or newer.
Vulnerable code sample
import gzip
import pickle
import sys
def load_session(session_path):
# VULNERABLE: insecure deserialization via pickle.load
with gzip.open(session_path, 'rb') as f:
session = pickle.load(f)
return sessionPatched code sample
import gzip
import pickle
import sys
class RestrictedUnpickler(pickle.Unpickler):
def find_class(self, module, name):
# FIX: block arbitrary class loading
raise pickle.UnpicklingError(f"global '{module}.{name}' is forbidden")
def load_session(session_path):
# FIX: use restricted unpickler to prevent code execution
with gzip.open(session_path, 'rb') as f:
session = RestrictedUnpickler(f).load()
return sessionCite this entry
@misc{vaitp:cve202571463,
title = {{Scapy <2.7.0 insecure deserialization via malicious pickle session file.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2025-71463},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2025-71463/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
