PatchClock

PHP security digest · 18 Sep 2026

Paymenter has a credit-refund double-spend race condition in service downgrade (doUpgrade)

Medium CVE-2026-71537

Package
paymenter/paymenter
Fixed in
1.5.7
Published
Fri 18 Sep 2026, 18:58 LisbonUpdated Mon 26 Oct 2026, 00:27 Lisbon
Installs on Packagist
29

In plain words

An authenticated customer with an active service eligible for downgrade can receive multiple credit refunds for a single downgrade if concurrent requests bypass the eligibility check. The extra credit can be spent on invoices or additional services, causing financial and resource loss to the operator.

Affected versions

PackageAffectedFixed in
paymenter/paymenter<= 1.5.61.5.7

Am I affected?

Look for paymenter/paymenter in composer.lock. Versions up to and including 1.5.6 are affected; 1.5.7 is fixed. Check whether authenticated customers can downgrade active services through app/Livewire/Services/Upgrade.php::doUpgrade(). The advisory names no additional configuration or database requirement.

What to do

Check which version you have, then update to a fixed release for your branch (1.5.7):

composer show paymenter/paymenter | grep versions
composer update paymenter/paymenter

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

The advisory's description

Summary

The service downgrade implementation in app/Livewire/Services/Upgrade.php::doUpgrade() executes a proration calculation and a subsequent user credit refund without any transactional safety or database locks. The only concurrency check relies on an unisolated database query checking for existing pending upgrades. Because there is no active database transaction or pessimistic row-level lock spanning this validation and the subsequent credit update, concurrent downgrade requests can bypass the guard simultaneously. This allows a user to trigger multiple refunds for a single service downgrade.

Technical Details

The issue occurs because the application verifies eligibility using an unlocked read operation (Service::upgradable) which checks if a pending upgrade row exists. Since there is no enclosing DB::transaction or lockForUpdate(), multiple requests sent in parallel can all query the database at the same millisecond, observe that no pending upgrade exists, and pass the safety check.

Once passed, each concurrent request inserts its own pending upgrade record and executes $credit->increment('amount', abs($price)). Because the balance updates are not serialized against the initial check, the user's credit balance is cumulatively inflated by $N$ times the refund amount for a single legitimate downgrade.

Impact

This race condition allows any authenticated customer with an active, downgradable service to inflate their spendable credit balance to an arbitrary multiple of their legitimate refund amount.

Because the newly granted balance acts as real, spendable store credit, it can be immediately leveraged to settle future platform invoices or provision additional services, resulting in direct financial and resource loss to the operator.

Weakness: CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'). Reported by Pig-Tail, CorwinDev.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.