See how paymenter compares to other vendors in security performance
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.
Impact
The ticket attachments functionality in Paymenter allows a malicious authenticated user to upload arbitrary files.
With the ability to execute arbitrary code, this vulnerability can be exploited in numerous ways, including but not limited to: - Extracting sensitive data from the database (e.g. customer information). - Reading credentials from .env or other configuration files. - Running arbitrary system commands under the web server user context.
This issue is Critical as it allows a low-privilege authenticated user to fully compromise the application and underlying server.
Patches This vulnerability was patched by https://github.com/Paymenter/Paymenter/commit/87c3db42282ada1e3cda54b9a01f846926c0669b and was released under the v1.2.11 tag without any other code modifications compared to v1.2.10.
Work arounds If upgrading is not immediately possible, administrators can mitigate this vulnerability with one or more of the following measures:
- Updating nginx config to download attachments instead of executing them: location ^~ /storage/ { types { } defaulttype application/octet-stream; addheader X-Content-Type-Options nosniff; tryfiles $uri =404; } - Disallow access to /storage/ fully using a WAF such as Cloudflare
These workarounds significantly reduce risk, but the only guaranteed resolution is upgrading to v1.2.11 or later.