Arbitrary Code Execution Vulnerability in Scapy due to Unsafe Deserialization

scapy Updated 14 Dec 2025

Summary

22/10/2025
MODERATE
No i
Moderate
5.4

GHSA-cq46-m9x9-j8w2: Scapy Session Loading Vulnerable to Arbitrary Code Execution via Untrusted Pickle Deserialization. Affects scapy versions < 2.6.1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Scapy is a powerful Python-based interactive packet manipulation program and library. It enables users to create, manipulate, send, and capture network packets. Scapy is widely used for network analysis, penetration testing, and security research. However, it has a vulnerability that allows attackers to execute arbitrary code through unsafe deserialization of session files.

Vulnerability Detail

An unsafe deserialization vulnerability exists in Scapy versions prior to 2.7.0. This vulnerability arises when a user loads a malicious session file using the '-s' option, which triggers the deserialization of untrusted data without validation. The deserialization process uses Python's pickle module, which can execute arbitrary code if the deserialized object contains malicious instructions. This poses a significant risk, as an attacker can craft a malicious '.pkl.gz' file that, when loaded, executes arbitrary Python code on the victim's machine.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the '-s' option to load session files in Scapy. This prevents the risk of executing malicious code from untrusted session files.

Conclusion

The arbitrary code execution vulnerability in Scapy due to unsafe deserialization poses a significant risk to users who load untrusted session files. It is crucial to update to version 2.7.0 or later to mitigate this risk. Users should also avoid using the '-s' option until they can ensure their version is secure.

See every vulnerability recorded for scapy →

Share this vulnerability

FAQ

The vulnerability is an insecure deserialization issue that allows arbitrary code execution when a malicious session file is loaded.

If you are using Scapy version 2.6.1 or earlier, your version is affected by this vulnerability.

If you cannot update Scapy, refrain from using the '-s' option to load session files until you can apply the update.

No, the vulnerability requires local access to the machine to load the malicious session file.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. It requires only the Pipfile.lock to function.

Related vulnerabilities

Recent vulnerabilities recorded for scapy.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback