GHSA-r364-2pj4-pf7f CVE-2015-20108
ruby-saml vulnerable to XPath injection
- Severity
- 9.8 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 1.33%
- Chance of exploitation in the next 30 days. Higher than 71.10% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
- Fix
1.0.0- Upgrade ruby-saml to this version or later
Description
xml_security.rb in the ruby-saml gem before 1.0.0 for Ruby allows XPath injection and code execution because prepared statements are not used.
Affected versions
RubyGems
| Package | Vulnerable | Fixed in |
|---|---|---|
| ruby-saml | < 1.0.0 |
1.0.0 |
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.
ruby-saml RubyGems → 1.0.0
- bundler
bundle update ruby-saml # Gemfile: gem "ruby-saml", ">= 1.0.0"
Severity breakdown
CVSS 3.1 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
How to prevent it
- Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
- Implementation: If possible, ensure that all external commands called from the program are statically created.
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
- System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.
References
Advisories
Packages
Other links
- github.com/SAML-Toolkits/ruby-saml/pull/225
- github.com/SAML-Toolkits/ruby-saml/commit/9853651b96b99653ea8627d757d46bfe62ab6448
- github.com/SAML-Toolkits/ruby-saml/compare/v0.9.2...v1.0.0
- github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-saml/CVE-2015-20108.yml
- github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-saml/OSVDB-124991.yml
- security.netapp.com/advisory/ntap-20230703-0003
- security.snyk.io/vuln/SNYK-RUBY-RUBYSAML-20217
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-x4h9-gwv3-r4m4 Ruby-saml allows a Libxml2 Canonicalization error to bypass Digest/Signature validation | Critical | Also affects ruby-saml |
| GHSA-9v8j-x534-2fx3 Ruby-saml has a SAML authentication bypass due to namespace handling (parser differential) | Critical | Also affects ruby-saml |
| GHSA-rrqh-93c8-j966 Ruby SAML DOS vulnerability with large SAML response | Medium | Also affects ruby-saml |
| GHSA-754f-8gm6-c4r2 Ruby SAML allows a SAML authentication bypass due to namespace handling (parser differential) | Critical | Also affects ruby-saml |
| GHSA-4vc4-m8qh-g8jm Ruby SAML allows a SAML authentication bypass due to DOCTYPE handling (parser differential) | Critical | Also affects ruby-saml |
| GHSA-92rq-c8cf-prrq Ruby SAML allows remote Denial of Service (DoS) with compressed SAML responses | High | Also affects ruby-saml |
| GHSA-jw9c-mfg7-9rx2 SAML authentication bypass via Incorrect XPath selector | Critical | Also affects ruby-saml |
| GHSA-x2fr-v8wf-8wwv Ruby-SAML Improper Authentication vulnerability | High | Also affects ruby-saml |
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