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.
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.
Users of older Shrine versions can apply the following monkey-patch after loading the derivation_endpoint
plugin:
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
You can read more about timing attacks here.
{ "nvd_published_at": null, "cwe_ids": [ "CWE-203", "CWE-208" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2020-10-05T15:46:53Z" }