CVE-2017-16516: Yajl ruby Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-wwh7-4jw9-33x6
CVSS 7.5
CWE-134
Published
Advisory Summary

CVE-2017-16516 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-134: Use of Externally-Controlled Format String) affecting Yajl ruby libraries in the RubyGems ecosystem. The issue involves yajl-ruby gem denial of service vulnerability. Remediation is available by upgrading affected packages to version 1.3.1.

CVE-2017-16516 at a Glance

CVE Identifier CVE-2017-16516
GHSA Identifier GHSA-wwh7-4jw9-33x6
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-134: Use of Externally-Controlled Format String
Affected Product Yajl ruby
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2017-16516

To remediate this vulnerability, upgrade all affected Yajl ruby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

yajl-ruby fixed: 1.3.1
Upgrade yajl-ruby to 1.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for yajl-ruby

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-16516, inspect your project dependencies for Yajl ruby:

inspect dependencies for yajl-ruby

Analyze the terminal output to locate any version of Yajl ruby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-134: Use of Externally-Controlled Format String, where the product uses a function that accepts a format string as an argument, but the format string originates from an external source. In Yajl ruby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In the yajl-ruby gem 1.3.0 for Ruby, when a crafted JSON file is supplied to `Yajl::Parser.new.parse`, the whole ruby process crashes with a SIGABRT in the `yajl_string_decode` function in `yajl_encode.c`. This results in the whole ruby process terminating and potentially a denial of service.

CVE-2017-16516 Affected Yajl ruby Versions

1 component(s)
Fixed Versions:
1.3.1
Product / Package Ecosystem Affected Versions Fixed Version
yajl-ruby
RubyGems
< 1.3.1
1.3.1

References

Frequently Asked Questions

What is CVE-2017-16516?
CVE-2017-16516 is a security vulnerability in Yajl ruby involving yajl-ruby gem Denial of Service vulnerability under CWE-134: Use of Externally-Controlled Format String.
Which Yajl ruby versions are affected?
Affected versions include releases prior to 1.3.1 across affected packages: yajl-ruby.
What version fixes CVE-2017-16516?
Upgrading to 1.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yajl-ruby affected?
Yes, yajl-ruby is affected in releases prior to 1.3.1. Upgrade your dependency to 1.3.1 or later.
What is the CVSS score of CVE-2017-16516?
CVE-2017-16516 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2017-16516?
CVE-2017-16516 is classified under CWE-134: Use of Externally-Controlled Format String (The product uses a function that accepts a format string as an argument, but the format string originates from an external source.).
How can I check RubyGems dependencies for CVE-2017-16516?
Run the dependency tree command: 'inspect dependencies for yajl-ruby'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wwh7-4jw9-33x6",
  "modified" : "2023-08-29T16:04:20Z",
  "published" : "2017-11-28T22:44:42Z",
  "aliases" : [ "CVE-2017-16516" ],
  "summary" : "yajl-ruby gem Denial of Service vulnerability",
  "details" : "In the yajl-ruby gem 1.3.0 for Ruby, when a crafted JSON file is supplied to `Yajl::Parser.new.parse`, the whole ruby process crashes with a SIGABRT in the `yajl_string_decode` function in `yajl_encode.c`. This results in the whole ruby process terminating and potentially a denial of service.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "yajl-ruby"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16516"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brianmario/yajl-ruby/issues/176"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brianmario/yajl-ruby/pull/178"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/advisory-database/pull/2158"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/brianmario/yajl-ruby/commit/a8ca8f476655adaa187eedc60bdc770fff3c51ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/brianmario/yajl-ruby"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/yajl-ruby/CVE-2017-16516.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2017/11/msg00010.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00013.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/08/msg00003.html"
  }, {
    "type" : "WEB",
    "url" : "https://rubygems.org/gems/yajl-ruby"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-134" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T22:01:25Z",
    "nvd_published_at" : "2017-11-03T15:29:00Z"
  }
}