Executive brief
ZenHive mpp is a payment processing library that handles on-chain cryptocurrency payments for resource access. A race condition in the payment verification logic allows an attacker to redeem a single confirmed blockchain payment multiple times by submitting concurrent requests, resulting in free access to paid resources. This vulnerability only affects systems configured with a deduplication store; the default configuration is unaffected.
Technical details
The vulnerability is a Time-of-Check Time-of-Use (TOCTOU) race condition in the hash-based credential verification path (MPP.Methods.Tempo.verify/2). The vulnerable code checks whether a payment hash has been used (check_hash_unused/2), verifies the payment on-chain via eth_getTransactionReceipt, and only then marks it as used (mark_hash_used/2). This sequence is non-atomic: concurrent requests can all pass the initial check before any performs the mark operation, allowing each to receive a valid receipt for the same payment. The underlying dedup store provides an atomic check_and_mark/2 primitive that is used by the transaction-based path but not the hash path. Exploitation requires a dedup store to be explicitly configured; the default nil store does not deduplicate and is unaffected. Attack vector is network-based and requires no authentication. Patched in version 0.6.1.
Affected products
- ZenHive mpp 0.2.0 before 0.6.1
Timeline
- 2026-08-19: disclosed
- 0.6.1: patched