CVE-2017-7540: Safemode Safemode Gem Has Incomplete List Vulnerability
CRITICALCVE-2017-7540 is a CRITICAL (CVSS 9.8) safemode gem has incomplete list vulnerability (CWE-184: Incomplete List of Disallowed Inputs) affecting Safemode libraries in the RubyGems ecosystem. The issue involves safemode gem has incomplete list of disallowed inputs. Remediation is available by upgrading affected packages to version 1.3.2.
CVE-2017-7540 at a Glance
Security Impact
CVSS: 9.8
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:H/I:H/A:H).
How to Fix CVE-2017-7540
To remediate this vulnerability, upgrade all affected Safemode dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade safemode to 1.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for safemode
How to Check if You Are Affected
To determine whether your application is affected by CVE-2017-7540, inspect your project dependencies for Safemode:
inspect dependencies for safemode
Analyze the terminal output to locate any version of Safemode in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), 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-184: Incomplete List of Disallowed Inputs, where the product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. In Safemode, 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
CVE-2017-7540 Affected Safemode Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
safemode
|
RubyGems |
< 1.3.2
|
1.3.2
|
References
Frequently Asked Questions
What is CVE-2017-7540?
Which Safemode versions are affected?
What version fixes CVE-2017-7540?
Is safemode affected?
What is the CVSS score of CVE-2017-7540?
What CWE is associated with CVE-2017-7540?
How can I check RubyGems dependencies for CVE-2017-7540?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5vx5-9q73-wgp4",
"modified" : "2023-09-05T21:30:18Z",
"published" : "2017-10-24T18:33:35Z",
"aliases" : [ "CVE-2017-7540" ],
"summary" : "Safemode Gem Has Incomplete List of Disallowed Inputs",
"details" : "rubygem-safemode, as used in Foreman, versions 1.3.1 and earlier are vulnerable to bypassing safe mode limitations via special Ruby syntax. This can lead to deletion of objects for which the user does not have delete permissions or possibly to privilege escalation.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "safemode"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-7540"
}, {
"type" : "WEB",
"url" : "https://github.com/svenfuchs/safemode/pull/23"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/safemode/CVE-2017-7540.yml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/svenfuchs/safemode"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-184" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:17:24Z",
"nvd_published_at" : "2017-07-21T22:29:00Z"
}
}