{"answers":{"affected":"2 open source packages ship an affected version, including scapy.","exploited":"There is no known exploitation of GHSA-cq46-m9x9-j8w2 in the wild and no public exploit code.","fix":"No fix has been published for GHSA-cq46-m9x9-j8w2 yet. Limit exposure of the affected software until one is available.","what":"GHSA-cq46-m9x9-j8w2 is an unsafe deserialization vulnerability in scapy, published on 22 Oct 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-cq46-m9x9-j8w2 and fix it if it is affected.\n\nWhat it is: GHSA-cq46-m9x9-j8w2 is an unsafe deserialization vulnerability in scapy, published on 22 Oct 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-cq46-m9x9-j8w2 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- scapy (PyPI): affected all versions up to 2.6.1; no fix listed\n- scapy (PyPI): affected all versions up to 2.6.1; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-cq46-m9x9-j8w2/ (Markdown: https://insights.sbomify.com/GHSA-cq46-m9x9-j8w2/index.md)","id":"GHSA-cq46-m9x9-j8w2","markdown":"https://insights.sbomify.com/GHSA-cq46-m9x9-j8w2/index.md","name":"GHSA-cq46-m9x9-j8w2","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python network library","requires_auth":"none","summary":"Attackers can execute arbitrary code by tricking users into loading malicious Scapy session files via unsafe pickle deserialization.","user_interaction":"required","vuln_class":"deserialization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\nAn unsafe deserialization vulnerability in Scapy \u003cv2.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 \u003csession_file.pkl.gz\u003e\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.","ecosystems":["PyPI"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"Scapy Session Loading Vulnerable to Arbitrary Code Execution via Untrusted Pickle Deserialization","id":"GHSA-cq46-m9x9-j8w2","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"deserialization","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["2.6.1"],"package":"scapy","purl":null,"source":"GHSA-cq46-m9x9-j8w2"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["2.6.1"],"package":"scapy","purl":"pkg:pypi/scapy","source":"GHSA-cq46-m9x9-j8w2"}],"products":null,"published":"2025-10-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary code by tricking users into loading malicious Scapy session files via unsafe pickle deserialization.","url":"https://insights.sbomify.com/GHSA-cq46-m9x9-j8w2/"}