Am I affected?

type your mpp version to check

Description

Time-of-check Time-of-use (TOCTOU) Race Condition in ZenHive mpp allows an unauthenticated remote client to redeem one confirmed on-chain payment for multiple paid-resource accesses.

The type="hash" credential path in MPP.Methods.Tempo.verify/2 guards against replay with a non-atomic check-then-mark sequence: check_hash_unused/2 reads the dedup store, an eth_getTransactionReceipt round trip verifies the payment on chain, and only then does mark_hash_used/2 write the mark. Concurrent requests carrying the same settled payment hash all pass the read before any of them writes, so each is issued a receipt. The store's atomic check_and_mark/2 primitive is available and used by the type="transaction" path, but the hash path calls plain get and put even when the configured store implements it. Exploitation requires a dedup store to be configured; the default nil store is stateless and documented as offering no replay protection at all.

This issue affects mpp: from 0.2.0 before 0.6.1.

Weaknesses & attack patterns

Weakness

CWE-367 · Time-of-check Time-of-use (TOCTOU) Race Condition in catalog → MITRE ↗

Attack patterns

CAPEC-29 · Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions MITRE ↗

Affected — Hex / mpp Hex.pm ↗ Repository ↗

0.2.0 < 0.6.1 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:ZenHive:mpp:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.MPP.Methods.Tempo'
source files lib/mpp/methods/tempo.ex
routines 'Elixir.MPP.Methods.Tempo':verify/2

Affected — GitHub / zenhive/mpp Repository ↗

f890466 < 46c5b0e affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:ZenHive:mpp:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.MPP.Methods.Tempo'
source files lib/mpp/methods/tempo.ex
routines 'Elixir.MPP.Methods.Tempo':verify/2

Configurations

The race is only reachable when MPP.Methods.Tempo is configured with a dedup store ("store" in method_config). The default is nil, which runs the library statelessly and provides no application-level replay protection at all, a documented property rather than part of this issue.

References

Credits

Jonatan Männchen / EEF Analyst
E.FU Finder Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
« All CVEs