Quantum Secular Labs / Blog / Advisories

CVE-2018-8780: Ruby Lang: Path traversal

CVE-2018-8780 is rated critical with a CVSS v3.0 base score of 9.1 and affects Ruby Lang, along with 2 other products in NVD’s configuration data. Per its scoring, it can be exploited over the network, without authentication, without any user interaction.

Vulnerability description

In Ruby before 2.2.10, 2.3.x before 2.3.7, 2.4.x before 2.4.4, 2.5.x before 2.5.1, and 2.6.0-preview1, the Dir.open, Dir.new, Dir.entries and Dir.empty? methods do not check NULL characters. When using the corresponding method, unintentional directory traversal may be performed.

Severity breakdown

CVSS v3.0 9.1: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

  • Attack vector: Network. Exploitable remotely over the network, with no need for local or physical access.
  • Attack complexity: Low. No special conditions; the attack can be repeated reliably.
  • Privileges required: None. No account or prior access is needed.
  • User interaction: None. No action from any user is needed.
  • Scope: Unchanged. Impact stays within the vulnerable component.
  • Confidentiality impact: High. Total loss of confidentiality; sensitive data can be fully disclosed.
  • Integrity impact: High. Total loss of integrity; data or system state can be fully modified.
  • Availability impact: None. No effect on availability.

Underlying weakness

CWE-22: Improper Limitation of a Pathname to a Restricted Directory

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Affected products

  • Ruby Lang: before 2.2.10; from 2.3.0 before 2.3.7; from 2.4.0 before 2.4.4; from 2.5.0 before 2.5.1; 2.6.0 preview1
  • Canonical Ubuntu Linux: 14.04; 16.04; 17.10
  • Debian Linux: 7.0; 8.0; 9.0

References