Skip to content

GHSA-4wm8-fjv7-j774 CVE-2019-8325

RubyGems Escape sequence injection in errors

High RubyGems
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
3.28%
Chance of exploitation in the next 30 days. Higher than 88.45% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Fix
2.7.9
Upgrade rubygems-update to this version or later

Description

An issue was discovered in RubyGems 2.6 and later through 3.0.2. Since Gem::CommandManager#run calls alert_error without escaping, escape sequence injection is possible. (There are many ways to cause an error.)

Affected versions

RubyGems

PackageVulnerableFixed in
rubygems-update
>= 2.6.0, < 2.7.9
2.7.9
rubygems-update
>= 3.0.0, < 3.0.2
3.0.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

rubygems-update RubyGems → 2.7.9

bundler
bundle update rubygems-update # Gemfile: gem "rubygems-update", ">= 2.7.9"

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Weakness

CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

How to prevent it
  • Requirements: Programming languages and supporting technologies might be chosen which are not subject to these issues.
  • Implementation: Utilize an appropriate mix of allowlist and denylist parsing to filter control-plane syntax from all input.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-228f-g3h7-3fj3
RubyGems HTTPS to HTTP redirect
Medium Also affects rubygems-update
GHSA-5mgj-mvv8-46mw
RubyGems does not verify SSL certificate
Medium Also affects rubygems-update
GHSA-qv62-xfj6-32xm
RubyGems Improper Input Validation vulnerability
Medium Also affects rubygems-update
GHSA-9qvm-2vhf-q649
RubyGems Regular Expression Denial of Service
Medium Also affects rubygems-update
GHSA-8qxg-mff5-j3wc
RubyGems Path Traversal vulnerability
Medium Also affects rubygems-update
GHSA-wp3j-rvfp-624h
RubyGems vulnerable to DNS hijack attack
High Also affects rubygems-update
GHSA-9j7m-rjqx-48vh
RubyGems Regular Expression Denial of Service vulnerability
Medium Also affects rubygems-update
GHSA-p7f2-rr42-m9xm
RubyGems Improper Input Validation vulnerability
High Also affects rubygems-update
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor