CVE-2016-5697: Ruby saml Ruby-saml Allows Attackers To Perform Vulnerability

HIGH
Advisory Identifier: GHSA-36p7-xjw8-h6f2
CVSS 7.5
CWE-91
Published
Advisory Summary

CVE-2016-5697 is a HIGH (CVSS 7.5) ruby-saml allows attackers to perform vulnerability (CWE-91: XML Injection (aka Blind XPath Injection)) affecting Ruby saml libraries in the RubyGems ecosystem. The issue involves ruby-saml allows attackers to perform xml signature wrapping attacks. Remediation is available by upgrading affected packages to version 1.3.0.

CVE-2016-5697 at a Glance

CVE Identifier CVE-2016-5697
GHSA Identifier GHSA-36p7-xjw8-h6f2
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-91: XML Injection (aka Blind XPath Injection)
Affected Product Ruby saml
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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

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 High (I:H)
Availability None (A:N)

How to Fix CVE-2016-5697

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

ruby-saml fixed: 1.3.0
Upgrade ruby-saml to 1.3.0
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 ruby-saml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2016-5697, inspect your project dependencies for Ruby saml:

inspect dependencies for ruby-saml

Analyze the terminal output to locate any version of Ruby saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0), 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-91: XML Injection (aka Blind XPath Injection), where the product does not properly neutralize special elements that are used in xml, allowing attackers to modify the syntax, content, or commands of the xml before it is processed by an end system. In Ruby saml, 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

ruby-saml prior to version 1.3.0 is vulnerable to an XML signature wrapping attack in the specific scenario where there was a signature that referenced at the same time 2 elements (but past the scheme validator process since 1 of the element was inside the encrypted assertion). ruby-saml users must update to 1.3.0, which implements 3 extra validations to mitigate this kind of attack.

CVE-2016-5697 Affected Ruby saml Versions

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

References

Frequently Asked Questions

What is CVE-2016-5697?
CVE-2016-5697 is a security vulnerability in Ruby saml involving Ruby-saml allows attackers to perform XML signature wrapping attacks under CWE-91: XML Injection (aka Blind XPath Injection).
Which Ruby saml versions are affected?
Affected versions include releases prior to 1.3.0 across affected packages: ruby-saml.
What version fixes CVE-2016-5697?
Upgrading to 1.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ruby-saml affected?
Yes, ruby-saml is affected in releases prior to 1.3.0. Upgrade your dependency to 1.3.0 or later.
What is the CVSS score of CVE-2016-5697?
CVE-2016-5697 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2016-5697?
CVE-2016-5697 is classified under CWE-91: XML Injection (aka Blind XPath Injection) (The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.).
How can I check RubyGems dependencies for CVE-2016-5697?
Run the dependency tree command: 'inspect dependencies for ruby-saml'. 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-36p7-xjw8-h6f2",
  "modified" : "2023-08-28T10:31:36Z",
  "published" : "2018-08-21T17:08:30Z",
  "aliases" : [ "CVE-2016-5697" ],
  "summary" : "Ruby-saml allows attackers to perform XML signature wrapping attacks ",
  "details" : "ruby-saml prior to version 1.3.0 is vulnerable to an XML signature wrapping attack in the specific scenario where there was a signature that referenced at the same time 2 elements (but past the scheme validator process since 1 of the element was inside the encrypted assertion).\nruby-saml users must update to 1.3.0, which implements 3 extra validations to mitigate this kind of attack.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "ruby-saml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-5697"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/onelogin/ruby-saml/commit/a571f52171e6bfd87db59822d1d9e8c38fb3b995"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-saml/CVE-2016-5697.yml"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/06/24/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-91" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:54:16Z",
    "nvd_published_at" : null
  }
}