CVE-2017-0903 - Deserialization of Untrusted Data

Severity

75%

Complexity

99%

Confidentiality

106%

RubyGems versions between 2.0.0 and 2.6.13 are vulnerable to a possible remote code execution vulnerability. YAML deserialization of gem specifications can bypass class white lists. Specially crafted serialized objects can possibly be used to escalate to remote code execution.

RubyGems versions between 2.0.0 and 2.6.13 are vulnerable to a possible remote code execution vulnerability. YAML deserialization of gem specifications can bypass class white lists. Specially crafted serialized objects can possibly be used to escalate to remote code execution.

CVSS 3.0 Base Score 9.8. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 7.5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:P/I:P/A:P).

Demo Examples

Deserialization of Untrusted Data

CWE-502

This code snippet deserializes an object from a file and uses it as a UI button:


               
}
in.close();

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.

To mitigate this, explicitly define final readObject() to prevent deserialization. An example of this is:


               
throw new java.io.IOException("Cannot be deserialized"); }

Deserialization of Untrusted Data

CWE-502

In Python, the Pickle library handles the serialization and deserialization processes. In this example derived from [R.502.7], the code receives and parses data, and afterwards tries to authenticate a user based on validating a token.


               
}
raise AuthFail

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.

Overview

First reported 7 years ago

2017-10-11 18:29:00

Last updated 5 years ago

2019-10-09 23:21:00

Affected Software

RubyGems RubyGems 2.0.0 Preview 2

2.0.0

RubyGems RubyGems 2.0.0 Preview 2.1

2.0.0

RubyGems RubyGems 2.0.0 Preview 2.2

2.0.0

RubyGems RubyGems 2.0.0 Release Candidate 1

2.0.0

RubyGems RubyGems 2.0.0 Release Candidate 2

2.0.0

RubyGems 2.0.1

2.0.1

RubyGems 2.0.2

2.0.2

RubyGems 2.0.3

2.0.3

RubyGems 2.0.4

2.0.4

RubyGems 2.0.5

2.0.5

RubyGems 2.0.6

2.0.6

RubyGems 2.0.7

2.0.7

RubyGems 2.0.8

2.0.8

RubyGems 2.0.9

2.0.9

RubyGems 2.0.10

2.0.10

RubyGems 2.0.11

2.0.11

RubyGems 2.0.12

2.0.12

RubyGems RubyGems 2.0.13

2.0.13

RubyGems RubyGems 2.0.14

2.0.14

RubyGems RubyGems 2.0.15

2.0.15

RubyGems RubyGems 2.0.16

2.0.16

RubyGems 2.0.17

2.0.17

RubyGems 2.1.1

2.1.1

RubyGems 2.1.2

2.1.2

RubyGems 2.1.3

2.1.3

RubyGems 2.1.4

2.1.4

RubyGems 2.1.5

2.1.5

RubyGems 2.1.6

2.1.6

RubyGems 2.1.7

2.1.7

RubyGems 2.1.8

2.1.8

RubyGems 2.1.9

2.1.9

RubyGems 2.1.10

2.1.10

RubyGems 2.1.11

2.1.11

RubyGems RubyGems 2.2.0

2.2.0

RubyGems RubyGems 2.2.1

2.2.1

RubyGems RubyGems 2.2.2

2.2.2

RubyGems RubyGems 2.2.3

2.2.3

RubyGems RubyGems 2.2.4

2.2.4

RubyGems 2.2.5

2.2.5

RubyGems 2.3.0

2.3.0

RubyGems RubyGems 2.4.0

2.4.0

RubyGems RubyGems 2.4.1

2.4.1

RubyGems RubyGems 2.4.2

2.4.2

RubyGems RubyGems 2.4.3

2.4.3

RubyGems RubyGems 2.4.4

2.4.4

RubyGems RubyGems 2.4.5

2.4.5

RubyGems RubyGems 2.4.6

2.4.6

RubyGems RubyGems 2.4.7

2.4.7

RubyGems 2.4.8

2.4.8

RubyGems 2.5.0

2.5.0

RubyGems 2.5.1

2.5.1

RubyGems 2.5.2

2.5.2

RubyGems 2.6.0

2.6.0

RubyGems 2.6.1

2.6.1

RubyGems 2.6.2

2.6.2

RubyGems 2.6.3

2.6.3

RubyGems 2.6.4

2.6.4

RubyGems 2.6.5

2.6.5

RubyGems 2.6.6

2.6.6

RubyGems 2.6.7

2.6.7

RubyGems 2.6.8

2.6.8

RubyGems 2.6.9

2.6.9

RubyGems 2.6.10

2.6.10

RubyGems 2.6.11

2.6.11

RubyGems 2.6.12

2.6.12

RubyGems 2.6.13

2.6.13

Debian Linux 8.0 (Jessie)

8.0

Debian Linux 9.0

9.0

Canonical Ubuntu Linux 14.04 LTS (Long-Term Support)

14.04

Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)

16.04

Canonical Ubuntu Linux 17.10

17.10

RedHat Enterprise Linux Desktop 7.0

7.0

RedHat Enterprise Linux Server 7.0

7.0

Red Hat Enterprise Linux Server Advanced mission critical Update Support (AUS) 7.4

7.4

Red Hat Enterprise Linux Server Advanced mission critical Update Support (AUS) 7.6

7.6

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.4

7.4

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.5

7.5

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.6

7.6

Red Hat Enterprise Linux Server TUS 7.4

7.4

Red Hat Enterprise Linux Server Telecommunications Update Service (TUS) 7.6

7.6

RedHat Enterprise Linux Workstation 7.0

7.0

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.