{"id":"CVE-2025-71463","aliases":["CVE-2025-71463","GHSA-cq46-m9x9-j8w2"],"related":[],"kind":"vulnerability","state":"published","title":"Scapy before 2.7.0 Insecure Deserialization RCE via Session Files","summary":"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__().","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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__().","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAn unsafe deserialization vulnerability in Scapy <v2.7.0 allows attackers to execute arbitrary code **when a malicious session file is locally loaded via the `-s` option**. This requires convincing a user to manually load a malicious session file.\n\n---\n\n### Details\n\nScapy’s interactive shell supports session loading using gzip-compressed pickle files:\n\n```bash\n./run_scapy -s <session_file.pkl.gz>\n```\n\nInternally, this triggers:\n\n```python\n# main.py\nSESSION = pickle.load(gzip.open(session_name, \"rb\"))\n```\n\nSince no validation or restriction is performed on the deserialized object, **any code embedded via `__reduce__()` will be executed immediately**. This makes it trivial for an attacker to drop a malicious `.pkl.gz` in a shared folder and have it executed by unsuspecting users.\n\nThe vulnerability exists in the `load_session` function, which deserializes data using `pickle.load()` on `.pkl.gz` files provided via the `-s` CLI flag or programmatically through `conf.session`.\n\n**Affected lines in source code**:\nhttps://github.com/secdev/scapy/blob/master/scapy/main.py#L569-L572\n\n```python\ntry:\n    s = pickle.load(gzip.open(fname, \"rb\"))\nexcept IOError:\n    try:\n        s = pickle.load(open(fname, \"rb\"))\n```\n\n### Impact\n\nThis is a classic deserialization vulnerability which leads to Code Execution (CE) when untrusted data is deserialized.\n\nAny user who can trick another user into loading a crafted `.pkl.gz` session file (e.g. via `-s` option) can execute arbitrary Python code.\n\n- **Vulnerability type:** Insecure deserialization (Python `pickle`)\n- **CWE**: [CWE-502: Deserialization of Untrusted Data](https://cwe.mitre.org/data/definitions/502.html)\n- **CVSS v4.0 Vector**: `CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`\n- **CVSS Score**: 5.4 (Medium)\n- **Impact:** Arbitrary Code Execution\n- **Attack vector:** Local or supply chain (malicious `.pkl.gz`)\n- **Affected users:** Any user who loads session files (even interactively)\n- **Affected version:** **Scapy v2.6.1**\n\n---\n\n### Mitigations\n\n- Do not use 'sessions' (the -s option when launching Scapy).\n- Use the Scapy 2.7.0+ where the session mechanism has been removed.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Scapy en versiones anteriores a la 2.7.0 contiene una vulnerabilidad de deserialización insegura en la función load_session que permite a los atacantes ejecutar código suministrando un archivo de sesión pickle malicioso. Los atacantes pueden engañar a los usuarios para que carguen un archivo .pkl.gz manipulado mediante la opción -s o conf.session, ejecutando código Python embebido a través de __reduce__().","source":"nvd"}],"published":"2025-10-22T16:45:49.000Z","modified":"2026-11-14T02:56:23.704Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":5.4,"rating":"MEDIUM"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.7.0","status":"affected"},{"type":"semver","version":"2.7.0","status":"unaffected"}],"vendor":"secdev","product":"scapy","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"2.6.1"}],"ecosystem":"PyPI","package":"scapy","purl":"pkg:pypi/scapy","source":"ghsa"}],"references":[{"url":"https://github.com/secdev/scapy/security/advisories/GHSA-cq46-m9x9-j8w2","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/scapy-before-2.7.0-insecure-deserialization-rce-via-session-files","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/secdev/scapy/commit/13621d1145b3435e9d03caf20997107a84435c0b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/secdev/scapy","tags":["package"],"sources":["ghsa"]}],"credits":["anotherik"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-11-13T20:34:57.242Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-71463","url":"https://www.cve.org/CVERecord?id=CVE-2025-71463","licence":"CVE Terms of Use","modified":"2026-11-13T20:35:14.393Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cq46-m9x9-j8w2","url":"https://github.com/advisories/GHSA-cq46-m9x9-j8w2","licence":"CC-BY-4.0","modified":"2026-11-14T02:56:23.704Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-71463","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71463","licence":"Public domain","modified":"2026-11-13T23:10:00.153Z"}],"updatedAt":"2026-11-25T22:59:12.577Z","epss":{"score":0.00152,"percentile":0.04565,"date":"2026-12-01T12:00:22.000Z"}}