Junglewise Threat Intelligence

Pay RubyGem non-constant-time HMAC comparison in Paddle Billing webhook

Severity: high · CVSS 7.4 · Published 2026-07-01

Technologies: Pay-Rails Pay.

Executive brief

The Pay library, a popular billing integration for Ruby on Rails applications, contains a security flaw in how it verifies incoming webhooks from Paddle Billing. An attacker could potentially use a timing-based attack to guess the secret signature required to authorize these messages. If successful, the attacker could forge billing events, such as falsely confirming a payment or subscription, leading to unauthorized access to paid features or incorrect financial records.

Technical details

The vulnerability exists in `Pay::Webhooks::PaddleBillingController#valid_signature?` where the computed HMAC-SHA256 digest is compared against the user-provided `Paddle-Signature` header using Ruby's `String#==` operator. Because this operator returns early upon encountering the first mismatching byte, it creates a measurable timing side-channel. A remote, unauthenticated attacker can use this oracle to recover the valid signature byte-by-byte. Once recovered, the attacker can forge arbitrary webhook events (e.g., `subscription.created`, `transaction.completed`), potentially leading to unauthorized provisioning of services. The recommended fix is to use `ActiveSupport::SecurityUtils.secure_compare`.

Affected products

  • pay-rails pay <= 11.6.1

Timeline

  • 2026-05-27: disclosed: Initial disclosure date mentioned in advisory.
  • 2026-07-01: advisory: GitHub Advisory published.

References