Arbitrary Command Injection Affecting cocaine package, versions < 0.5.3, >= 0.4.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
2% (79th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-COCAINE-20113
  • published21 Oct 2013
  • disclosed21 Oct 2013
  • creditHolger Just

Introduced: 21 Oct 2013

CVE-2013-4457  (opens in a new tab)
CWE-77  (opens in a new tab)

Overview

cocaine is a library for doing command lines.

Affected versions of this gem are vulnerable to an attacker injecting hostile commands into a command line via a crafted hash object which is not properly escaped. This is due to the method of variable interpolation used by the gem, allowing an attacker to execute arbitrary commands via a crafted has object, related to recursive variable interpolation.

Details

The impact is lessened on Ruby version 1.8.* because hashes are not ordered by default, so an attacker must rely on luck for the attack to work.

An attack of this sort cannot take place if there is only one value being interpolated into the command line.

CVSS Base Scores

version 3.1