Vulnerabilities in pkg:gem/shrine
PACKAGECVE-2020-15237 is a MODERATE (CVSS 5.9) possible timing attack vulnerability (CWE-203: Observable Discrepancy) affecting Shrine libraries in the RubyGems ecosystem. The issue involves possible timing attack in derivation_endpoint. Remediation is available by upgrading affected packages to version 3.3.0.
pkg:gem/shrine
Vulnerability advisories affecting package pkg:gem/shrine. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5jjv-x4fq-qjwp | CVE-2020-15237 | MODERATE | Possible timing attack in derivation_endpoint |
CVE-2020-15237 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2020-15237
To remediate this vulnerability, upgrade all affected Shrine 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 shrine to 3.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for shrine
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-15237, inspect your project dependencies for Shrine:
inspect dependencies for shrine
Analyze the terminal output to locate any version of Shrine in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.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-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In Shrine, 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-2020-15237 Affected Shrine Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
shrine
|
RubyGems |
< 3.3.0
|
3.3.0
|
References
Frequently Asked Questions
What is CVE-2020-15237?
Which Shrine versions are affected?
What version fixes CVE-2020-15237?
Is shrine affected?
What is the CVSS score of CVE-2020-15237?
What CWE is associated with CVE-2020-15237?
How can I check RubyGems dependencies for CVE-2020-15237?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5jjv-x4fq-qjwp",
"modified" : "2023-05-16T16:18:49Z",
"published" : "2020-10-05T15:48:34Z",
"aliases" : [ "CVE-2020-15237" ],
"summary" : "Possible timing attack in derivation_endpoint",
"details" : "### Impact\n\nWhen using the `derivation_endpoint` plugin, it's possible for the attacker to use a timing attack to guess the signature of the derivation URL.\n\n### Patches\n\nThe problem has been fixed by comparing sent and calculated signature in constant time, using `Rack::Utils.secure_compare`. Users using the `derivation_endpoint` plugin are urged to upgrade to Shrine 3.3.0 or greater.\n\n### Workarounds\n\nUsers of older Shrine versions can apply the following monkey-patch after loading the `derivation_endpoint` plugin:\n\n```rb\nclass Shrine\n class UrlSigner\n def verify_signature(string, signature)\n if signature.nil?\n fail InvalidSignature, \"missing \\\"signature\\\" param\"\n elsif !Rack::Utils.secure_compare(signature, generate_signature(string))\n fail InvalidSignature, \"provided signature does not match the calculated signature\"\n end\n end\n end\nend\n```\n\n### References\n\nYou can read more about timing attacks [here](https://en.wikipedia.org/wiki/Timing_attack).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "shrine"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/shrinerb/shrine/security/advisories/GHSA-5jjv-x4fq-qjwp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15237"
}, {
"type" : "WEB",
"url" : "https://github.com/shrinerb/shrine/commit/1b27090ce31543bf39f186c20ea47c8250fca2f0"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/shrine/CVE-2020-15237.yml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/shrinerb/shrine"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-203", "CWE-208" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-10-05T15:46:53Z",
"nvd_published_at" : null
}
}