-
-
Notifications
You must be signed in to change notification settings - Fork 219
/
CVE-2020-15237.yml
43 lines (35 loc) · 1.28 KB
/
CVE-2020-15237.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
gem: shrine
cve: 2020-15237
ghsa: 5jjv-x4fq-qjwp
url: https://github.com/shrinerb/shrine/security/advisories/GHSA-5jjv-x4fq-qjwp
date: 2020-10-05
title: Possible timing attack in derivation_endpoint
description: |
### Impact
When using the `derivation_endpoint` plugin, it's possible for the attacker to use a timing attack
to guess the signature of the derivation URL.
### Patches
The 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.
### Workarounds
Users of older Shrine versions can apply the following monkey-patch after loading the `derivation_endpoint` plugin:
```rb
class Shrine
class UrlSigner
def verify_signature(string, signature)
if signature.nil?
fail InvalidSignature, "missing \"signature\" param"
elsif !Rack::Utils.secure_compare(signature, generate_signature(string))
fail InvalidSignature, "provided signature does not match the calculated signature"
end
end
end
end
```
### References
You can read more about timing attacks [here](https://en.wikipedia.org/wiki/Timing_attack).
cvss_v3: 5.9
patched_versions:
- ">= 3.3.0"