Vulnerabilities

1 via 1 paths

Dependencies

1

Source

GitHub

Commit

4e4cdd14

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 1
  • 1
Severity
  • 2
Status
  • 2
  • 0
  • 0

high severity

Deserialization of Untrusted Data

  • Vulnerable module: scapy
  • Introduced through: scapy@2.4.3

Detailed paths

  • Introduced through: no0be/DNSlivery@no0be/DNSlivery#4e4cdd146f5cc9cfc95334d755330497c174b771 scapy@2.4.3
    Remediation: Upgrade to scapy@2.7.0.

Overview

scapy is a Python-based interactive packet manipulation program and library.

Affected versions of this package are vulnerable to Deserialization of Untrusted Data via the load_session process. An attacker can execute arbitrary code by convincing a user to load a malicious .pkl.gz session file, through the -s command-line option or programmatically.

PoC

import pickle, os, gzip

class RCE:
    def __reduce__(self):
        return (os.system, ("cat /etc/passwd",))

payload = gzip.compress(pickle.dumps(RCE()))

with open("evil.pkl.gz", "wb") as f:
    f.write(payload)

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502) is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, thus allowing the attacker to control the state or the flow of the execution.

Remediation

Upgrade scapy to version 2.7.0rc1 or higher.

References

high severity

GPL-2.0 license

  • Module: scapy
  • Introduced through: scapy@2.4.3

Detailed paths

  • Introduced through: no0be/DNSlivery@no0be/DNSlivery#4e4cdd146f5cc9cfc95334d755330497c174b771 scapy@2.4.3

GPL-2.0 license