Advisory

GHSA-5jjv-x4fq-qjwp

Also known as: CVE-2020-15237

Summary

Possible timing attack in derivation_endpoint

Details

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:

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-10-05 15:48 UTC
Modified
2026-07-08 06:29 UTC

Affected packages and fixes

shrine

RubyGems · All systems

Affected

  • introduced 0, fixed 3.3.0 (ecosystem)

Fixed versions

3.3.0

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences