The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
N/A
Threat Mapped score: 0.0
Industry: Finiancial
Threat priority: Unclassified
CVE: CVE-2019-12799
chain: bypass of untrusted deserialization issue (CWE-502) by using an assumed-trusted class (CWE-183)
CVE: CVE-2015-8103
Deserialization issue in commonly-used Java library allows remote execution.
CVE: CVE-2015-4852 — KEV
Deserialization issue in commonly-used Java library allows remote execution.
CVE: CVE-2013-1465
Use of PHP unserialize function on untrusted input allows attacker to modify application configuration.
CVE: CVE-2012-3527
Use of PHP unserialize function on untrusted input in content management system might allow code execution.
CVE: CVE-2012-0911
Use of PHP unserialize function on untrusted input in content management system allows code execution using a crafted cookie value.
CVE: CVE-2012-0911
Content management system written in PHP allows unserialize of arbitrary objects, possibly allowing code execution.
CVE: CVE-2011-2520
Python script allows local users to execute code via pickled data.
CVE: CVE-2012-4406
Unsafe deserialization using pickle in a Python script.
CVE: CVE-2003-0791
Web browser allows execution of native methods via a crafted string to a JavaScript function that deserializes the string.
N/A
Phase | Note |
---|---|
Architecture and Design | OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase. |
Implementation | N/A |
Intro: This code snippet deserializes an object from a file and uses it as a UI button:
Body: This code does not attempt to verify the source or contents of the file before deserializing it. An attacker may be able to replace the intended file with a file that contains arbitrary malicious code which will be executed when the button is pressed.
try { File file = new File("object.obj"); ObjectInputStream in = new ObjectInputStream(new FileInputStream(file)); javax.swing.JButton button = (javax.swing.JButton) in.readObject(); in.close(); }
Intro: In Python, the Pickle library handles the serialization and deserialization processes. In this example derived from [REF-467], the code receives and parses data, and afterwards tries to authenticate a user based on validating a token.
Body: Unfortunately, the code does not verify that the incoming data is legitimate. An attacker can construct a illegitimate, serialized object "AuthToken" that instantiates one of Python's subprocesses to execute arbitrary commands. For instance,the attacker could construct a pickle that leverages Python's subprocess module, which spawns new processes and includes a number of arguments for various uses. Since Pickle allows objects to define the process for how they should be unpickled, the attacker can direct the unpickle process to call Popen in the subprocess module and execute /bin/sh.
try { class ExampleProtocol(protocol.Protocol): def dataReceived(self, data): # Code that would be here would parse the incoming data # After receiving headers, call confirmAuth() to authenticate def confirmAuth(self, headers): try: token = cPickle.loads(base64.b64decode(headers['AuthToken'])) if not check_hmac(token['signature'], token['data'], getSecretKey()): raise AuthFail self.secure_data = token['data'] except: raise AuthFail }