Security report: 120 CodeRabbit scan findings (2026-11-09)
Security report
CodeRabbit-generated scan of 96aaa12c77f3401059da06c6e94cbbb2ef961fc2, generated 2026-11-09T09:35:23.727Z. This report contains 120 potential vulnerabilities: 14 high, 67 medium, 39 low, as rated by the scan. Findings and severity ratings require independent validation; no reproduction was performed for this report.
The numbered list below preserves every finding from the supplied scan. Full descriptions, reported evidence and call stacks, and suggested remediations follow in the issue comments. Numbers correspond to the original scan rows.
Findings
High (14)
- Finding 11 —
src/Service/Brand/BrandContext.php:74: Public checkout persists its merchant into the administrative tenant-selection session field. Administrative resolution then accepts that merchant after checking only its existence, allowing staff permissions for one merchant to authorize operations against another merchant. - Finding 13 —
templates/admin/my-account-2fa.twig:44: The enrollment page sends the account's TOTP secret and email to an external QR service in an image URL. That service receives the persistent secret needed to generate future second-factor codes. - Finding 22 —
src/Service/Brand/BrandContext.php:203: Public checkout writes its merchant into the session field that selects the administrative tenant. Administrative handlers subsequently trust that selection without checking the authenticated user’s authority over the merchant, allowing cross-merchant financial-data access and changes. - Finding 39 —
src/Service/Payment/PaymentLinkService.php:234: Administrative payment-link operations use the selected merchant or global session mode without checking the current user’s authority over that scope. Public checkout can replace the merchant selection, allowing restricted staff to read, create, reprice, or disable another merchant’s payment links. - Finding 54 —
src/Controller/Admin/PluginController.php:573: Public checkout persists its merchant into the same session selection used for administrative writes. Plugin settings then consume that selection without checking whether the authenticated staff member may administer the merchant, enabling cross-merchant configuration changes. - Finding 72 —
src/Controller/Admin/SmsTemplateAdminController.php:533: Manual SMS matching completes a payment and posts its ledger entries without requiring a valid SMS to be linked. A positive nonexistent or foreign SMS ID causes a zero-row update that is ignored, allowing an SMS manager to mark a pending payment as received without supporting SMS evidence. - Finding 74 —
src/Controller/Admin/ApiKeyController.php:100: Public checkout persists its merchant selection in the same session field used by administrative operations. Those operations trust the selected merchant without checking the staff member's tenant access, allowing restricted staff to generate credentials owned by another merchant. - Finding 86 —
src/Controller/Admin/DeveloperController.php:117: The Developer Hub configures tenant state but calls pagination that ignores it. The resulting records include other merchants' webhook signing secrets, which are passed unfiltered to the requesting operator's HTML. - Finding 93 —
modules/gateways/bitpay/BitpayGateway.php:139: The callback invoice identifier is inserted into a credential-bearing URL without path encoding. Query and fragment delimiters in that identifier can replace the configured merchant token with an attacker-controlled token, allowing an invoice belonging to another account to authorize local settlement. - Finding 95 —
modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:357: Nagad verification combines successful payment evidence for a callback-selected provider reference with an independently selected local transaction. It never establishes that the provider payment belongs to that transaction, so a customer can reuse a successful payment for another same-amount checkout. - Finding 98 —
src/Controller/Admin/CurrencyController.php:86: Currency updates consume a brand operator's settings.manage permission without checking authority to change platform-wide currency data. A brand-scoped operator can consequently change shared definitions and exchange rates used by other merchants. - Finding 103 —
modules/gateways/binance-personal/BinancePersonalGateway.php:253: The blockchain verifier accepts recipient information and successful execution as sufficient payment proof, then returns the caller's declared amount. A successful zero-value or dust transaction can consequently authorize settlement for a substantially larger order. - Finding 111 —
modules/gateways/neteller/NetellerGateway.php:261: Neteller treats the presence of an Authorization header as proof that a webhook is authentic. An attacker can supply an arbitrary header and a pending transaction reference, causing the handler to mark an unpaid transaction complete and its linked invoice paid. - Finding 114 —
modules/gateways/nmi/NmiGateway.php:260: NMI accepts an arbitrary nonempty signature header as an authentic webhook. Its handler then completes the attacker-selected pending transaction without proving payment, allowing an unpaid linked invoice to become paid.
Medium (67)
- Finding 2 —
src/Service/Brand/BrandContext.php:218: Global merchant scope is authorized when selected but later accepted from persistent session state without checking current cross-merchant permission. Revoking brands.access_all therefore leaves an existing session able to perform global operations using retained resource permissions. - Finding 3 —
templates/admin/developer/index.twig:325: The Developer Hub embeds raw JSON containing a stored webhook secret inside a single-quoted HTML attribute. JSON encoding does not escape apostrophes for HTML, allowing a merchant's secret to create attacker-controlled markup and execute an event handler when CSP is report-only. - Finding 4 —
src/Service/System/TranslationService.php:297: The language upload endpoint checks settings.manage but never verifies that the caller may administer platform-wide state. A staff member restricted to one brand can replace a shared translation catalog, changing text consumed by other brands and administrators. - Finding 5 —
src/View/SettingsRenderer.php:123: The tenant settings handler passes inherited platform credentials to the form renderer. PayPal classifies its private OAuth client secret as a text field, causing the renderer to include that secret in the tenant response. - Finding 6 —
src/Service/System/FilesystemService.php:136: The upload validator checks raw SVG text but allows nested HTML documents whose executable markup is encoded in XML attributes. Public upload callers then publish the original bytes on the application origin, allowing script execution when a victim opens the SVG as a document. - Finding 8 —
src/Service/Payment/GatewayApiService.php:81: Payment initiation checks global gateway availability without checking whether the target merchant has authorized and configured that gateway. An unconfigured wallet consequently receives empty credentials, defaults to simulated mode, and can complete a real checkout using a fabricated payment callback. - Finding 9 —
src/Service/Communication/CommunicationService.php:242: The fallback mail transport concatenates a configurable sender name into raw mail headers without rejecting line breaks. A brand settings administrator can add recipient headers to another staff member’s password-reset email and obtain the bearer token needed to change that account’s password. - Finding 15 —
src/Service/Payment/PaymentCompletionListener.php:67: Payment completion marks an invoice paid using its identifier without checking whether the completed transaction satisfies the invoice's current amount, currency, and payable status. Merchant edits leave previously issued checkout transactions valid, allowing payment under obsolete terms to settle the revised invoice. - Finding 18 —
src/Service/Payment/GatewayApiService.php:227: Settlement compares numeric amounts without checking their denominations. A gateway can charge the invoice's unchanged numeral in a different currency, allowing a smaller economic payment to complete the full invoice and credit its original currency. - Finding 21 —
src/Service/Auth/PasswordResetService.php:144: Password replacement occurs after an unlocked token lookup and before exclusive token consumption. Concurrent requests can both pass validation, allowing one request to overwrite the password after another request successfully completes and consumes the recovery link. - Finding 23 —
src/Service/Auth/PasswordResetService.php:81: Password recovery selects its token-bearing destination through the merchant-controlled checkout/API domain resolver. Staff authorized to manage domains can therefore redirect another same-merchant user's recovery credential to a server they control, without having authority to change that user's password. - Finding 24 —
src/Service/Payment/GatewayApiService.php:99: Existing checkout transactions retain their initial zero fee because initiation discards the calculated fee instead of saving it. Settlement passes that stored zero into accounting, increasing merchant payable by the fee that should have been allocated to platform revenue. - Finding 26 —
src/Update/BackupService.php:239: The restore splitter checks only the immediately preceding backslash when deciding whether a quote closes a string. A stored invoice number ending in a backslash can desynchronize this parser, causing SQL text in the invoice notes to execute as a separate statement with application database authority. - Finding 27 —
src/Repository/PairedDeviceRepository.php:79: Global revocation uses a lookup that searches only null-merchant devices after tenant scope is removed. Supported pairing assigns a positive merchant ID, so All-Brands revocation misses the selected device while the controller reports success, leaving its credentials usable. - Finding 28 —
src/Controller/Admin/RolesController.php:222: The permission-delegation check uses the role stored in the session at login instead of the actor's current database role. After a role reassignment, this can authorize grants of permissions that the actor no longer holds. - Finding 29 —
src/Repository/TransactionRepository.php:418: Invoice writes accept a customer ID without verifying that the customer belongs to the invoice merchant. Checkout transfers that association into a transaction, whose dashboard query joins the customer by ID alone and exposes the foreign customer's decrypted name and email. - Finding 31 —
src/Repository/MerchantUserRepository.php:279: Staff creation persists role ID 1 when no role was supplied and the merchant has no staff-slug role. The effective role is never checked for merchant ownership or delegation authority, allowing a staff manager to create an account with the installation Owner role. - Finding 32 —
src/Middleware/PermissionMiddleware.php:140: Removing brands.access_all does not revoke an existing session's global scope. A staff member who retains plugins.manage can continue changing global plugin and gateway status after losing authority to operate across brands. - Finding 36 —
src/Controller/Admin/DeviceController.php:443: The merchant device-settings handler writes submitted SMS filters into global settings without checking platform authority. A merchant device manager can therefore alter the filtering policy returned to other merchants' authenticated devices. - Finding 40 —
src/Controller/Admin/PluginController.php:216: Plugin installation accepts retained global session mode without checking current cross-brand authority. A staff member who loses brands.access_all but retains plugins.manage can still install application-wide PHP and execute its entrypoint through the settings action. - Finding 41 —
src/Controller/Admin/PluginController.php:822: Brand gateway settings can replace the destination while retaining a private key inherited from global settings. The merged configuration is persisted and later sends the platform key to the brand editor's destination. - Finding 43 —
src/Repository/MerchantUserRepository.php:339: Staff deletion derives cross-merchant authority from retained session view state without checking the user's current brands.access_all permission. A user whose role loses global access but retains staff.manage can continue deleting other merchants' non-superadmin staff through an existing global-view session. - Finding 48 —
src/Controller/Admin/PluginController.php:533: Secret redaction depends solely on the plugin field type, but bundled gateways declare private credentials as text or textarea. The settings page therefore returns decrypted bearer tokens, webhook secrets, and signing keys to staff with plugins.view, including inherited global credentials. - Finding 49 —
src/Controller/Install/InstallerController.php:395: The installer uses shared pending database credentials without verifying that the caller owns the installation attempt. After the operator imports the schema, an unrelated visitor can submit their own credentials and create the initial account with superadmin privileges. - Finding 50 —
src/Middleware/JwtAuthMiddleware.php:80: Mobile resource authentication accepts refresh JWTs because issuance gives them the same authentication claims as access JWTs. It also ignores the blacklist populated during refresh rotation, allowing an invalidated refresh credential to continue accessing merchant data until its original expiry or device revocation. - Finding 56 —
src/Controller/Admin/SettingsController.php:945: A brand settings manager can execute global retention deletes because the action handlers never verify platform administration authority. Their SQL filters by age without restricting merchant ownership, allowing one brand's staff to remove other brands' historical records. - Finding 57 —
src/Controller/Admin/StaffController.php:283: Staff role assignment verifies merchant membership but does not enforce the application's rule that non-superadmins may grant only permissions they hold. A staff manager can assign a stronger existing role to themselves or a controlled account; default-role resolution likewise performs no grant-authority check. - Finding 58 —
src/Controller/Admin/SettingsController.php:1520: Brand-scoped settings managers can change shared language state because the language actions require settings.manage without verifying platform administration authority. The default-language and translation stores have no merchant scope, so these writes affect other brands and administrators. - Finding 61 —
src/Controller/Admin/StaffController.php:299: A non-superadmin staff manager can replace a reachable superadmin's password and disable its TOTP because account-management actions check merchant ownership without checking the target's privilege. The attacker can then sign in as that account and obtain platform-wide superadmin authority. - Finding 63 —
src/Middleware/IdempotencyMiddleware.php:96: Idempotency middleware returns merchant-shared cached responses before endpoint-specific authorization runs. Because the cache does not distinguish API-key identities, a write-only credential can retrieve a privileged caller's cached plaintext API key despite lacking the admin scope required by the controller. - Finding 65 —
src/Repository/MerchantUserRepository.php:317: Staff updates validate role ownership but do not restrict which permissions the caller may delegate. A staff.manage holder can assign a stronger merchant-owned role to their own account and gain permissions that the role editor explicitly prohibits them from granting. - Finding 68 —
src/Controller/Admin/SettingsController.php:838: A brand settings manager can invoke platform-wide cache clearing because the handler checks no platform authority beyond the route's settings.manage permission. This removes shared security state, including other accounts' consumed TOTP windows. - Finding 75 —
modules/gateways/google-pay/GooglePayGateway.php:188: Google Pay accepts a mock payment identifier and a caller-supplied amount whenever its configured mode is non-live, including in production. Apple Pay, Authorize.Net, and Giropay have corresponding simulation branches that omit the explicit production prohibition, allowing forged confirmations to complete real transactions. - Finding 76 —
modules/gateways/blik/BlikGateway.php:226: In non-live gateway mode, a caller-selected SIM_ transaction identifier produces successful verification with the caller's declared amount. The branch omits the production guard and can authorize settlement without a provider payment. - Finding 77 —
modules/gateways/braintree/BraintreeGateway.php:201: When the payment nonce is missing and credential mode is not live, verification reports a simulated successful payment and echoes the caller's amount. This return bypasses the production guard, allowing an unpaid production transaction to complete and receive a ledger entry. - Finding 78 —
src/Controller/Admin/AuthController.php:224: TOTP consumption is persisted with an unconditional cache write after verification against an earlier read. Concurrent requests can both accept the same unused account-wide time window and then establish authenticated sessions. - Finding 79 —
modules/gateways/tap-payments/TapPaymentsGateway.php:208: Tap Payments accepts a callback identifier beginning with SIM_ as successful payment evidence whenever gateway mode is non-live. It omits the application's production restriction, allowing fabricated evidence to complete ordinary production transactions and create payment-received ledger entries. - Finding 80 —
modules/gateways/xendit/XenditGateway.php:203: Xendit verification accepts a caller-selected paid invoice without binding its external_id to the local transaction being completed. A customer can reuse payment evidence from one invoice to complete other eligible transactions with matching verified amounts. - Finding 81 —
modules/gateways/tsys/TsysGateway.php:261: TSYS accepts a signature header without validating its value and directly completes the pending payment referenced by the body. A fabricated notification can therefore mark an unpaid transaction and its linked invoice paid. - Finding 82 —
modules/gateways/skrill/SkrillGateway.php:261: Skrill webhook authentication checks only whether a signature header is nonempty, so callers can fabricate accepted notifications. The handler completes the referenced pending transaction without authenticating a successful matching payment, allowing an unpaid invoice to be marked paid. - Finding 85 —
modules/gateways/worldpay/WorldpayGateway.php:261: The Worldpay webhook verifier accepts any nonempty signature header without authenticating the notification. Its registered handler then marks a referenced pending transaction complete without establishing that payment occurred. - Finding 87 —
src/Controller/Admin/BrandController.php:405: Requests trust previously established global session scope after the permission authorizing that scope is revoked. Current operation permissions are checked independently, allowing a formerly global operator to continue acting on other merchants. - Finding 88 —
modules/gateways/stax/StaxGateway.php:260: Stax treats the presence of a signature header as successful authentication and directly completes the pending transaction identified by the body. An arbitrary header and known checkout reference can therefore replace proof of payment. - Finding 89 —
modules/gateways/sofort/SofortGateway.php:264: Sofort accepts unauthenticated webhook bodies and completes the pending transaction selected by their reason field. The handler never obtains authoritative payment confirmation, so a customer can mark an unpaid transaction and its linked invoice paid. - Finding 91 —
modules/gateways/paddle/PaddleGateway.php:186: Paddle, Payfast, and Xendit independently return successful payment verification for simulated or missing provider identifiers in non-live gateway mode, including when the application runs in production. Each branch accepts the callback's amount without provider evidence, allowing a customer to complete an unpaid real checkout. - Finding 92 —
modules/gateways/trustcommerce/TrustCommerceGateway.php:261: TrustCommerce accepts a signature header without verifying its contents and completes the pending transaction named by the notification. An attacker with a checkout reference can therefore substitute a fabricated notification for proof of payment. - Finding 94 —
modules/gateways/przelewy24/Przelewy24Gateway.php:264: Webhook authentication always succeeds without examining the notification or credentials. The registered handler then completes a pending transaction using the caller's sessionId, allowing an unpaid transaction and its linked invoice to be marked complete. - Finding 96 —
modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:330: Nagad sandbox verification sends its status request over HTTP and accepts the returned JSON without authenticating it. An on-path attacker can replace the response with a successful status and the expected amount, causing an unpaid transaction to be completed and credited. - Finding 97 —
modules/gateways/rapyd/RapydGateway.php:261: Webhook authentication checks only that a signature header is nonempty, allowing callers to fabricate accepted payment notifications. The handler completes the referenced pending transaction without checking authenticated payment status or value, which can mark an unpaid invoice paid. - Finding 99 —
modules/gateways/giropay/GiropayGateway.php:239: Giropay webhook authentication always succeeds without examining the body, headers, or credentials. Its registered handler completes a pending transaction selected by the caller's purpose field without confirming payment, allowing an unpaid invoice to become paid. - Finding 100 —
modules/gateways/payfast/PayfastGateway.php:211: Payfast verifies a form-decoded representation of the request but completes payments using a separately decoded JSON representation. When the optional passphrase is empty, a crafted JSON body can satisfy the form signature check without authenticating the payment fields consumed by the handler. - Finding 101 —
modules/gateways/bluesnap/BlueSnapGateway.php:244: The webhook verifier accepts any nonempty Authorization header without authenticating its value or the notification. The custom handler then completes the caller-selected pending transaction without confirming payment with BlueSnap. - Finding 102 —
modules/gateways/paytabs/PayTabsGateway.php:182: PayTabs returns successful verification for a simulated or missing provider identifier whenever its effective credential mode is not live. It also treats the callback's amount as verified payment evidence, allowing an unpaid checkout to become completed and credit the merchant ledger even in production. - Finding 104 —
src/Controller/Admin/DashboardController.php:548: The profile action changes the password-recovery email using session authority alone. Temporary access to an authenticated session can therefore bypass the current-password requirement for password replacement by redirecting recovery to an attacker-controlled mailbox. - Finding 105 —
modules/gateways/authorize-net/AuthorizeNetGateway.php:197: In non-live mode, an absent or SIM_-prefixed gateway transaction identifier produces successful verification using the caller's amount. The branch omits the production guard and can complete real transactions without provider-confirmed payment. - Finding 106 —
modules/gateways/shift4/Shift4Gateway.php:261: Shift4 webhook authentication accepts any nonempty signature header without checking authenticity. The handler then completes the referenced pending transaction without confirming a successful matching payment, which can mark an unpaid invoice paid. - Finding 108 —
modules/gateways/xendit/XenditGateway.php:245: The Xendit webhook handler treats a matching invoice reference as sufficient evidence of payment. When optional expiry notifications are enabled, an authentic notification for an unpaid expired invoice can complete its pending local transaction. - Finding 109 —
src/Service/Payment/GatewayApiService.php:244: The callback handler completes the checkout selected by callback data without checking that EPS verified payment for that same checkout. A valid payment reference for another order can therefore authorize completion and ledger credit for an unpaid order with the same amount. - Finding 110 —
modules/gateways/przelewy24/Przelewy24Gateway.php:188: The non-live simulation branch treats a caller-chosen SIM_ identifier and amount as authenticated payment evidence. It omits the production-environment restriction, allowing forged callbacks to complete ordinary transactions and credit merchant accounting. - Finding 112 —
src/Controller/Admin/AdminPageTrait.php:259: The shared admin renderer retrieves and displays transaction and dispute notifications without enforcing their respective read permissions. Staff allowed to view their account page can therefore receive payment details that the dedicated feature routes deny them. - Finding 113 —
modules/gateways/blik/BlikGateway.php:308: The webhook verifier always returns true. Its registered handler then treats caller-supplied transaction identifiers as payment confirmation and completes an unpaid pending transaction. - Finding 115 —
modules/gateways/tap/TapGateway.php:193: Tap issues signed simulated payment evidence after a failed initiation request in non-live mode and accepts that evidence without checking the application environment. In production, a customer can use the returned simulation to complete an unpaid transaction and create payment-received ledger entries. - Finding 116 —
modules/gateways/checkout-com/CheckoutComGateway.php:282: The webhook verifier accepts an arbitrary nonempty signature when its authentication secret is absent. Because activation can enable the plugin before credentials exist, an unauthenticated notification can reach the custom handler and complete an unpaid pending transaction. - Finding 117 —
modules/gateways/airtel-money/AirtelMoneyGateway.php:85: The Airtel adapter copies an access token obtained using the merchant's client credentials into the shopper-facing redirect URL. This exposes an application authentication credential to a shopper who is authorized only to initiate their checkout. - Finding 118 —
modules/gateways/apple-pay/ApplePayGateway.php:180: In non-live gateway mode, an arbitrary APAY_MOCK_ identifier produces successful verification with the caller's declared amount. This branch omits the production guard, allowing simulated proof to authorize real transaction completion. - Finding 119 —
modules/gateways/alipay/AlipayGateway.php:63: The Alipay private signing key is declared as an ordinary textarea, so the settings renderer includes its decrypted stored value in the page. Staff allowed to view plugin settings can therefore obtain a signing credential even without settings-management permission, including an inherited global credential when that fallback applies. - Finding 120 —
modules/addons/telegram-bot/Plugin.php:752: The Telegram webhook trusts a chat ID supplied in unauthenticated request JSON. An attacker who supplies the configured ID can invoke administrative actions, including refunding an eligible transaction using its merchant's stored gateway credentials. Missing chat configuration also permits an omitted chat ID to pass the empty-string comparison.
Low (39)
- Finding 1 —
src/Service/Payment/PaymentCompletionListener.php:77: Payment-link capacity is checked before checkout creation but is not reserved across independent transactions. Successful payments increment the shared counter without enforcing max_uses, so transactions initiated while capacity remains can all complete beyond the merchant's configured limit. - Finding 7 —
src/Service/System/Logger.php:199: CSRF rejection messages include the submitted token, and the file logger writes message line breaks unchanged. An unauthenticated request can therefore add lines that resemble independently generated application records, compromising log integrity. - Finding 10 —
src/Service/System/HttpClient.php:378: The second DNS lookup can return no addresses without stopping the request. This leaves cURL free to resolve the hostname again and connect to an address that never passed the public-address check. - Finding 12 —
src/Update/UpdateService.php:257: The logger appends messages without escaping embedded carriage returns or newlines. The update endpoint logs its submitted version before checking release membership, allowing an update operator to insert misleading physical lines into the application log. - Finding 14 —
src/Service/Device/DevicePairingService.php:229: Replacement pairing revokes only one fingerprint match, and that lookup can return an already revoked historical record. A newer matching device can therefore retain access after a replacement pairing intended to invalidate it. - Finding 16 —
tests/Unit/PdfServicePathTraversalTest.php:18: The test chooses a predictable temporary directory without creating it exclusively, and PdfService accepts a directory already present there. A different local user can prepare that directory with a destination symlink, causing the test process to overwrite a file the attacker cannot normally modify. - Finding 17 —
src/Service/Domain/DomainUrlService.php:74: Checkout submission can process one merchant's payment on another merchant's registered domain. When URL configuration falls back to the request host, that unrelated domain becomes the gateway return destination, allowing the operator of that domain to redirect the payment journey away from the intended merchant. - Finding 19 —
src/Service/Notification/MobileNotificationService.php:249: The default notification queue reprocesses its entire retained JSON history whenever a notification is added. An authenticated device can grow that shared history using valid SMS submissions, causing increasingly expensive work and lock contention for other devices and merchants. - Finding 20 —
src/Service/System/TranslationService.php:556: Flattening repeats a parent key in every descendant key without checking the resulting size. A 162,736-byte nested catalog can require more than 536 MB for flattened key text alone, exhausting a request's memory budget or imposing substantial memory pressure on shared PHP workers. - Finding 25 —
src/Service/Device/DevicePairingService.php:294: The refresh endpoint accepts an access JWT as proof of renewal authority because verification does not distinguish token purposes. A holder of an access token and its device fingerprint can obtain a renewable 30-day refresh credential without possessing the legitimate refresh token. - Finding 30 —
src/Middleware/CsrfMiddleware.php:159: The CSRF rejection handler treats the Referer path as a local redirect destination without checking its leading slashes. A path beginning with two slashes becomes an external destination when emitted in Location. - Finding 33 —
src/Middleware/CsrfMiddleware.php:130: CSRF rejection includes the attacker-supplied token in a log message. The logger writes embedded newlines unchanged, so one rejected request can insert fabricated application-log records. - Finding 34 —
src/Controller/Checkout/CheckoutController.php:843: The controller treats unsuccessful payment verification as permission to accept a terminal failure supplied by the browser. Someone holding a checkout reference can mark an in-flight payment failed without authoritative gateway evidence and prevent its later legitimate confirmation from completing normally. - Finding 35 —
src/Controller/Admin/DomainController.php:332: The ordinary domain update persists browser-supplied ownership verification and activation flags. A domain manager can make routing treat an unverified hostname as verified without completing the server's DNS TXT ownership challenge. - Finding 37 —
src/Repository/AuditLogRepository.php:93: The audit verifier obtains its signing key through a configuration service that prefers mutable database settings over the environment. A database-only attacker can replace both audit contents and the key used to authenticate them, defeating the documented database-tampering check. - Finding 38 —
src/Middleware/IpAllowlistMiddleware.php:45: The webhook IP restriction reads only the process environment, although normal application boot loads dotenv values into PHP superglobals. A restrictive dotenv-only IP_ALLOWLIST is consequently treated as absent, allowing requests from excluded addresses to reach webhook handling. - Finding 42 —
src/Controller/Admin/TransactionController.php:303: The controller posts payment-received entries even when the completion service rejects the state transition. A concurrent checkout cancellation can therefore leave the transaction cancelled while increasing cash and merchant payable without a completed payment. - Finding 44 —
src/Repository/AuditLogRepository.php:205: The integrity scanner treats a null signature as sufficient proof that a row is legitimate legacy history. A database-only attacker can clear a signature after altering a record, causing the application to sign the forged contents and accept them as intact. - Finding 45 —
src/Controller/Checkout/PaymentIntentCheckoutController.php:1000: Intent cancellation validates checkout identity but does not restrict the stored intent's current state. A payer retaining the original signature can replace completed parent status with cancelled, corrupting the merchant-visible intent lifecycle and producing a false cancellation result. - Finding 46 —
src/Cron/UpdateCheckJob.php:51: The automatic installation job ignores the dashboard's persisted disabling policy and checks only the process-environment AUTO_UPDATE flag. It can therefore replace application files and run database migrations after an administrator disables automatic installation. - Finding 47 —
src/Repository/TransactionRepository.php:693: Manual verification checks the transaction status in a separate read, then writes pending_review without requiring the checked state to remain unchanged. A concurrent administrative completion or cancellation can be overwritten, reversing the terminal decision and disrupting financial state and refund eligibility. - Finding 51 —
src/Controller/Admin/MobileNotificationLogController.php:85: The notification dashboard uses the session-selected merchant without checking whether the authenticated staff member may access that merchant. Public payment-link checkout writes the same selection, allowing staff to retrieve another merchant’s database-backed notification records. - Finding 52 —
src/Service/Auth/JwtService.php:225: Refresh credentials use the same signed claims and verification rules as access credentials, differing only in lifetime. This lets a refresh token authorize mobile requests directly and lets an access token obtain replacement credentials when the device fingerprint is available. - Finding 53 —
src/Controller/Install/InstallerController.php:122: During unlocked installation, anonymous callers can make the server attempt MySQL connections to destinations they select. Distinct connection errors let them distinguish reachable MySQL authentication endpoints from refused connections through the application's network position. - Finding 55 —
src/Controller/Page/CronController.php:67: Cron authentication prefers a process-environment secret, while the regeneration operation changes only the database secret. A former credential holder can continue authenticating after the administrator receives a successful regeneration message. - Finding 59 —
src/Controller/Admin/SettingsController.php:211: Brand settings pages omit cron_secret from their display settings, then mistake that omission for an absent global credential. Rendering an allowed brand tab therefore replaces the platform cron secret even when the caller has only viewing permission. - Finding 60 —
src/Controller/Admin/DisputeController.php:235: The dispute upload handler overrides the private storage directory with a directory beneath the public web root. The resulting document URL permits anyone who knows it to retrieve sensitive evidence without the current session, permission, or merchant checks protecting the dispute. - Finding 62 —
src/Repository/AuditLogRepository.php:120: The audit signature does not authenticate created_at. A database-only attacker can falsify an event's chronology without invalidating its signature, and backdating can make the event eligible for an ordinary retention purge. - Finding 64 —
src/Gateway/GatewayBridge.php:78: Payment initiation invokes a gateway without enforcing the merchant's explicit inactive plugin override. Credential lookup can fall back to usable global credentials or retained plugin settings, allowing a checkout visitor to initiate payment through a gateway disabled for that brand. - Finding 66 —
src/Controller/Admin/SettingsController.php:1462: A brand settings manager can replace the platform's database-backed cron credential because the rotation handler never checks platform administration authority. Where cron authentication uses that credential, existing scheduled requests immediately lose access. - Finding 67 —
src/Controller/Checkout/PaymentLinkCheckoutController.php:224: The public submission handler creates a linked transaction using the payer's amount even when the merchant configured a fixed price. A payer can therefore complete an underpriced payment that counts as successful use of that link. - Finding 69 —
src/Controller/Admin/TransactionController.php:340: The manual refunded-status branch posts a reversal for the original payment amount without subtracting earlier refunds. After a partial refund, it can reduce cash and merchant payable by more than the original payment across the combined refund journals. - Finding 70 —
src/Repository/DisputeRepository.php:86: The application presents finalized disputes as locked, but resolution updates check only record and merchant IDs. A user authorized to resolve active disputes can submit another resolution request and overwrite finalized evidence and verdict metadata. - Finding 71 —
src/Controller/Admin/DomainController.php:442: The SSL diagnostic connects to a merchant-selected destination without restricting its network address. Domain validation accepts private and loopback dotted IPv4 addresses, allowing domain managers to initiate internal TLS connection attempts on port 443. - Finding 73 —
src/Controller/Admin/DisputeController.php:260: The controller supplies a table name to a database method that requires a complete SQL statement. The resulting audit failure occurs after the dispute update, leaving the resolution committed without its promised separate audit record. - Finding 83 —
modules/gateways/btcpay/BTCPayGateway.php:99: Merchant plugin settings control the complete BTCPay base URL, and the payment adapter connects to it without restricting its destination. A staff account authorized to configure the merchant's integration can thereby send requests from the payment server to loopback or private-network destinations. - Finding 84 —
src/Controller/Admin/AuditIntegrityController.php:43: The GET integrity page permanently signs unsigned audit records before displaying its results. Because GET bypasses CSRF validation, a cross-site navigation can trigger this maintenance write using a superadministrator's session. - Finding 90 —
src/Cache/RedisCache.php:72: Cache writes use the configured prefix literally, but flush interprets it as part of a Redis glob. A custom prefix containing glob characters can make application cache maintenance delete records outside the promised literal namespace. - Finding 107 —
modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:292: The supported Nagad sandbox uses HTTP, and the adapter trusts the final response's callBackUrl as a browser destination without authenticating that response. An attacker intercepting the server-to-sandbox connection can replace the payment handoff with an attacker-controlled destination.
Triage and remediation
- [ ] Validate each finding and its prerequisites against the current code and deployment configuration; identify duplicates or false positives.
- [ ] Prioritize confirmed issues by impact and exploitability, and track fixes and regression tests.
- [ ] Reassess affected releases and coordinate fixes and disclosure under the repository security policy.
Scan details: findings 1–20
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 1 — src/Service/Payment/PaymentCompletionListener.php:77
Low · other · reachability: external · exploitability: difficult
Finding ID: fbaa7165-3826-483b-9ad0-74df2f8a203f
Payment-link capacity is checked before checkout creation but is not reserved across independent transactions. Successful payments increment the shared counter without enforcing max_uses, so transactions initiated while capacity remains can all complete beyond the merchant's configured limit.
Evidence
- Source/control: A customer opens a capped public payment link in separate sessions and initiates multiple genuine payments before any completes.
- Sink/decision: The completion listener increments use_count and only afterward deactivates an exhausted link, without rejecting excess completions.
- Missing mitigation: No atomic reservation ties an available payment-link use to a transaction before the external payment begins. Completion consumes no reservation and performs no guarded capacity update.
Suggested remediation: Atomically reserve an available use before initiating payment and associate the reservation with that transaction. Define expiration and release rules for abandoned attempts, and require completion to consume its reservation exactly once.
Reported call path
- config/routes/web.php:89 — GET /pay/{slug} in separate customer sessions.
- src/Controller/Checkout/PaymentLinkCheckoutController.php:96 — show() checks the current completion count.
- src/Controller/Checkout/PaymentLinkCheckoutController.php:175 — show() creates independent pending transactions.
- src/Controller/Checkout/CheckoutController.php:619 — Each pay() request claims its own transaction.
- src/Controller/Checkout/CheckoutController.php:636 — Both gateway payment sessions can start before either completes.
- src/Controller/Webhook/UnifiedWebhookController.php:151 — Each valid payment webhook calls handleCallback().
- src/Service/Payment/GatewayApiService.php:244 — handleCallback() completes each eligible transaction.
- src/Service/Payment/TransactionService.php:98 — complete() commits the transaction's completed state.
- src/Service/Payment/TransactionService.php:108 — complete() dispatches payment.transaction.completed.
- src/Event/EventManager.php:252 — doAction() invokes the registered completion listener.
- src/Service/Payment/PaymentCompletionListener.php:77 — onTransactionCompleted() increments the shared link counter after success [sink].
Finding 2 — src/Service/Brand/BrandContext.php:218
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: f5499869-800c-44b8-899c-569cb48506a4
Global merchant scope is authorized when selected but later accepted from persistent session state without checking current cross-merchant permission. Revoking brands.access_all therefore leaves an existing session able to perform global operations using retained resource permissions.
Evidence
- Source/control: A non-superadmin user’s existing global-view session after an administrator removes brands.access_all from their role.
- Sink/decision: isGlobalView accepts the stale global mode, causing an unscoped transaction export or allowing platform gateway-template creation.
- Missing mitigation: Global data scope is treated as durable authorization rather than a selection requiring current permission. Revoking cross-merchant access neither resets that selection nor prevents its subsequent use.
Suggested remediation: Check current superadmin status or brands.access_all before honoring global scope on each administrative request. When authorization is absent, reset the selection to the user’s authorized home merchant or reject the operation.
Reported call path
- src/Controller/Admin/BrandController.php:330 — enter global view while authorized
- src/Service/Brand/BrandContext.php:230 — persist brand_view_mode
- src/Controller/Admin/RolesController.php:222 — a separate administrator request removes the global permission
- config/routes/web.php:277 — existing session requests GET /admin/reports/export
- src/Middleware/PermissionMiddleware.php:129 — load current permissions, including retained system.reports
- src/Controller/Admin/DashboardController.php:609 — determine scope through isGlobalView
- src/Service/Brand/BrandContext.php:218 — accept stale global mode
- src/Controller/Admin/DashboardController.php:622 — request export with null merchant scope
- src/Repository/TransactionRepository.php:838 — read transactions across merchants [sink]
Finding 3 — templates/admin/developer/index.twig:325
Medium · xss · reachability: external · exploitability: difficult · CWE-79
Finding ID: f4cc3418-79eb-4d9e-84ff-8b07fbda5377
The Developer Hub embeds raw JSON containing a stored webhook secret inside a single-quoted HTML attribute. JSON encoding does not escape apostrophes for HTML, allowing a merchant's secret to create attacker-controlled markup and execute an event handler when CSP is report-only.
The webhook edit button renders stored records as raw JSON inside a single-quoted HTML attribute. A supplied secret can terminate that attribute and create markup; AJAX refresh then converts injected script nodes into executable HTML scripts and grants them the current page's trusted CSP nonce.
Evidence
- Source/control: The secret field submitted by a merchant operator to POST /admin/developer/webhooks/store.
- Sink/decision: The raw wh|json_encode output in the onclick attribute calling window.prepareWebhookForm().
- Missing mitigation: The template does not encode JSON for its containing HTML attribute. Consequently, stored data can terminate the attribute and introduce executable markup when CSP does not enforce the script restriction.
Suggested remediation: Remove the inline handler and store HTML-escaped JSON in a data attribute that trusted JavaScript parses. Keep CSP enforcing and use paginateScoped() to restrict webhook listing to the intended tenant.
Remove raw JSON from the event-handler attribute. Put escaped JSON in a data attribute and read it from an external event listener. Stop recreating arbitrary scripts from content panels; execute only explicitly identified application scripts.
Reported call path
- config/routes/web.php:270 — POST /admin/developer/webhooks/store
- src/Controller/Admin/WebhookController.php:55 — reads the attacker-selected secret
- src/Controller/Admin/WebhookController.php:84 — persists the merchant's webhook through createScoped
- src/Repository/TenantScope.php:116 — invokes the parameterized repository insert
- config/routes/web.php:264 — a victim later requests GET /admin/developer
- src/Controller/Admin/DeveloperController.php:117 — retrieves the stored webhook
- src/Controller/Admin/DeveloperController.php:149 — forwards the record to rendering
- src/Controller/Admin/AdminPageTrait.php:183 — renders the administrative HTML response
- templates/admin/developer/index.twig:325 — raw JSON crosses into HTML attribute syntax
- src/Middleware/SecurityHeadersMiddleware.php:86 — APP_DEBUG=true selects report-only CSP, permitting the injected handler
- config/routes/web.php:270 — webhook store route
- src/Controller/Admin/WebhookController.php:56 — accept secret
- src/Controller/Admin/WebhookController.php:84 — persist webhook
- src/Controller/Admin/DeveloperController.php:117 — load stored webhooks
- templates/admin/developer/index.twig:325 — render unsafe attribute
- public/assets/js/admin.js:623 — refresh administrative content
- public/assets/js/admin.js:471 — insert fetched markup
- public/assets/js/admin.js:452 — grant injected script the live nonce
- public/assets/js/admin.js:458 — replace node and execute script
Finding 4 — src/Service/System/TranslationService.php:297
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: e7d348a3-8f90-4041-9e84-93afb6b40c8c
The language upload endpoint checks settings.manage but never verifies that the caller may administer platform-wide state. A staff member restricted to one brand can replace a shared translation catalog, changing text consumed by other brands and administrators.
Evidence
- Source/control: Language code, name, and uploaded translation JSON submitted by brand-scoped staff to /admin/settings/language/upload.
- Sink/decision: The unscoped UPDATE of op_languages, followed by replacement of storage/languages/{code}.json.
- Missing mitigation: The dedicated language handlers do not verify global administrative authority before changing shared language state.
Suggested remediation: Require server-side global administrative authority before every shared language mutation. Centralize this guard and apply it to upload, creation, translation editing, deletion and default-language changes; checking only the selected view is insufficient.
Reported call path
- config/routes/web.php:218 — POST /admin/settings/language/upload
- src/Middleware/PermissionMiddleware.php:60 — global-only prefix list omits language settings
- src/Middleware/PermissionMiddleware.php:258 — require settings.manage without global scope
- src/Controller/Admin/SettingsController.php:1623 — uploadLanguage() invokes the shared translation service
- src/Service/System/TranslationService.php:297 — replace the shared language row [sink]
- src/Service/System/TranslationService.php:321 — overwrite the shared catalog file [sink]
Finding 5 — src/View/SettingsRenderer.php:123
Medium · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-200
Finding ID: cfb142ec-e870-4f51-b0c5-7828ff0f6b50
The tenant settings handler passes inherited platform credentials to the form renderer. PayPal classifies its private OAuth client secret as a text field, causing the renderer to include that secret in the tenant response.
Evidence
- Source/control: An authenticated tenant staff request to /admin/plugins/paypal-checkout/settings.
- Sink/decision: SettingsRenderer::input() writes the inherited paypal_secret into the HTML value attribute.
- Missing mitigation: The response does not distinguish inherited platform secrets from tenant-owned settings. The PayPal secret also bypasses the renderer's existing non-echoing password control because its field type is text.
Suggested remediation: Declare paypal_secret as a password field so stored values never appear in the response. Remove inherited private credential values from tenant-facing form data and expose only whether they are configured.
Reported call path
- config/routes/web.php:307 — GET /admin/plugins/{slug}/settings
- src/Controller/Admin/PluginController.php:522 — readGatewayCredentials()
- src/Repository/GatewayConfigRepository.php:39 — global credential fallback
- src/Controller/Admin/PluginController.php:778 — decrypts inherited payload
- src/Controller/Admin/PluginController.php:533 — SettingsRenderer::render()
- modules/gateways/paypal-checkout/PaypalCheckoutGateway.php:59 — private secret classified as text
- src/View/SettingsRenderer.php:123 — emits secret value [sink]
- src/Controller/Admin/PluginController.php:543 — returns settings page
Finding 6 — src/Service/System/FilesystemService.php:136
Medium · xss · reachability: external · exploitability: difficult · CWE-79
Finding ID: c30da0ed-8fc9-492c-914a-708f8f2205e4
The upload validator checks raw SVG text but allows nested HTML documents whose executable markup is encoded in XML attributes. Public upload callers then publish the original bytes on the application origin, allowing script execution when a victim opens the SVG as a document.
Evidence
- Source/control: SVG bytes supplied by an authenticated user authorized to upload dispute evidence, branding assets, or staff avatars.
- Sink/decision: move_uploaded_file persists the accepted SVG unchanged in a publicly served directory.
- Missing mitigation: SVG validation does not restrict the parsed document structure or remove nested HTML browsing contexts. Public responses provide no isolation boundary that prevents accepted active content from executing with application-origin authority.
Assumptions Based on these assumptions: A3 (Deployment configuration): In the absence of runtime deployment evidence, uploaded SVG files are served using the repository's static-file configuration, without an additional upload-specific sandbox, attachment policy, or separate origin. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Reject SVG for these uploads or rasterize it before publication. If SVG must remain supported, use a maintained structural allowlist sanitizer that removes nested HTML and browsing contexts, and serve untrusted documents from an isolated origin or as sandboxed attachments.
Reported call path
- config/routes/web.php:129 — POST /admin/disputes/{id}/resolve
- src/Controller/Admin/DisputeController.php:235 — selects the public assets directory
- src/Controller/Admin/DisputeController.php:236 — calls storeUpload with attacker bytes
- src/Service/System/FilesystemService.php:62 — calls moveValidatedUpload
- src/Service/System/FilesystemService.php:121 — raw-text SVG screening accepts the encoded construct
- src/Service/System/FilesystemService.php:136 — stores the active SVG [sink]
- templates/admin/disputes/show.twig:60 — victim opens the public evidence URL
- public/.htaccess:9 — existing document is served directly for browser parsing
Finding 7 — src/Service/System/Logger.php:199
Low · other · reachability: external · exploitability: trivial · CWE-117
Finding ID: b6bfbd31-4268-4374-bac0-02278a795365
CSRF rejection messages include the submitted token, and the file logger writes message line breaks unchanged. An unauthenticated request can therefore add lines that resemble independently generated application records, compromising log integrity.
Evidence
- Source/control: The _csrf_token form field submitted to the configured browser login POST route.
- Sink/decision: file_put_contents appends a formatted log entry containing attacker-controlled record separators.
- Missing mitigation: The logger does not encode untrusted message text to prevent it from creating additional physical records.
Suggested remediation: Remove submitted and session token values from CSRF rejection messages. Encode complete log records as JSON, or escape message record separators before appending them.
Reported call path
- config/routes/web.php:58 — POST login
- src/Middleware/CsrfMiddleware.php:92 — reject invalid token
- src/Middleware/CsrfMiddleware.php:130 — concatenate attacker-controlled token
- src/Middleware/CsrfMiddleware.php:136 — log warning
- src/Service/System/Logger.php:196 — redact without removing record separators
- src/Service/System/Logger.php:209 — append forged record structure [sink]
Finding 8 — src/Service/Payment/GatewayApiService.php:81
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: b00ea383-06e2-4899-ad77-65f2a9e0f077
Payment initiation checks global gateway availability without checking whether the target merchant has authorized and configured that gateway. An unconfigured wallet consequently receives empty credentials, defaults to simulated mode, and can complete a real checkout using a fabricated payment callback.
Evidence
- Source/control: Browser-controlled gateway and gateway_mode fields on the public intent pay route, followed by paymentID and amount query fields on its status route.
- Sink/decision: Global-only gateway authorization permits wallet mock verification to reach transaction completion and ledger posting.
- Missing mitigation: The shared payment service does not enforce merchant gateway authorization, and missing wallet configuration permits simulated verification to affect real transaction and ledger state.
Suggested remediation: Require an applicable active merchant gateway configuration before initiation and verification. Reject missing wallet configuration, and isolate simulated payments from production completion and accounting.
Reported call path
- config/routes/web.php:79 — public intent pay route
- src/Controller/Checkout/PaymentIntentCheckoutController.php:545 — read selected gateway
- src/Controller/Checkout/PaymentIntentCheckoutController.php:774 — initiate selected gateway
- src/Service/Payment/GatewayApiService.php:81 — check global availability only
- src/Gateway/GatewayBridge.php:79 — obtain empty credentials for unconfigured merchant
- modules/gateways/apple-pay/ApplePayGateway.php:97 — simulate initiation
- src/Controller/Checkout/PaymentIntentCheckoutController.php:916 — process status callback
- modules/gateways/apple-pay/ApplePayGateway.php:180 — accept mock payment
- src/Service/Payment/GatewayApiService.php:244 — complete transaction
Finding 9 — src/Service/Communication/CommunicationService.php:242
Medium · injection · reachability: external · exploitability: difficult · CWE-93
Finding ID: adf2429a-dd7a-4be1-9feb-e0e0cb0151be
The fallback mail transport concatenates a configurable sender name into raw mail headers without rejecting line breaks. A brand settings administrator can add recipient headers to another staff member’s password-reset email and obtain the bearer token needed to change that account’s password.
Evidence
- Source/control: mail_from_name submitted to POST /admin/settings/save with _tab=notifications and persisted as a brand-specific general setting.
- Sink/decision: The constructed From value is concatenated into the additional headers passed to PHP mail().
- Missing mitigation: Sender components are not checked for CR or LF before becoming mail-header syntax. Display-name input can therefore create additional headers and recipients.
Suggested remediation: Reject CR and LF in sender names and addresses at the mail transport boundary, and validate saved sender settings as well. Prefer a structured mail API that safely constructs address headers.
Reported call path
- src/Controller/Admin/SettingsController.php:1216 — persists a sender name containing CRLF
- src/Controller/Admin/AuthController.php:296 — forgotSubmit() requests a reset for the victim
- src/Service/Auth/PasswordResetService.php:85 — requestReset() sends the bearer link
- src/Service/Communication/CommunicationService.php:115 — sendEmail() constructs the injected From value
- src/Service/Communication/CommunicationService.php:122 — selects fallbackMail()
- src/Service/Communication/CommunicationService.php:245 — mail() receives the injected additional headers [sink]
Finding 10 — src/Service/System/HttpClient.php:378
Low · ssrf · reachability: external · exploitability: difficult · CWE-918
Finding ID: a8b5ddc0-7bbf-4d8a-bc0f-cc134ca5ff7b
The second DNS lookup can return no addresses without stopping the request. This leaves cURL free to resolve the hostname again and connect to an address that never passed the public-address check.
Evidence
- Source/control: DNS responses for an attacker-operated custom exchange-rate feed hostname or redirect destination.
- Sink/decision: curl_exec executes a hostname request without a validated address pin.
- Missing mitigation: The request does not require a successfully resolved and validated destination before executing a hostname connection.
Assumptions Based on these assumptions: A4 (Third-party behavior): cURL follows its documented behavior: without CURLOPT_RESOLVE it resolves the hostname normally, and certificate verification occurs after establishing the underlying connection. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Reject empty resolution results and require a validated address pin before every hostname request. Use the existing fail-closed resolver consistently for initial requests and redirects.
Reported call path
- src/Service/Payment/CurrencyService.php:289 — starts forced rate synchronization
- src/Cron/CurrencyUpdateJob.php:83 — requests the configured feed
- src/Service/System/HttpClient.php:83 — dispatches GET to request
- src/Service/System/HttpClient.php:205 — initially validates the hostname
- src/Service/System/HttpClient.php:307 — empty second lookup reaches fallback
- src/Service/System/HttpClient.php:348 — null pin skips CURLOPT_RESOLVE
- src/Service/System/HttpClient.php:378 — cURL resolves and connects without a validated pin [sink]
Finding 11 — src/Service/Brand/BrandContext.php:74
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: a4198589-1a75-4613-8779-11e2ad3a8817
Public checkout persists its merchant into the administrative tenant-selection session field. Administrative resolution then accepts that merchant after checking only its existence, allowing staff permissions for one merchant to authorize operations against another merchant.
Evidence
- Source/control: An authenticated merchant staff member opens another merchant's public payment-link or invoice URL on the administrative hostname.
- Sink/decision: BrandContext accepts the checkout-selected merchant as administrative scope, which controls private-data queries, credential and device management, refund creation, role changes, and plugin activation overrides.
- Missing mitigation: Checkout rendering context shares persistent state with administrative authority, and administrative merchant selection is not checked against the authenticated user's authorized merchants before use.
Suggested remediation: Keep public checkout branding local to its request instead of writing administrative session selection. Before accepting an administrative merchant context, verify that the authenticated user is authorized for that merchant and reject unauthorized selections.
Reported call path
- config/routes/web.php:89 — GET /pay/{slug}, with session middleware
- src/Controller/Checkout/PaymentLinkCheckoutController.php:74 — show resolves the public link's merchant
- src/Service/Brand/BrandContext.php:199 — setActiveBrandId persists that merchant
- src/Middleware/PermissionMiddleware.php:56 — subsequent admin request resolves the modified context
- src/Service/Brand/BrandContext.php:74 — session merchant becomes administrative authority
- src/Controller/Admin/InvoiceController.php:89 — invoice-read branch calls listForMerchant
- src/Service/Payment/InvoiceService.php:76 — invoice-read database sink
- src/Controller/Admin/ApiKeyController.php:100 — key-creation branch calls generate with selected merchant
- src/Service/Customer/ApiKeyService.php:45 — key-creation database sink
- src/Controller/Admin/ApiKeyController.php:127 — key-status branches call revoke, lock, or unlock
- src/Service/Customer/ApiKeyService.php:84 — tenant-scoped status update; sibling sinks at lines 97 and 109
- src/Controller/Admin/DeviceController.php:167 — pairing branch generates an OTP for the selected merchant
- src/Service/Device/DevicePairingService.php:109 — pairing-authority insertion sink
- src/Controller/Admin/DeviceController.php:246 — revocation branch passes the selected merchant
- src/Service/Device/DevicePairingService.php:466 — device-revocation sink
Finding 12 — src/Update/UpdateService.php:257
Low · other · reachability: external · exploitability: moderate · CWE-117
Finding ID: 8ebd2454-3d36-43e1-b46a-fb582a74c0bb
The logger appends messages without escaping embedded carriage returns or newlines. The update endpoint logs its submitted version before checking release membership, allowing an update operator to insert misleading physical lines into the application log.
Evidence
- Source/control: The version field submitted to POST /admin/system-update/apply.
- Sink/decision: Logger::log() appends a formatted record containing unescaped message delimiters.
- Missing mitigation: The final log formatter does not encode record separators in message text. Version input also lacks a format check before it is recorded and logged.
Suggested remediation: Escape carriage returns and newlines in the final log formatter, or serialize each complete record as JSON. Validate the version format before recording an update attempt.
Reported call path
- config/routes/web.php:323 — POST /admin/system-update/apply
- src/Controller/Admin/SystemUpdateController.php:227 — install() calls execute(version)
- src/Update/UpdateService.php:257 — logs the unvalidated version
- src/Update/UpdateService.php:837 — forwards the message to Logger::info()
- src/Service/System/Logger.php:162 — info() calls log()
- src/Service/System/Logger.php:196 — sanitizer preserves line separators
- src/Service/System/Logger.php:209 — appends the injected log lines [sink]
Finding 13 — templates/admin/my-account-2fa.twig:44
High · sensitive_data_exposure · reachability: external · exploitability: trivial · CWE-201
Finding ID: 8e5ba663-0863-47a1-a1d0-88a4ddf42ffe
The enrollment page sends the account's TOTP secret and email to an external QR service in an image URL. That service receives the persistent secret needed to generate future second-factor codes.
Evidence
- Source/control: The stored or newly generated TOTP secret and authenticated account email assembled into qr_uri.
- Sink/decision: The HTTPS image request to api.qrserver.com, with the enrollment URI in its data query parameter.
- Missing mitigation: QR generation sends a private authentication credential outside the application and the user's authenticator. URL encoding and HTTPS do not conceal the credential from the destination service.
Suggested remediation: Generate the QR image within the application or locally in the browser. Keep the enrollment URI out of third-party requests.
Reported call path
- config/routes/web.php:293 — GET factor enrollment
- src/Controller/Admin/TwoFactorSetupController.php:70 — reads persistent factor secret
- src/Controller/Admin/TwoFactorSetupController.php:84 — constructs enrollment URI
- src/Controller/Admin/TwoFactorSetupController.php:91 — passes qr_uri to rendering
- templates/admin/my-account-2fa.twig:44 — external disclosure sink
Finding 14 — src/Service/Device/DevicePairingService.php:229
Low · broken_auth · reachability: external · exploitability: difficult · CWE-613
Finding ID: 8a38e2ba-f97f-46a8-a0ce-6622e7901470
Replacement pairing revokes only one fingerprint match, and that lookup can return an already revoked historical record. A newer matching device can therefore retain access after a replacement pairing intended to invalidate it.
Evidence
- Source/control: A retained credential for a previously paired device whose merchant and fingerprint are subsequently paired again.
- Sink/decision: The single-record revocation leaves another matching active device authorized.
- Missing mitigation: The replacement operation does not invalidate every active device associated with the merchant and fingerprint.
Suggested remediation: Revoke all matching active devices and create the replacement within one transaction. Test three successive pairings and verify that both earlier devices lose access.
Reported call path
- src/Controller/Api/Mobile/DeviceController.php:81 — pair invokes pairDevice with the authorized replacement OTP
- src/Service/Device/DevicePairingService.php:229 — pairDevice requests one fingerprint match
- src/Repository/PairedDeviceRepository.php:96 — lookup can select an already-revoked historical row
- src/Service/Device/DevicePairingService.php:235 — only the selected row is revoked
- src/Service/Device/DevicePairingService.php:266 — a replacement active record is created
- src/Middleware/JwtAuthMiddleware.php:113 — the attacker's surviving active record still passes authorization
- src/Controller/Api/Mobile/DashboardController.php:68 — merchant transaction data remains accessible
Finding 15 — src/Service/Payment/PaymentCompletionListener.php:67
Medium · other · reachability: external · exploitability: difficult · CWE-841
Finding ID: 7ef9b26e-aaa6-46f9-a2fb-86f5a444060a
Payment completion marks an invoice paid using its identifier without checking whether the completed transaction satisfies the invoice's current amount, currency, and payable status. Merchant edits leave previously issued checkout transactions valid, allowing payment under obsolete terms to settle the revised invoice.
Evidence
- Source/control: A payer retains a transaction issued through the public invoice checkout before a legitimate merchant revision.
- Sink/decision: The completion listener updates the associated invoice to paid without reconciling its current payment terms.
- Missing mitigation: Payment-relevant invoice changes do not invalidate existing attempts, and the paid transition does not atomically verify the current invoice terms.
Suggested remediation: Invalidate outstanding payment attempts when invoice payment terms change, or bind each attempt to an invoice revision. Before marking the invoice paid, lock it and verify the revision, amount, currency, and payable status; handle stale successful payments through an explicit reconciliation process.
Reported call path
- src/Controller/Checkout/CheckoutController.php:838 — processes the retained checkout’s genuine gateway callback
- src/Service/Payment/GatewayApiService.php:218 — selects expected amount from the retained transaction
- src/Service/Payment/GatewayApiService.php:244 — completes that transaction
- src/Service/Payment/TransactionService.php:108 — emits payment.transaction.completed
- config/services.php:698 — registered completion listener
- src/Service/Payment/PaymentCompletionListener.php:67 — marks the materially changed invoice paid [sink]
Finding 16 — tests/Unit/PdfServicePathTraversalTest.php:18
Low · path_traversal · reachability: external · exploitability: difficult · CWE-377
Finding ID: 7996c82f-3a88-4c9a-ad80-ea606ca4874c
The test chooses a predictable temporary directory without creating it exclusively, and PdfService accepts a directory already present there. A different local user can prepare that directory with a destination symlink, causing the test process to overwrite a file the attacker cannot normally modify.
Evidence
- Source/control: A separate local user's precreated temporary directory containing an invoice_42.html symlink.
- Sink/decision: file_put_contents follows the destination symlink and writes printable HTML using the test runner's filesystem authority.
- Missing mitigation: The test does not exclusively create and verify a private temporary directory before passing it to PdfService. Consequently, filename filtering cannot ensure that the write stays within storage owned by the test process.
Suggested remediation: Create the test directory with a cryptographically random name and restrictive permissions, and require directory creation to succeed exclusively. Abort on an existing path instead of passing it to PdfService.
Reported call path
- tests/Unit/PdfServicePathTraversalTest.php:18 — setUp() selects a predictable temporary path
- src/Service/System/PdfService.php:31 — constructor accepts the attacker-prepared directory
- tests/Unit/PdfServicePathTraversalTest.php:37 — test invokes generateInvoice()
- src/Service/System/PdfService.php:101 — generateInvoice() invokes generateFromHtml()
- src/Service/System/PdfService.php:50 — file_put_contents follows the prepared destination symlink
Finding 17 — src/Service/Domain/DomainUrlService.php:74
Low · open_redirect · reachability: external · exploitability: difficult · CWE-601
Finding ID: 78b683db-82d0-401b-bfc4-68e97197f324
Checkout submission can process one merchant's payment on another merchant's registered domain. When URL configuration falls back to the request host, that unrelated domain becomes the gateway return destination, allowing the operator of that domain to redirect the payment journey away from the intended merchant.
Evidence
- Source/control: The request Host accepted for an active, verified checkout domain belonging to a different merchant.
- Sink/decision: Selection of that request origin for gateway callback URLs, subsequently submitted as Stripe success_url and cancel_url.
- Missing mitigation: Payment submission does not enforce the relationship between the accepted domain and payment merchant before using the domain as a trusted return origin.
Suggested remediation: Apply the domain-to-merchant comparison to every checkout submission before gateway initiation. Use a trusted configured fallback origin, or accept a request-derived origin only after proving it belongs to the payment merchant.
Reported call path
- config/routes/web.php:79 — POST /checkout/intent/{token}/pay
- src/Middleware/DomainMiddleware.php:190 — records the incoming domain's merchant
- src/Controller/Checkout/PaymentIntentCheckoutController.php:512 — pay selects the intent's merchant without comparing it to the domain merchant
- src/Controller/Checkout/PaymentIntentCheckoutController.php:726 — calls buildCallbackUrl
- src/Service/Domain/DomainUrlService.php:104 — calls resolveBaseUrl
- src/Service/Domain/DomainUrlService.php:74 — selects the unrelated request origin
- src/Controller/Checkout/PaymentIntentCheckoutController.php:774 — passes the resulting callback to initiatePayment
- src/Service/Payment/GatewayApiService.php:120 — calls GatewayBridge.initiate
- src/Gateway/GatewayBridge.php:101 — calls the selected adapter's initiate method
- modules/gateways/stripe/StripeGateway.php:149 — submits the attacker origin as success_url [sink]
- src/Controller/Checkout/CheckoutController.php:634 — alternate legacy path calls buildLegacyCallbackUrl, then initiatePayment at line 636 and the same bridge/adapter chain
Finding 18 — src/Service/Payment/GatewayApiService.php:227
Medium · other · reachability: external · exploitability: difficult
Finding ID: 7146256b-e180-4e9f-a210-d75c2e9c403a
Settlement compares numeric amounts without checking their denominations. A gateway can charge the invoice's unchanged numeral in a different currency, allowing a smaller economic payment to complete the full invoice and credit its original currency.
Evidence
- Source/control: A customer's selection of an offered Bancontact, Billplz, or Binance gateway for an invoice whose currency differs from the gateway's charge currency.
- Sink/decision: The currency-blind amount comparison at lines 230–231 authorizes transaction completion at line 244 and ledger posting in the stored transaction currency.
- Missing mitigation: Charge amount and currency are not consistently validated or converted before initiation, and settlement does not require the authoritative provider currency to match the persisted charge terms.
Suggested remediation: Validate or convert currencies consistently on every initiation path and persist the exact charge amount and currency. Require the verified provider amount and currency to match those terms before completing the transaction; declare each adapter's actual supported denominations.
Reported call path
- config/routes/web.php:86 — GET /invoice/{token}
- src/Controller/Checkout/InvoiceCheckoutController.php:157 — create a transaction preserving invoice currency
- src/Controller/Checkout/CheckoutController.php:636 — initiate payment without currency conversion
- src/Service/Payment/GatewayApiService.php:120 — call the gateway bridge
- src/Gateway/GatewayBridge.php:101 — call the adapter
- modules/gateways/billplz/BillplzGateway.php:85 — convert the unchanged numeral into MYR minor units
- src/Controller/Checkout/CheckoutController.php:838 — process the provider callback
- modules/gateways/billplz/BillplzGateway.php:205 — return the paid numeral without currency
- src/Service/Payment/GatewayApiService.php:231 — compare numerals across different denominations
- src/Service/Payment/GatewayApiService.php:244 — complete the original invoice transaction
- src/Service/Payment/PaymentCompletionListener.php:67 — mark the original invoice paid
Finding 19 — src/Service/Notification/MobileNotificationService.php:249
Low · denial_of_service · reachability: external · exploitability: difficult · CWE-407
Finding ID: 7119b5ef-1a06-4f55-9af5-71a44d84b3c4
The default notification queue reprocesses its entire retained JSON history whenever a notification is added. An authenticated device can grow that shared history using valid SMS submissions, causing increasingly expensive work and lock contention for other devices and merchants.
The fallback queue reads, decodes, and rewrites its entire retained JSON array for every insertion under one exclusive lock. A paired device can grow this shared history with accepted SMS messages, increasing the server work required by later small messages.
Evidence
- Source/control: Authenticated SMS submissions encrypted with the submitting paired device's issued AES key, using a recognized sender and parseable amount.
- Sink/decision: Serialization and rewriting of the entire shared notification queue while holding its exclusive lock.
- Missing mitigation: The shared fallback queue has neither bounded retention nor storage that can append without repeatedly processing all previous entries.
Assumptions Based on these assumptions: A3 (Deployment configuration): The deployment uses the shipped container wiring and default API rate configuration, without an additional repository binding or deployment-supplied retention mechanism for op_notifications.json. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Wire payment notifications to the existing database queue or another bounded queue with efficient inserts. If the file fallback remains, enforce a size limit and retention before reading history, and prevent one merchant's backlog from blocking others.
Use the database notification repository or a bounded queue that supports insertion without rewriting history. Enforce retention and capacity limits, and avoid serializing all devices behind one file lock.
Reported call path
- config/routes/api.php:47 — POST /api/mobile/v1/sms
- src/Middleware/JwtAuthMiddleware.php:134 — authenticated active device reaches the handler
- src/Controller/Api/Mobile/SmsController.php:158 — receive calls processBatch
- src/Service/Sms/SmsParserService.php:158 — processBatch calls processOne for each message
- src/Service/Sms/SmsParserService.php:204 — processOne calls notifyDevice
- src/Service/Sms/SmsParserService.php:396 — notifyDevice calls queuePaymentNotification
- src/Service/Notification/MobileNotificationService.php:119 — default storage calls queueNotification
- src/Service/Notification/MobileNotificationService.php:236 — reads the complete retained queue
- src/Service/Notification/MobileNotificationService.php:249 — serializes the complete enlarged queue
- src/Service/Notification/MobileNotificationService.php:251 — rewrites the complete shared file [sink]
- config/routes/api.php:47 — authenticated POST /api/mobile/v1/sms
- src/Controller/Api/Mobile/SmsController.php:158 — process submitted messages
- src/Service/Sms/SmsParserService.php:158 — processOne for each message
- src/Service/Sms/SmsParserService.php:204 — notifyDevice after parsing
- src/Service/Sms/SmsParserService.php:396 — queuePaymentNotification
- src/Service/Notification/MobileNotificationService.php:119 — choose default fallback
- src/Service/Notification/MobileNotificationService.php:236 — read the full retained file
- src/Service/Notification/MobileNotificationService.php:249 — serialize the full queue under the shared lock
Finding 20 — src/Service/System/TranslationService.php:556
Low · denial_of_service · reachability: external · exploitability: difficult · CWE-400
Finding ID: 6f7eb3c3-423a-4962-b3df-a60190fc6c16
Flattening repeats a parent key in every descendant key without checking the resulting size. A 162,736-byte nested catalog can require more than 536 MB for flattened key text alone, exhausting a request's memory budget or imposing substantial memory pressure on shared PHP workers.
Evidence
- Source/control: Nested JSON keys in the language_file upload accepted by POST /admin/settings/language/upload.
- Sink/decision: Construction and retention of expanded keys in flattenArray, before JSON encoding or persistence.
- Missing mitigation: The importer does not limit individual key lengths, flattened key lengths or cumulative expanded bytes before allocating and retaining them.
Assumptions Based on these assumptions: A3 (Deployment configuration): The application runs with the shipped controls and no additional deployment-specific rejection of an approximately 163 KB language upload.; A4 (Third-party behavior): PHP uses its documented default upload limits of 2 MB per file and 8 MB per POST, allowing this input. Its ordinary string and array behavior allocates the separately constructed flattened keys. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Check a maximum flattened-key length and cumulative output budget before concatenating each key, and reject catalogs that exceed either limit. Also bound entry count and depth so accepted catalogs have predictable processing costs.
Reported call path
- config/routes/web.php:218 — POST /admin/settings/language/upload
- src/Controller/Admin/SettingsController.php:1611 — decode uploaded JSON
- src/Controller/Admin/SettingsController.php:1623 — TranslationService.uploadLanguage()
- src/Service/System/TranslationService.php:292 — flattenArray(uploaded catalog)
- src/Service/System/TranslationService.php:558 — recurse with the complete parent prefix
- src/Service/System/TranslationService.php:556 — duplicate the prefix into each leaf key [sink]
- src/Service/System/TranslationService.php:560 — retain expanded keys in the result [sink]
Scan details: findings 21–40
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 21 — src/Service/Auth/PasswordResetService.php:144
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-362
Finding ID: 6b0f93bd-ade2-4f3f-aae9-e63bab6711a8
Password replacement occurs after an unlocked token lookup and before exclusive token consumption. Concurrent requests can both pass validation, allowing one request to overwrite the password after another request successfully completes and consumes the recovery link.
Evidence
- Source/control: The same unexpired reset token submitted concurrently with different passwords through separate sessions.
- Sink/decision: MerchantUserRepository::updatePassword changes the credential without requiring this request to have exclusively claimed the token.
- Missing mitigation: The single-use token is not exclusively claimed before changing the password, and token consumption and credential replacement do not share an atomic transaction.
Suggested remediation: Claim the unused, unexpired token and replace the password within one database transaction. Lock the token or check the affected-row result of an atomic claim, and reject a losing request before it changes credentials.
Reported call path
- config/routes/web.php:65 — POST /reset-password
- src/Controller/Admin/AuthController.php:343 — invoke resetPassword
- src/Service/Auth/PasswordResetService.php:133 — find the unused token without claiming it
- src/Repository/PasswordResetRepository.php:53 — execute the unlocked lookup
- src/Service/Auth/PasswordResetService.php:144 — hash and replace the password
- src/Repository/MerchantUserRepository.php:153 — write the credential
- src/Service/Auth/PasswordResetService.php:145 — consume the token after the protected write
Finding 22 — src/Service/Brand/BrandContext.php:203
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: 5a382e0d-c985-4488-9857-4e1933c55ccf
Public checkout writes its merchant into the session field that selects the administrative tenant. Administrative handlers subsequently trust that selection without checking the authenticated user’s authority over the merchant, allowing cross-merchant financial-data access and changes.
Evidence
- Source/control: An authenticated staff member supplies another merchant’s invoice token, active payment-link slug, or active transaction checkout reference on the application’s master host.
- Sink/decision: The shared active_brand_id session write changes the merchant used by administrative invoice and transaction operations.
- Missing mitigation: Public presentation context shares persistent state with administrative authority. Administrative requests lack a check that the selected merchant belongs to the authenticated user’s permitted scope.
Suggested remediation: Keep public checkout branding local to the request. Before administrative operations use a selected merchant, validate it against the authenticated user’s current merchant authority.
Reported call path
- config/routes/web.php:86 — public GET /invoice/{token}
- src/Controller/Checkout/InvoiceCheckoutController.php:87 — selects the invoice merchant
- src/Service/Brand/BrandContext.php:203 — overwrites session tenant [sink]
- src/Middleware/PermissionMiddleware.php:54 — subsequent administrative request resolves the substituted tenant
- src/Service/Brand/BrandContext.php:73 — accepts the session merchant
- src/Middleware/PermissionMiddleware.php:140 — authorizes role permission without merchant binding
- src/Controller/Admin/InvoiceController.php:89 — lists invoices using the substituted merchant
- src/Service/Payment/InvoiceService.php:76 — returns victim invoice records [sink]
- src/Controller/Admin/InvoiceController.php:95 — decrypts joined customer names
Finding 23 — src/Service/Auth/PasswordResetService.php:81
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-640
Finding ID: 3bd265ec-d0b2-4170-91ea-5db754e4ed3b
Password recovery selects its token-bearing destination through the merchant-controlled checkout/API domain resolver. Staff authorized to manage domains can therefore redirect another same-merchant user's recovery credential to a server they control, without having authority to change that user's password.
Staff password-reset emails place recovery tokens in URLs selected from customer-facing merchant domains. Someone authorized to operate or configure that domain can consequently receive another staff member's token and change their password, despite lacking authority to manage that account.
Evidence
- Source/control: A same-merchant staff member with domains.manage supplies and selects a domain whose DNS and HTTPS hosting they control.
- Sink/decision: The recovery email contains an attacker-origin URL with the plaintext reset token; that token authorizes password replacement on the platform.
- Missing mitigation: The password-reset destination is not restricted to a trusted authentication origin. Authority to configure checkout domains consequently includes unintended authority over where account-recovery credentials are disclosed.
Suggested remediation: Generate password-reset links from a trusted platform authentication URL. Keep merchant checkout domains and gateway callback overrides out of authentication-link resolution.
Build staff recovery links from a dedicated, trusted administration URL. Do not use merchant custom domains or gateway callback overrides to select the destination for staff authentication secrets.
Reported call path
- config/routes/web.php:184 — domain-management registration route
- src/Controller/Admin/DomainController.php:141 — map attacker-controlled domain
- src/Service/Domain/DomainService.php:166 — activate after TXT proof
- src/Service/Domain/DomainService.php:269 — select primary domain
- src/Controller/Admin/AuthController.php:296 — request recovery for the target account
- src/Service/Auth/PasswordResetService.php:81 — resolve recovery origin
- src/Service/Domain/DomainUrlService.php:57 — select merchant custom domain
- src/Service/Auth/PasswordResetService.php:82 — embed recovery token in attacker-origin URL
- src/Service/Auth/PasswordResetService.php:85 — send URL to target; opening it reveals the token
- src/Controller/Admin/AuthController.php:343 — submit captured token on platform origin
- src/Service/Auth/PasswordResetService.php:144 — replace target password
- config/routes/web.php:63 — POST /forgot-password
- src/Controller/Admin/AuthController.php:296 — forgotSubmit calls requestReset
- src/Service/Auth/PasswordResetService.php:81 — requestReset resolves the user's merchant origin
- src/Service/Domain/DomainUrlService.php:57 — resolveBaseUrl selects the active custom domain
- src/Service/Domain/DomainUrlService.php:135 — getBrandDomain queries the merchant-scoped repository
- src/Repository/DomainRepository.php:44 — findActiveDomain returns the selected domain
- src/Service/Auth/PasswordResetService.php:82 — the live token is appended to that origin
- src/Service/Auth/PasswordResetService.php:84 — the recovery link is rendered into the email
- src/Service/Auth/PasswordResetService.php:85 — sendEmail delivers the attacker-origin recovery link [sink]
Finding 24 — src/Service/Payment/GatewayApiService.php:99
Medium · other · reachability: external · exploitability: moderate
Finding ID: 2ffa4cfd-136f-4c07-b143-ded971e98877
Existing checkout transactions retain their initial zero fee because initiation discards the calculated fee instead of saving it. Settlement passes that stored zero into accounting, increasing merchant payable by the fee that should have been allocated to platform revenue.
Evidence
- Source/control: Successful gateway payments for checkout transactions allocated without a fee, including payment-link, invoice, and intent checkouts.
- Sink/decision: recordPaymentReceived receives the transaction's unchanged zero fee and credits the full payment amount to MERCHANT_PAYABLE.
- Missing mitigation: The existing transaction's fee and net amount are not updated with the applicable calculated values before settlement uses them.
Suggested remediation: Persist the applicable fee and net amount on the claimed checkout transaction before initiating the provider operation. Settlement should consume those persisted values consistently with the transaction's accounting amount and currency.
Reported call path
- src/Controller/Checkout/PaymentLinkCheckoutController.php:175 — allocate transaction without fee
- src/Controller/Checkout/CheckoutController.php:636 — initiate existing checkout transaction
- src/Service/Payment/GatewayApiService.php:92 — calculate fee
- src/Service/Payment/GatewayApiService.php:100 — discard fee in existing-transaction branch
- src/Service/Payment/GatewayApiService.php:241 — read stored zero fee during verified settlement
- src/Service/Payment/LedgerService.php:163 — credit full merchant payable [sink]
Finding 25 — src/Service/Device/DevicePairingService.php:294
Low · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 169ae2fa-97a9-43c3-877c-b089d11eec93
The refresh endpoint accepts an access JWT as proof of renewal authority because verification does not distinguish token purposes. A holder of an access token and its device fingerprint can obtain a renewable 30-day refresh credential without possessing the legitimate refresh token.
Evidence
- Source/control: The refresh_token request field and X-Device-Fingerprint header, or fingerprint input, accepted by DeviceController::refresh.
- Sink/decision: Issuance of replacement access and refresh credentials from an access JWT.
- Missing mitigation: The renewal service does not require authenticated evidence that the submitted JWT was issued specifically as a refresh token.
Suggested remediation: Add a signed token-purpose claim and require the refresh purpose before issuing replacement credentials. Bind rotation to the currently valid refresh credential or token family so access JWTs cannot enter the renewal lifecycle.
Reported call path
- config/routes/api.php:57 — POST /api/mobile/v1/devices/token-refreshes
- src/Controller/Api/Mobile/DeviceController.php:221 — refresh passes the supplied JWT and fingerprint
- src/Service/Device/DevicePairingService.php:294 — refreshAccessToken accepts the JWT through the common verifier
- src/Service/Auth/JwtService.php:208 — signature and expiry verification without credential-purpose validation
- src/Service/Device/DevicePairingService.php:345 — replacement access and refresh credentials are issued
Finding 26 — src/Update/BackupService.php:239
Medium · injection · reachability: external · exploitability: difficult · CWE-89
Finding ID: 0676c1b7-0f86-4cf0-b276-f6f5eaa46982
The restore splitter checks only the immediately preceding backslash when deciding whether a quote closes a string. A stored invoice number ending in a backslash can desynchronize this parser, causing SQL text in the invoice notes to execute as a separate statement with application database authority.
Evidence
- Source/control: Authenticated POST /admin/invoices/store fields invoice_number and notes, persisted through InvoiceService::create().
- Sink/decision: BackupService::restoreDatabase() passes each incorrectly separated statement to Database::execute().
- Missing mitigation: The restore code does not preserve the string boundaries produced by the exporter. It also continues executing parsed statements after errors, allowing an injected statement to run after a malformed INSERT.
Suggested remediation: Replace the custom splitter with a MySQL-compatible import mechanism. If parsing remains necessary, handle escape parity and supported SQL modes correctly, and stop restoration on statement errors.
Reported call path
- config/routes/web.php:121 — POST /admin/invoices/store
- src/Controller/Admin/InvoiceController.php:219 — store() delegates to create()
- src/Controller/Admin/InvoiceController.php:151 — calls InvoiceService::create() with posted fields
- src/Service/Payment/InvoiceService.php:187 — stores invoice_number and notes using bound parameters
- src/Update/UpdateService.php:302 — a later update calls createFullBackup()
- src/Update/BackupService.php:75 — dumpDatabase() invokes pdoDump() on mysqldump failure at line 179
- src/Update/BackupService.php:208 — quotes stored invoice values and writes database.sql
- src/Update/UpdateService.php:395 — a subsequent failure calls restore()
- src/Update/BackupService.php:120 — restore() calls restoreDatabase()
- src/Update/BackupService.php:235 — splitSqlStatements() misinterprets escaped backslashes at line 266
- src/Update/BackupService.php:239 — executes the separated attacker-authored SQL [sink]
Finding 27 — src/Repository/PairedDeviceRepository.php:79
Medium · broken_auth · reachability: external · exploitability: moderate
Finding ID: fd977ff6-a72d-427a-acb1-31dd4a27f6aa
Global revocation uses a lookup that searches only null-merchant devices after tenant scope is removed. Supported pairing assigns a positive merchant ID, so All-Brands revocation misses the selected device while the controller reports success, leaving its credentials usable.
Evidence
- Source/control: An authorized operator revokes a positive-merchant device from All Brands while its former holder retains device credentials.
- Sink/decision: findByDeviceId returns no matching device, causing revoke to exit before updating status to revoked.
- Missing mitigation: The global revocation lookup does not search all tenants, and its failure is ignored. The requested device can remain authorized despite a success message.
Suggested remediation: Use an all-tenant device identity lookup for globally authorized revocation, then update using the located device's merchant. Report success only after confirming that the intended device is revoked.
Reported call path
- config/routes/web.php:236 — POST /admin/devices/{id}/revoke
- src/Controller/Admin/DeviceController.php:246 — pass All-Brands merchant ID 0
- src/Service/Device/DevicePairingService.php:443 — choose forAllTenants
- src/Repository/PairedDeviceRepository.php:80 — search only null-merchant devices
- src/Service/Device/DevicePairingService.php:449 — return without revoking
- src/Controller/Admin/DeviceController.php:247 — report success despite failure
- src/Middleware/JwtAuthMiddleware.php:114 — later requests still see an active device
Finding 28 — src/Controller/Admin/RolesController.php:222
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: fa2aaca3-1ded-493b-85f3-8988c1fdb71d
The permission-delegation check uses the role stored in the session at login instead of the actor's current database role. After a role reassignment, this can authorize grants of permissions that the actor no longer holds.
Evidence
- Source/control: permissions[] submitted by an authenticated user through a session established before a legitimate role downgrade.
- Sink/decision: RolesController::update calls syncPermissions after comparing requested grants with permissions belonging to the obsolete session role.
- Missing mitigation: The permission-grant ceiling is not derived from the current authenticated database user. Role reassignment leaves the session's authorization selector unchanged.
Suggested remediation: Calculate assignable permissions from the current database-backed actor and use that same identity for route authorization and delegation. Refresh or invalidate authorization-bearing session state when role assignments change.
Reported call path
- src/Security/Authenticator.php:174 — stores the original role ID
- src/Controller/Admin/StaffController.php:299 — legitimate role reassignment
- config/routes/web.php:167 — POST role update
- src/Middleware/PermissionMiddleware.php:129 — loads current permissions
- src/Controller/Admin/RolesController.php:205 — selects obsolete session authority
- src/Controller/Admin/RolesController.php:222 — syncPermissions sink
Finding 29 — src/Repository/TransactionRepository.php:418
Medium · idor · reachability: external · exploitability: moderate · CWE-639
Finding ID: e724d11a-d1b6-4db0-a037-f121930a54ca
Invoice writes accept a customer ID without verifying that the customer belongs to the invoice merchant. Checkout transfers that association into a transaction, whose dashboard query joins the customer by ID alone and exposes the foreign customer's decrypted name and email.
Invoice creation and editing store a submitted customer ID without requiring that customer to belong to the invoice's merchant. The invoice list then retrieves the customer's encrypted name using an ID-only join and decrypts it, disclosing another merchant's customer name.
Evidence
- Source/control: The customer_id field supplied during creation or update of an attacker-owned merchant invoice.
- Sink/decision: getRecentDashboardTransactions selects foreign customer fields through an ID-only join; the dashboard decrypts and renders them.
- Missing mitigation: Neither invoice writes nor the customer join verifies that customer and invoice or transaction belong to the same merchant. An attacker can use an owned record to select another merchant's private customer fields.
Suggested remediation: Validate customer ownership against the invoice merchant before both creation and update. Add matching merchant IDs to customer joins as defense in depth, and enforce the association with a composite database constraint where practical.
Look up each submitted customer using both customer ID and invoice merchant ID, and reject associations outside that scope before creating or updating an invoice. Add the same merchant equality condition to customer joins so an invalid stored association cannot disclose another merchant's data.
Reported call path
- config/routes/web.php:121 — POST /admin/invoices/store
- src/Controller/Admin/InvoiceController.php:221 — store delegates to create
- src/Controller/Admin/InvoiceController.php:151 — request fields reach InvoiceService::create
- src/Service/Payment/InvoiceService.php:160 — foreign customer_id is accepted
- src/Service/Payment/InvoiceService.php:187 — association is persisted
- src/Service/Payment/InvoiceService.php:267 — an own-invoice update can select sent status
- src/Controller/Checkout/InvoiceCheckoutController.php:157 — invoice checkout creates the associated transaction
- src/Controller/Admin/DashboardController.php:141 — a subsequent dashboard request loads recent transactions
- src/Repository/TransactionRepository.php:418 — foreign customer fields are joined without merchant equality
- src/Controller/Admin/DashboardController.php:151 — customer name is decrypted
- src/Controller/Admin/DashboardController.php:160 — customer email is decrypted
- templates/admin/dashboard.twig:118 — foreign contact information is rendered
- src/Controller/Admin/InvoiceController.php:151 — forwards posted customer_id
- src/Service/Payment/InvoiceService.php:160 — accepts the foreign customer ID
- src/Service/Payment/InvoiceService.php:187 — persists the association
- src/Controller/Admin/InvoiceController.php:89 — subsequent invoice-list request
- src/Service/Payment/InvoiceService.php:79 — unscoped customer join [sink]
- src/Controller/Admin/InvoiceController.php:95 — decrypts the foreign customer name
- templates/admin/invoices/index.twig:19 — renders the name
Finding 30 — src/Middleware/CsrfMiddleware.php:159
Low · open_redirect · reachability: external · exploitability: moderate · CWE-601
Finding ID: e26ae544-12c5-4717-8466-5b49c502c372
The CSRF rejection handler treats the Referer path as a local redirect destination without checking its leading slashes. A path beginning with two slashes becomes an external destination when emitted in Location.
Evidence
- Source/control: The Referer header on a failed non-JSON checkout or payment-link POST.
- Sink/decision: CsrfMiddleware::forbidden() passes the extracted path to Response::redirect(), which preserves it in Location.
- Missing mitigation: The retry destination is derived from an untrusted header without enforcing a local-path policy before setting Location.
Suggested remediation: Construct the retry destination from the matched checkout or payment-link route. If accepting a supplied path is necessary, require exactly one leading slash and reject backslashes and other authority-form variants.
Reported call path
- config/routes/web.php:71 — POST /checkout/{token}/pay registration
- src/Kernel.php:319 — checkout middleware pipeline
- src/Middleware/SessionMiddleware.php:121 — continues to CSRF validation
- src/Middleware/CsrfMiddleware.php:72 — forbidden()
- src/Middleware/CsrfMiddleware.php:159 — Response::redirect()
- src/Http/Response.php:220 — unvalidated Location assigned [sink]
- src/Kernel.php:78 — Response::send() emits redirect
Finding 31 — src/Repository/MerchantUserRepository.php:279
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-269
Finding ID: e1d18273-0c41-404b-b0ce-5e9ff8baa974
Staff creation persists role ID 1 when no role was supplied and the merchant has no staff-slug role. The effective role is never checked for merchant ownership or delegation authority, allowing a staff manager to create an account with the installation Owner role.
Evidence
- Source/control: An authenticated staff.manage caller omits role_id or submits an empty value to POST /admin/staff/store.
- Sink/decision: createStaff inserts the account with the fallback role_id.
- Missing mitigation: The final resolved role is not validated before the account is created. A failed default lookup silently selects an unrelated privileged role.
Suggested remediation: Remove the hard-coded role ID fallback and reject creation when a valid default cannot be resolved. Before inserting the account, verify that the effective role belongs to the target merchant and is permitted by the caller's delegation policy.
Reported call path
- config/routes/web.php:158 — POST /admin/staff/store
- src/Controller/Admin/StaffController.php:311 — store delegates to create
- src/Controller/Admin/StaffController.php:112 — omitted role becomes null
- src/Controller/Admin/StaffController.php:191 — pass unresolved role to createStaff
- src/Repository/MerchantUserRepository.php:276 — fall back to role ID 1
- src/Repository/MerchantUserRepository.php:279 — insert the privileged account
- src/Security/Authenticator.php:185 — login grants global view from the assigned permissions
Finding 32 — src/Middleware/PermissionMiddleware.php:140
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: e1a939e5-c8f9-4d8e-af9d-250567381328
Removing brands.access_all does not revoke an existing session's global scope. A staff member who retains plugins.manage can continue changing global plugin and gateway status after losing authority to operate across brands.
Evidence
- Source/control: An authenticated non-superadmin's retained active_brand_id of zero after brands.access_all is revoked.
- Sink/decision: Global plugin deactivation and the global gateway status update.
- Missing mitigation: The application accepts a session's global scope without checking whether the current user still has permission to use it.
Suggested remediation: Check current global-scope authority before dispatching administrative operations. Reject the request or reset the session to the user's home merchant when that authority has been revoked.
Reported call path
- src/Security/Authenticator.php:185 — startSession() establishes authorized global context
- src/Controller/Admin/RolesController.php:222 — a later administrator request revokes brands.access_all through syncPermissions()
- config/routes/web.php:303 — staff submits POST /admin/plugins/{slug}/deactivate with the retained session
- src/Middleware/PermissionMiddleware.php:56 — accepts the retained global context
- src/Middleware/PermissionMiddleware.php:140 — authorizes plugins.manage without checking current global authority
- src/Controller/Admin/PluginController.php:382 — deactivate() resolves brand ID zero
- src/Controller/Admin/PluginController.php:386 — invokes PluginManager::deactivate()
- src/Plugin/PluginManager.php:315 — selects the global branch
- src/Plugin/PluginManager.php:329 — updates the global gateway status
Finding 33 — src/Middleware/CsrfMiddleware.php:130
Low · injection · reachability: external · exploitability: trivial · CWE-117
Finding ID: da7192fe-097d-452f-b8f6-ea6326cbf66e
CSRF rejection includes the attacker-supplied token in a log message. The logger writes embedded newlines unchanged, so one rejected request can insert fabricated application-log records.
Evidence
- Source/control: The _csrf_token form field submitted to POST /logout.
- Sink/decision: Logger::log() appends the formatted message to the application log with file_put_contents().
- Missing mitigation: The logger does not encode or escape untrusted message text to prevent it from creating additional physical log records.
Suggested remediation: Encode each event as a structured record or centrally escape carriage returns and newlines in message text. Remove submitted and session CSRF-token values from rejection messages.
Reported call path
- config/routes/web.php:60 — POST /logout registration
- src/Kernel.php:319 — web middleware pipeline
- src/Middleware/SessionMiddleware.php:121 — continues to CSRF validation
- src/Middleware/CsrfMiddleware.php:72 — forbidden() for missing session token
- src/Middleware/CsrfMiddleware.php:136 — Logger::warning() receives attacker-controlled line separators
- src/Service/System/Logger.php:134 — Logger::log()
- src/Service/System/Logger.php:196 — sanitizeMessage() preserves line separators
- src/Service/System/Logger.php:209 — forged record structure appended to log [sink]
Finding 34 — src/Controller/Checkout/CheckoutController.php:843
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-345
Finding ID: d3c26532-792e-4e04-bea0-ea5535e45d73
The controller treats unsuccessful payment verification as permission to accept a terminal failure supplied by the browser. Someone holding a checkout reference can mark an in-flight payment failed without authoritative gateway evidence and prevent its later legitimate confirmation from completing normally.
Evidence
- Source/control: The paymentID or payment_id and status query parameters on GET /checkout/{token}/status.
- Sink/decision: setGatewayAndStatus writes failed after handleCallback returns unsuccessful verification and the untrusted status matches cancel, failure, or failed.
- Missing mitigation: There is no requirement for authenticated provider failure evidence bound to the recorded payment attempt before persisting terminal failure.
Suggested remediation: Preserve processing state and release the temporary claim when callback verification fails. Persist terminal failure only from a verified provider outcome bound to the transaction and its current payment attempt.
Reported call path
- config/routes/web.php:74 — public checkout status GET
- src/Controller/Checkout/CheckoutController.php:779 — findAnyByTrxId loads the target
- src/Controller/Checkout/CheckoutController.php:815 — processing transaction is claimed
- src/Controller/Checkout/CheckoutController.php:838 — handleCallback attempts verification
- modules/gateways/stripe/StripeGateway.php:214 — verification returns false without session_id
- src/Service/Payment/GatewayApiService.php:175 — unsuccessful verification returns
- src/Controller/Checkout/CheckoutController.php:843 — untrusted status causes a failed-state write
- src/Repository/TransactionRepository.php:569 — transaction status is persisted
Finding 35 — src/Controller/Admin/DomainController.php:332
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-807
Finding ID: cab94294-b51c-4670-89ce-9b17b274caed
The ordinary domain update persists browser-supplied ownership verification and activation flags. A domain manager can make routing treat an unverified hostname as verified without completing the server's DNS TXT ownership challenge.
Evidence
- Source/control: status=active and dns_verified=1 posted to /admin/domains/{id}/update.
- Sink/decision: The tenant-scoped update stores forged ownership state subsequently trusted by DomainMiddleware for redirects and merchant routing.
- Missing mitigation: The general settings update allows clients to supply values that routing treats as proof of DNS ownership. Its field validation checks permitted representations rather than whether the server actually verified ownership.
Suggested remediation: Remove dns_verified from client-editable updates and preserve its server-maintained value during settings changes. Permit activation only when valid server-side ownership verification exists.
Reported call path
- src/Controller/Admin/DomainController.php:141 — store() creates the selected hostname mapping.
- src/Service/Domain/DomainService.php:107 — map() initially marks the record pending and unverified.
- src/Controller/Admin/DomainController.php:332 — update() accepts the caller's dns_verified assertion.
- src/Controller/Admin/DomainController.php:356 — updateScoped() persists the forged state [security decision].
- src/Middleware/DomainMiddleware.php:91 — a later request loads the hostname mapping.
- src/Middleware/DomainMiddleware.php:115 — forged flags satisfy the ownership gate.
- src/Middleware/DomainMiddleware.php:123 — root traffic follows the configured redirect; other permitted requests acquire merchant context at line 190.
Finding 36 — src/Controller/Admin/DeviceController.php:443
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: c8f501b6-cdc5-4b10-9913-eaa35ebadfc8
The merchant device-settings handler writes submitted SMS filters into global settings without checking platform authority. A merchant device manager can therefore alter the filtering policy returned to other merchants' authenticated devices.
Evidence
- Source/control: The sms_positive_keywords, sms_negative_keywords, and sms_filter_rules_check_interval_hours fields submitted to POST /admin/devices/settings.
- Sink/decision: Global settings writes at DeviceController.php:443-449, subsequently returned by ConfigController::filterRules.
- Missing mitigation: The handler does not restrict global policy changes to platform-authorized users or persist merchant-specific settings for ordinary merchant managers.
Suggested remediation: Either require platform authority before writing these global settings, or save merchant overrides and read them using the authenticated device's merchant ID. Apply the same ownership rule to both keyword lists and the refresh interval.
Reported call path
- config/routes/web.php:238 — POST /admin/devices/settings
- src/Middleware/PermissionMiddleware.php:258 — authorizes devices.manage
- src/Controller/Admin/DeviceController.php:432 — resolves the caller's merchant
- src/Controller/Admin/DeviceController.php:443 — writes global SMS policy [sink]
- src/Repository/SettingsRepository.php:118 — updates the global settings row
- src/Controller/Api/Mobile/ConfigController.php:73 — reads that policy for another merchant's device
- src/Controller/Api/Mobile/ConfigController.php:94 — returns the modified filter rules
Finding 37 — src/Repository/AuditLogRepository.php:93
Low · weak_cryptography · reachability: internal · exploitability: difficult
Finding ID: c3653368-c0d8-4013-8ada-77cd4a33686e
The audit verifier obtains its signing key through a configuration service that prefers mutable database settings over the environment. A database-only attacker can replace both audit contents and the key used to authenticate them, defeating the documented database-tampering check.
Evidence
- Source/control: A global runtime AUDIT_HMAC_SECRET setting controlled through database writes.
- Sink/decision: Selection of the key used by calculateSignature for signing and verification.
- Missing mitigation: The key that authenticates database records is not anchored outside the database being checked.
Suggested remediation: Read the audit signing and verification key exclusively from the protected environment or an external secret store. Do not permit a database setting to override that key.
Reported call path
- src/Controller/Admin/AuditIntegrityController.php:46 — scan invokes audit verification.
- src/Service/System/AuditService.php:83 — delegates to verifyIntegrity.
- src/Repository/AuditLogRepository.php:178 — recalculates each stored signature.
- src/Repository/AuditLogRepository.php:93 — requests AUDIT_HMAC_SECRET.
- src/Service/System/EnvironmentService.php:196 — reads the global runtime setting before environment fallback.
- src/Repository/SettingsRepository.php:96 — fetches the attacker-replaceable database value.
- src/Repository/AuditLogRepository.php:133 — computes HMAC with the substituted key.
Finding 38 — src/Middleware/IpAllowlistMiddleware.php:45
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: c2ca541d-7ead-4fd3-aba5-4ecc85871413
The webhook IP restriction reads only the process environment, although normal application boot loads dotenv values into PHP superglobals. A restrictive dotenv-only IP_ALLOWLIST is consequently treated as absent, allowing requests from excluded addresses to reach webhook handling.
Evidence
- Source/control: An HTTP POST to /webhook/{gateway} from an address excluded by the configured dotenv-only allowlist.
- Sink/decision: The empty-allowlist branch dispatches the request without checking its client address.
- Missing mitigation: The allowlist resolver does not consult the configuration stores populated by the application's dotenv loader.
Suggested remediation: Read IP_ALLOWLIST through a consistent configuration accessor that includes dotenv-populated superglobals and process variables. Ensure that a configured restrictive value cannot silently become the feature-disabled state.
Reported call path
- src/Kernel.php:97 — loads dotenv without exporting process variables
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Middleware/IpAllowlistMiddleware.php:43 — resolves the configured allowlist
- src/Middleware/IpAllowlistMiddleware.php:135 — getenv misses the dotenv-only policy
- src/Middleware/IpAllowlistMiddleware.php:47 — admits a policy-excluded caller [sink]
- src/Controller/Webhook/UnifiedWebhookController.php:58 — begins webhook handling with independent signature checks still applicable
Finding 39 — src/Service/Payment/PaymentLinkService.php:234
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: c1ec05a2-e97c-4297-b0f0-a455d83b104b
Administrative payment-link operations use the selected merchant or global session mode without checking the current user’s authority over that scope. Public checkout can replace the merchant selection, allowing restricted staff to read, create, reprice, or disable another merchant’s payment links.
Evidence
- Source/control: An authenticated staff member selects another merchant’s active public payment link through GET /pay/{slug}. Alternatively, a previously authorized user retains global session mode after losing brands.access_all.
- Sink/decision: PaymentLinkService updates a link using the unauthorized merchant supplied by PaymentLinkController; listing and creation also consume the unchecked scope.
- Missing mitigation: No administrative scope check binds the selected merchant to the current user or requires current cross-brand authority. Retained global mode is likewise accepted without reauthorization.
Suggested remediation: Authorize administrative scope against the current user on every request, requiring current cross-brand permission for other merchants or global access. Store public checkout branding separately from administrative tenant selection.
Reported call path
- config/routes/web.php:89 — GET /pay/{slug}
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — show() calls setActiveBrandId with the selected link's merchant.
- src/Service/Brand/BrandContext.php:203 — setActiveBrandId() persists active_brand_id in the shared session.
- config/routes/web.php:136 — Subsequent POST /admin/payment-links/{id}/update using that session.
- src/Middleware/PermissionMiddleware.php:56 — handle() resolves the session-selected merchant.
- src/Middleware/PermissionMiddleware.php:140 — handle() checks payment_links.manage without checking merchant authority.
- src/Controller/Admin/PaymentLinkController.php:219 — update() delegates to edit().
- src/Controller/Admin/PaymentLinkController.php:155 — edit() obtains the merchant through resolveMerchant().
- src/Controller/Admin/PaymentLinkController.php:176 — edit() calls PaymentLinkService.update().
- src/Service/Payment/PaymentLinkService.php:235 — UPDATE modifies the selected merchant's link [sink].
Finding 40 — src/Controller/Admin/PluginController.php:216
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: c1cedc9f-7295-41f4-8702-f708c53feaa0
Plugin installation accepts retained global session mode without checking current cross-brand authority. A staff member who loses brands.access_all but retains plugins.manage can still install application-wide PHP and execute its entrypoint through the settings action.
Evidence
- Source/control: A surviving global staff session after cross-brand permission removal, followed by an attacker-supplied plugin_zip upload.
- Sink/decision: PluginController calls PluginManager::install under stale global authorization; a subsequent settings POST executes the installed entrypoint through require_once.
- Missing mitigation: Platform-level installation checks session view state instead of the current user’s cross-brand permission. Changes to that permission do not invalidate or reauthorize existing global selections.
Suggested remediation: Require current superadmin or brands.access_all authority together with plugins.manage before installing platform-wide plugins. Reauthorize global scope on each administrative request and reset unauthorized retained scope to the user’s permitted merchant.
Reported call path
- config/routes/web.php:300 — POST /admin/plugins/upload after permission revocation
- src/Middleware/PermissionMiddleware.php:56 — resolve retained brand context
- src/Service/Brand/BrandContext.php:73 — accept session active_brand_id
- src/Middleware/PermissionMiddleware.php:140 — current plugins.manage permission passes
- src/Controller/Admin/PluginController.php:216 — requireGlobalView accepts retained global scope
- src/Controller/Admin/PluginController.php:264 — install uploaded archive
- src/Plugin/PluginManager.php:104 — installFromZip deploys package
- config/routes/web.php:308 — subsequent POST /admin/plugins/{slug}/settings
- src/Controller/Admin/PluginController.php:580 — resolvePluginInstance
- src/Controller/Admin/PluginController.php:641 — require_once executes uploaded PHP [sink]
Scan details: findings 41–60
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 41 — src/Controller/Admin/PluginController.php:822
Medium · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-200
Finding ID: b9599e34-746a-45ee-b1fa-eba74f2754fd
Brand gateway settings can replace the destination while retaining a private key inherited from global settings. The merged configuration is persisted and later sends the platform key to the brand editor's destination.
Evidence
- Source/control: Brand-local settings[server_url] and settings[store_id], with settings[api_key] blank or omitted, submitted to POST /admin/plugins/btcpay/settings.
- Sink/decision: BTCPayGateway::initiate executes a cURL request to server_url with the inherited API key in its Authorization header.
- Missing mitigation: The merge loses the distinction between a platform-owned inherited secret and brand-owned destination settings. No check requires a replacement brand-owned key when the destination changes.
Suggested remediation: Keep inherited credentials bound to their original destination. Require a complete brand-owned credential set when a brand overrides that destination, rather than copying inherited secrets into the new configuration.
Reported call path
- config/routes/web.php:308 — POST /admin/plugins/{slug}/settings
- src/Controller/Admin/PluginController.php:557 — saveSettings()
- src/Controller/Admin/PluginController.php:768 — readGatewayCredentials() inherits global settings
- src/Controller/Admin/PluginController.php:822 — saveGatewayCredentials() combines the inherited key and supplied endpoint
- src/Controller/Checkout/CheckoutController.php:636 — pay() initiates checkout under the brand
- src/Service/Payment/GatewayApiService.php:120 — initiatePayment()
- src/Gateway/GatewayBridge.php:101 — initiate() dispatches the merged credentials
- modules/gateways/btcpay/BTCPayGateway.php:99 — curl_exec() sends the key to the attacker endpoint [sink]
Finding 42 — src/Controller/Admin/TransactionController.php:303
Low · other · reachability: external · exploitability: difficult · CWE-362
Finding ID: b25f45d2-bf06-448a-93ce-a209c81aecf6
The controller posts payment-received entries even when the completion service rejects the state transition. A concurrent checkout cancellation can therefore leave the transaction cancelled while increasing cash and merchant payable without a completed payment.
Evidence
- Source/control: A checkout holder's authenticated cancellation request racing with a legitimate administrator completion request for the same pending or created transaction.
- Sink/decision: The recordPaymentReceived call consumes the reloaded transaction without checking whether this request successfully completed it.
- Missing mitigation: The ledger write is not tied to a successfully claimed completion transition. Its local database transaction protects journal posting but does not make the earlier state decision atomic with it.
Suggested remediation: Return an explicit completion-transition result and post the journal only when that transition succeeds. Perform the state transition and ledger posting within the same database transaction while preserving the terminal-state guard.
Reported call path
- config/routes/web.php:108 — the administrator's completion request enters TransactionController::updateStatus.
- src/Controller/Admin/TransactionController.php:253 — reads the transaction before the concurrent cancellation.
- Concurrent request: config/routes/web.php:73 → CheckoutController::cancel at line 729 → TransactionRepository::cancelByTrxId at line 507.
- src/Repository/TransactionRepository.php:510 — cancellation commits the terminal cancelled state.
- src/Controller/Admin/TransactionController.php:297 — calls TransactionService::complete.
- src/Repository/TransactionRepository.php:126 — the guarded completion update affects zero rows.
- src/Service/Payment/TransactionService.php:104 — returns the unchanged cancelled transaction.
- src/Controller/Admin/TransactionController.php:303 — nevertheless calls recordPaymentReceived.
- src/Service/Payment/LedgerService.php:162 — creates payment-received entries for the cancelled transaction.
Finding 43 — src/Repository/MerchantUserRepository.php:339
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: af024dd4-bdb8-4e17-8b7a-82d1f07d81f5
Staff deletion derives cross-merchant authority from retained session view state without checking the user's current brands.access_all permission. A user whose role loses global access but retains staff.manage can continue deleting other merchants' non-superadmin staff through an existing global-view session.
Evidence
- Source/control: A deletion request from a formerly authorized global-view user after their database role has been downgraded.
- Sink/decision: deleteStaff executes DELETE by account ID without a merchant predicate when the controller supplies null scope.
- Missing mitigation: Global tenant scope is not reauthorized against current permissions before the unscoped deletion. Changing a role does not invalidate the affected session's stored global authority.
Suggested remediation: Before selecting an unscoped staff operation, require a current superadmin identity or current brands.access_all permission. When that authority is absent, clear global session state and constrain the operation to the user's authorized merchant.
Reported call path
- Prior authorized update: src/Controller/Admin/StaffController.php:299 — replaces the user's role without clearing existing session scope.
- config/routes/web.php:162 — the demoted user's POST /admin/staff/{id}/delete dispatches StaffController::delete.
- src/Middleware/PermissionMiddleware.php:129 — loads the current role; staff.manage still permits the route.
- src/Controller/Admin/StaffController.php:340 — resolves the existing session's active brand.
- src/Service/Brand/BrandContext.php:218 — returns global view from retained session state.
- src/Controller/Admin/StaffController.php:344 — selects null merchantScope.
- src/Repository/MerchantUserRepository.php:339 — deletes the selected non-superadmin account without a merchant predicate.
Finding 44 — src/Repository/AuditLogRepository.php:205
Low · other · reachability: internal · exploitability: difficult · CWE-354
Finding ID: 9c4d2c54-d8c0-453c-b5d5-d8f2a83bf548
The integrity scanner treats a null signature as sufficient proof that a row is legitimate legacy history. A database-only attacker can clear a signature after altering a record, causing the application to sign the forged contents and accept them as intact.
Evidence
- Source/control: Altered audit event fields with the signature column set to NULL.
- Sink/decision: signExistingLogs persists a newly calculated valid signature over the current database contents.
- Missing mitigation: Verification automatically authenticates unsigned contents using eligibility determined solely by a mutable database column.
Suggested remediation: Keep verification read-only and report unexpected unsigned rows as unverifiable. Move legacy signing into a separate controlled migration using an independently approved baseline.
Reported call path
- config/routes/web.php:280 — GET /admin/audit-integrity
- src/Controller/Admin/AuditIntegrityController.php:43 — scan calls signExistingLogs after checking superadministrator authority.
- src/Service/System/AuditService.php:93 — delegates to the repository.
- src/Repository/AuditLogRepository.php:205 — selects attacker-modified rows whose signatures are null.
- src/Repository/AuditLogRepository.php:220 — calculates a valid signature over their current contents.
- src/Repository/AuditLogRepository.php:232 — persists the replacement signature.
Finding 45 — src/Controller/Checkout/PaymentIntentCheckoutController.php:1000
Low · other · reachability: external · exploitability: moderate · CWE-841
Finding ID: 9a8003d6-87b1-4e93-8649-bd74ad097185
Intent cancellation validates checkout identity but does not restrict the stored intent's current state. A payer retaining the original signature can replace completed parent status with cancelled, corrupting the merchant-visible intent lifecycle and producing a false cancellation result.
Evidence
- Source/control: The original intent token and checkout_hash submitted by its checkout holder to POST /checkout/intent/{token}/cancel.
- Sink/decision: The merchant-scoped updateScoped call unconditionally sets the parent intent status to cancelled.
- Missing mitigation: The parent update lacks an atomic predicate limiting cancellation to eligible unfinished states. The response also assumes cancellation succeeded rather than deriving its result from the stored state.
Suggested remediation: Cancel the parent only through an atomic transition from explicitly cancellable states, preserving completed and other terminal outcomes. Reload the resulting state and use it for rendering and merchant redirects.
Reported call path
- config/routes/web.php:82 — public intent cancellation route
- src/Middleware/CsrfMiddleware.php:81 — validate session token
- src/Controller/Checkout/PaymentIntentCheckoutController.php:969 — load intent without a terminal-state exclusion
- src/Controller/Checkout/PaymentIntentCheckoutController.php:994 — validate retained checkout signature
- src/Controller/Checkout/PaymentIntentCheckoutController.php:1000 — overwrite terminal intent status
- src/Controller/Checkout/PaymentIntentCheckoutController.php:1015 — return cancellation handoff
Finding 46 — src/Cron/UpdateCheckJob.php:51
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 9905b9e8-5a04-4d23-a307-a64f0b1df9ac
The automatic installation job ignores the dashboard's persisted disabling policy and checks only the process-environment AUTO_UPDATE flag. It can therefore replace application files and run database migrations after an administrator disables automatic installation.
Evidence
- Source/control: A scheduled execution, or a public cron request authenticated with the scheduler credential, while general.auto_update is disabled.
- Sink/decision: UpdateCheckJob calls UpdateService::execute, which installs an authenticated release and runs its migrations.
- Missing mitigation: The job performing installation does not enforce the saved automatic-installation policy, and the dashboard does not expose its ineffective status under the environment flag.
Suggested remediation: Use one effective automatic-update policy and check it before calling execute. Ensure the dashboard's Disabled choice prevents unattended installation, or explicitly expose and enforce a documented deployment override.
Reported call path
- config/routes/web.php:333 — GET /cron/{secret}
- src/Controller/Page/CronController.php:69 — validate cron credential
- src/Controller/Page/CronController.php:78 — CronJobRunner::run
- src/Cron/CronJobRunner.php:166 — execute due UpdateCheck job registered at config/services.php:815
- src/Cron/UpdateCheckJob.php:57 — UpdateService::execute despite saved Disabled policy
- src/Update/UpdateService.php:356 — extract application package
- src/Update/UpdateService.php:360 — run database migrations [sink]
Finding 47 — src/Repository/TransactionRepository.php:693
Low · other · reachability: external · exploitability: difficult · CWE-367
Finding ID: 951ac1a0-6bef-4257-8837-e3cf55ca734d
Manual verification checks the transaction status in a separate read, then writes pending_review without requiring the checked state to remain unchanged. A concurrent administrative completion or cancellation can be overwritten, reversing the terminal decision and disrupting financial state and refund eligibility.
Evidence
- Source/control: A payer's manual-verification request overlapping an authorized administrative status transition for the same transaction.
- Sink/decision: setStatusWithMeta updates status and metadata using transaction and merchant identifiers without checking the current status.
- Missing mitigation: The payer's status transition does not atomically require awaiting_verification. A successful earlier status check can become stale before the unconditional write.
Suggested remediation: Use a conditional UPDATE requiring status = awaiting_verification and check the affected-row count before reporting success or dispatching events. Merge verification metadata in that same guarded operation so concurrent changes are preserved.
Reported call path
- config/routes/web.php:75 — POST /checkout/{token}/manual-verify
- src/Controller/Checkout/CheckoutController.php:887 — findAwaitingVerification checks the initial state
- src/Repository/TransactionRepository.php:494 — awaiting_verification row is read without a transition lock
- src/Controller/Admin/TransactionController.php:297 — a concurrent authorized request completes the transaction
- src/Service/Payment/TransactionService.php:98 — terminal completion is persisted
- src/Controller/Checkout/CheckoutController.php:912 — the payer request resumes with pending_review
- src/Repository/TransactionRepository.php:693 — unconditional UPDATE overwrites the terminal state
Finding 48 — src/Controller/Admin/PluginController.php:533
Medium · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-200
Finding ID: 8e7a1fa3-d9e7-417a-8950-b8c19bdd6ee6
Secret redaction depends solely on the plugin field type, but bundled gateways declare private credentials as text or textarea. The settings page therefore returns decrypted bearer tokens, webhook secrets, and signing keys to staff with plugins.view, including inherited global credentials.
Evidence
- Source/control: An authenticated staff GET to an affected gateway’s plugin settings page selects stored merchant credentials or inherited global credentials.
- Sink/decision: SettingsRenderer::input places secrets in the value attribute; SettingsRenderer::textarea similarly includes private keys in textarea content. The generated HTML is returned in the settings response.
- Missing mitigation: The affected field definitions do not identify their values as secrets, and the renderer has no independent secret marker that prevents returning them to viewers. Storage encryption does not protect values deliberately decrypted for this response.
Suggested remediation: Mark private tokens, webhook secrets, and signing keys as secret and render empty replacement controls with a configured-state indicator. Support multiline secret replacement without returning saved contents, and preserve existing secrets when replacement fields are blank.
Reported call path
- config/routes/web.php:307 — GET /admin/plugins/{slug}/settings
- src/Middleware/PermissionMiddleware.php:140 — handle() accepts a caller with plugins.view
- src/Controller/Admin/PluginController.php:522 — settings() calls readGatewayCredentials()
- src/Controller/Admin/PluginController.php:766 — readGatewayCredentials() selects merchant credentials or a global fallback
- src/Controller/Admin/PluginController.php:778 — readGatewayCredentials() decrypts the payload
- src/Controller/Admin/PluginController.php:533 — settings() passes plaintext values to SettingsRenderer::render()
- src/View/SettingsRenderer.php:85 — render() sends GoCardless text credentials to input()
- src/View/SettingsRenderer.php:123 — input() includes the secret in the value attribute [sink]
- src/View/SettingsRenderer.php:167 — alternative: textarea() includes a private signing key [sink]
- templates/admin/plugins/settings.twig:36 — the generated form is returned to the caller
Finding 49 — src/Controller/Install/InstallerController.php:395
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-862
Finding ID: 8af8a76e-929d-4547-ad65-8061d51804db
The installer uses shared pending database credentials without verifying that the caller owns the installation attempt. After the operator imports the schema, an unrelated visitor can submit their own credentials and create the initial account with superadmin privileges.
Administrator creation uses database credentials saved globally by an earlier installation request without verifying that the current visitor owns that installation flow. Another visitor can therefore create an active superadmin in the operator's database.
Evidence
- Source/control: Anonymous name, email, username, and password fields in POST /install/create-admin.
- Sink/decision: The prepared INSERT execution creates an active merchant user with is_superadmin set to 1 using credentials loaded from shared temporary state.
- Missing mitigation: The privileged account-creation step has no bootstrap authentication or ownership check tying it to the operator who supplied the database credentials.
Suggested remediation: Require a deployment-controlled bootstrap credential for every installer step and bind pending credentials to that authorized attempt. Serialize account creation and installation completion so another visitor cannot consume the pending state.
Bind the temporary database configuration to a cryptographically random installation capability and require it for subsequent installation mutations. Invalidate it atomically when installation completes.
Reported call path
- config/routes/web.php:349 — operator POST /install/import-schema
- src/Controller/Install/InstallerController.php:265 — importSchema publishes shared credentials
- config/routes/web.php:350 — separate attacker POST /install/create-admin
- src/Controller/Install/InstallerController.php:350 — createAdmin reads shared state through parseTempEnv
- src/Controller/Install/InstallerController.php:361 — PDO authenticates with the stored credentials
- src/Controller/Install/InstallerController.php:395 — attacker identity is inserted as superadmin [sink]
- config/routes/web.php:349 — prerequisite operator request dispatches importSchema()
- src/Controller/Install/InstallerController.php:265 — importSchema() saves shared database credentials
- config/routes/web.php:350 — attacker POST /install/create-admin
- src/Kernel.php:319 — processRequest() executes the installer middleware pipeline
- src/Http/Router.php:332 — dispatch() invokes createAdmin()
- src/Controller/Install/InstallerController.php:318 — createAdmin() checks installation state without caller ownership
- src/Controller/Install/InstallerController.php:350 — parseTempEnv() loads the operator's credentials
- src/Controller/Install/InstallerController.php:361 — PDO connects using those credentials
- src/Controller/Install/InstallerController.php:395 — attacker-selected superadmin account is inserted [sink]
Finding 50 — src/Middleware/JwtAuthMiddleware.php:80
Medium · broken_auth · reachability: external · exploitability: moderate · CWE-613
Finding ID: 896826c2-5495-4c29-8430-a81065001961
Mobile resource authentication accepts refresh JWTs because issuance gives them the same authentication claims as access JWTs. It also ignores the blacklist populated during refresh rotation, allowing an invalidated refresh credential to continue accessing merchant data until its original expiry or device revocation.
Mobile authentication grants access using refresh JWTs because it does not require an access-token purpose. It also ignores the refresh rotation blacklist, allowing a stolen refresh token to authorize protected requests after legitimate rotation.
Evidence
- Source/control: A previously obtained refresh JWT supplied in the Authorization bearer header, including after legitimate rotation has blacklisted its JTI.
- Sink/decision: The middleware assigns authenticated merchant and device identities and dispatches protected resource controllers.
- Missing mitigation: Resource authentication does not require an access-token purpose, so a refresh credential can bypass the fingerprint and rotation controls of its designated consumer.
Suggested remediation: Issue access and refresh tokens with distinct signed purposes or audiences and enforce those distinctions at both consumers. Reject refresh credentials on resource routes so consumed refresh tokens cannot bypass rotation through another authentication path.
Issue a signed token-purpose claim and require the access purpose before dispatching protected mobile requests. Reject existing untyped refresh credentials during migration, or enforce their revocation state until they expire.
Reported call path
- src/Service/Auth/JwtService.php:227 — issue refresh token using access-token claims
- src/Service/Device/DevicePairingService.php:355 — blacklist consumed refresh jti
- config/routes/api.php:51 — subsequent GET /api/mobile/v1/dashboard
- src/Middleware/JwtAuthMiddleware.php:67 — verify signature and expiration
- src/Middleware/JwtAuthMiddleware.php:80 — accept shared claims without purpose or blacklist validation
- src/Middleware/JwtAuthMiddleware.php:134 — dispatch authenticated controller
- src/Controller/Api/Mobile/DashboardController.php:86 — return merchant financial data [sink]
- config/routes/api.php:57 — public token-refresh endpoint
- src/Controller/Api/Mobile/DeviceController.php:221 — refreshAccessToken
- src/Service/Device/DevicePairingService.php:294 — generic JWT verification
- src/Service/Device/DevicePairingService.php:345 — issues fresh access credential
- src/Service/Device/DevicePairingService.php:346 — issues fresh refresh credential
- src/Middleware/JwtAuthMiddleware.php:67 — alternate refresh-as-access acceptance
- src/Controller/Api/Mobile/DeviceController.php:250 — protected device-status consumer
Finding 51 — src/Controller/Admin/MobileNotificationLogController.php:85
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 7966d90d-cbd7-49a3-aa19-5f2f0f992349
The notification dashboard uses the session-selected merchant without checking whether the authenticated staff member may access that merchant. Public payment-link checkout writes the same selection, allowing staff to retrieve another merchant’s database-backed notification records.
Evidence
- Source/control: A staff member visits another merchant’s active public payment-link URL using their administrative session.
- Sink/decision: paginateScoped retrieves notification records for the checkout-selected merchant, which the response renders with bodies and device identifiers.
- Missing mitigation: The administrative query does not validate the selected merchant against the current user’s tenant authority. Public checkout branding and administrative tenant selection share persisted state.
Suggested remediation: Keep public checkout branding separate from administrative tenant selection. Before querying notification records, authorize the selected merchant against the current authenticated user and their current cross-brand permissions.
Reported call path
- config/routes/web.php:89 — public GET /pay/{slug}.
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — select the link's merchant.
- src/Service/Brand/BrandContext.php:203 — persist active_brand_id in the shared session.
- config/routes/web.php:231 — GET /admin/devices/notifications.
- src/Controller/Admin/MobileNotificationLogController.php:112 — resolve the session-selected merchant.
- src/Controller/Admin/MobileNotificationLogController.php:90 — query that merchant's records [sink].
- templates/admin/devices/notifications.twig:63 — begin rendering the disclosed records.
Finding 52 — src/Service/Auth/JwtService.php:225
Low · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 75febf6b-e1b3-4e65-9000-95233a6c2e85
Refresh credentials use the same signed claims and verification rules as access credentials, differing only in lifetime. This lets a refresh token authorize mobile requests directly and lets an access token obtain replacement credentials when the device fingerprint is available.
Evidence
- Source/control: An unexpired access or refresh JWT issued for a paired companion device.
- Sink/decision: Mobile bearer authentication grants merchant identity; the refresh endpoint issues new access and refresh credentials.
- Missing mitigation: The signed token does not identify its purpose, and consumers do not require an access or refresh purpose before granting that credential's authority. The signed renewal branch also bypasses matching against the current stored refresh credential.
Suggested remediation: Add a signed purpose claim and require the expected purpose at each consumer. Require renewal to match the current refresh credential and enforce its revocation when accepting it.
Reported call path
- config/routes/api.php:51 — GET /api/mobile/v1/dashboard uses mobile authentication.
- src/Middleware/JwtAuthMiddleware.php:67 — verifies the supplied refresh JWT as an ordinary bearer token.
- src/Middleware/JwtAuthMiddleware.php:129 — grants merchant and device request identity.
- src/Controller/Api/Mobile/DashboardController.php:68 — reads merchant statistics and transactions.
- config/routes/api.php:57 — alternate POST /api/mobile/v1/devices/token-refreshes path.
- src/Controller/Api/Mobile/DeviceController.php:221 — forwards the submitted token and fingerprint.
- src/Service/Device/DevicePairingService.php:294 — accepts an access JWT through verify and selects the stateless branch.
- src/Service/Device/DevicePairingService.php:345 — issues replacement credentials.
- src/Service/Auth/JwtService.php:227 — signs the new 30-day credential through the access-token issuer.
Finding 53 — src/Controller/Install/InstallerController.php:122
Low · ssrf · reachability: external · exploitability: difficult · CWE-918
Finding ID: 69d91ba7-7e72-499e-97f5-be14785d0547
During unlocked installation, anonymous callers can make the server attempt MySQL connections to destinations they select. Distinct connection errors let them distinguish reachable MySQL authentication endpoints from refused connections through the application's network position.
Evidence
- Source/control: JSON host and port fields in POST /install/test-db and POST /install/import-schema.
- Sink/decision: PDO connection construction using request-selected host and port at lines 122-125 and 211-213.
- Missing mitigation: No bootstrap authorization or destination restriction protects the server-side connection capability while installation is unlocked.
Suggested remediation: Require a deployment-controlled bootstrap credential before database tests or imports. Where practical, restrict connections to the database destination configured by the operator outside the public request.
Reported call path
- config/routes/web.php:348 — POST /install/test-db
- src/Controller/Install/InstallerController.php:98 — testDatabase reads the selected host
- src/Controller/Install/InstallerController.php:122 — PDO opens the selected server-side connection [sink]
- src/Controller/Install/InstallerController.php:159 — connection errors distinguish reachable MySQL authentication from refused connections
Finding 54 — src/Controller/Admin/PluginController.php:573
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: 68685d0d-8e9e-4188-a972-4cc816d073c9
Public checkout persists its merchant into the same session selection used for administrative writes. Plugin settings then consume that selection without checking whether the authenticated staff member may administer the merchant, enabling cross-merchant configuration changes.
Gateway settings use an administrative merchant selection that public checkout can overwrite. A staff member with plugin-management permission can consequently replace another merchant’s stored gateway credentials without authority over that merchant.
Evidence
- Source/control: The victim slug supplied to GET /pay/{slug}, followed by plugin settings submitted through the attacker's authenticated session.
- Sink/decision: saveSettings passes the unauthorized merchant selection to saveGatewayCredentials or bulkSetScoped.
- Missing mitigation: Administrative settings writes do not verify that the selected merchant belongs to the authenticated user's authorized scope. Public checkout can also modify that administrative selection.
Suggested remediation: Keep checkout merchant context separate from administrative session selection. Before reading or writing plugin settings, authorize the selected merchant against the current database-backed user and any explicit cross-brand privilege.
Stop public checkout from changing administrative session selection. Authorize the selected merchant before loading or updating gateway configuration, using the authenticated user’s current permitted scope.
Reported call path
- config/routes/web.php:89 — first request: GET /pay/{victim-slug}
- src/Controller/Checkout/PaymentLinkCheckoutController.php:77 — show() resolves the victim link
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — show() selects its merchant
- src/Service/Brand/BrandContext.php:203 — setActiveBrandId() writes the shared session
- config/routes/web.php:308 — second request: POST /admin/plugins/{slug}/settings
- src/Middleware/PermissionMiddleware.php:56 — handle() resolves the modified session brand
- src/Controller/Admin/PluginController.php:573 — saveSettings() resolves the same brand without membership authorization
- src/Controller/Admin/PluginController.php:598 — saveSettings() calls saveGatewayCredentials()
- src/Controller/Admin/PluginController.php:838 — saveGatewayCredentials() replaces victim credentials
- src/Repository/TenantScope.php:139 — updateScoped() performs the victim-merchant update [sink]
- src/Controller/Admin/PluginController.php:601 — alternative: bulkSetScoped() changes victim addon settings
- config/routes/web.php:89 — GET /pay/{slug}
- src/Controller/Checkout/PaymentLinkCheckoutController.php:77 — show() resolves the selected payment link
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — calls setActiveBrandId() with the link's merchant
- src/Service/Brand/BrandContext.php:203 — persists the victim merchant in the shared session
- config/routes/web.php:308 — subsequent POST /admin/plugins/{slug}/settings using that session
- src/Middleware/PermissionMiddleware.php:56 — resolves the session-selected merchant
- src/Middleware/PermissionMiddleware.php:140 — checks plugins.manage without merchant authorization
- src/Controller/Admin/PluginController.php:573 — saveSettings() resolves the poisoned context
- src/Controller/Admin/PluginController.php:598 — calls saveGatewayCredentials() for the victim merchant
- src/Controller/Admin/PluginController.php:838 — updates the victim's credentials_enc
- src/Repository/TenantScope.php:138 — executes the scoped database update
Finding 55 — src/Controller/Page/CronController.php:67
Low · broken_auth · reachability: external · exploitability: difficult
Finding ID: 672263e9-94c5-42c3-adb2-b49e136e7936
Cron authentication prefers a process-environment secret, while the regeneration operation changes only the database secret. A former credential holder can continue authenticating after the administrator receives a successful regeneration message.
Evidence
- Source/control: A holder of the previously valid process-environment cron credential submitting it to the public cron endpoint after regeneration.
- Sink/decision: The unchanged environment credential passes authentication and permits CronJobRunner::run.
- Missing mitigation: Regeneration neither revokes the credential actually used by authentication nor explains that an environment override prevents application-level rotation.
Suggested remediation: Make regeneration invalidate the effective credential. If deployment-managed credentials cannot be rotated here, disable regeneration for that configuration and clearly direct administrators to rotate the deployment secret.
Reported call path
- src/Controller/Admin/SettingsController.php:1459 — regenerateCronSecret changes only the database credential
- config/routes/web.php:333 — attacker submits the previous credential to GET /cron/{secret}
- src/Controller/Page/CronController.php:67 — nonempty CRON_SECRET overrides the rotated value
- src/Controller/Page/CronController.php:69 — previous credential passes authentication
- src/Controller/Page/CronController.php:78 — runner executes
- src/Cron/CronJobRunner.php:166 — registered due job runs
Finding 56 — src/Controller/Admin/SettingsController.php:945
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: 64d99eef-f634-4abc-8479-02842b030a5a
A brand settings manager can execute global retention deletes because the action handlers never verify platform administration authority. Their SQL filters by age without restricting merchant ownership, allowing one brand's staff to remove other brands' historical records.
Evidence
- Source/control: Authenticated POST requests to /admin/settings/optimize/logs or /admin/settings/optimize/all, including the log_retention_days parameter.
- Sink/decision: Global DELETE statements against audit, login-attempt, communication, webhook-delivery, and expired-session tables.
- Missing mitigation: No server-side platform-authority check protects the global deletion operations.
Suggested remediation: Require platform administration authority before either handler changes retention settings or deletes records. If brand-level cleanup is supported, implement a separate operation that restricts every affected record to the authorized merchant.
Reported call path
- config/routes/web.php:211 — POST /admin/settings/optimize/logs
- src/Middleware/PermissionMiddleware.php:140 — permits a caller holding settings.manage
- src/Controller/Admin/SettingsController.php:925 — optimizeLogs executes without a platform guard
- src/Controller/Admin/SettingsController.php:946 — deletes audit records across merchants
- src/Controller/Admin/SettingsController.php:949 — deletes login-attempt records across merchants
- src/Controller/Admin/SettingsController.php:952 — deletes communication records across merchants
- src/Controller/Admin/SettingsController.php:955 — deletes webhook delivery records across merchants
- config/routes/web.php:213 — alternate POST /admin/settings/optimize/all reaches equivalent deletions at SettingsController.php:1072
Finding 57 — src/Controller/Admin/StaffController.php:283
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-269
Finding ID: 6467453f-9287-4cc6-87f8-b722be880117
Staff role assignment verifies merchant membership but does not enforce the application's rule that non-superadmins may grant only permissions they hold. A staff manager can assign a stronger existing role to themselves or a controlled account; default-role resolution likewise performs no grant-authority check.
Evidence
- Source/control: role_id submitted during staff creation or editing, or its omission during creation.
- Sink/decision: StaffController passes the accepted role to updateStaff or createStaff for persistence in op_merchant_users.role_id.
- Missing mitigation: The application does not check whether the effective assigned role grants permissions beyond the acting user's authority, including when a default is selected.
Suggested remediation: Resolve the effective role before writing and verify both merchant ownership and that its permissions fall within the actor's grant authority. Apply the check to creation and updates, and reject creation when no authorized merchant-local default exists.
Reported call path
- config/routes/web.php:160 — POST staff update
- src/Controller/Admin/StaffController.php:329 — update delegates to edit
- src/Controller/Admin/StaffController.php:283 — accept proposed role_id
- src/Controller/Admin/StaffController.php:295 — accept same-merchant role without comparing privileges
- src/Controller/Admin/StaffController.php:299 — updateStaff
- src/Repository/MerchantUserRepository.php:317 — persist stronger role [sink]
- src/Middleware/PermissionMiddleware.php:129 — load stronger permissions on subsequent requests
Finding 58 — src/Controller/Admin/SettingsController.php:1520
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: 625c1fb0-6acf-437d-9acc-618afa06a835
Brand-scoped settings managers can change shared language state because the language actions require settings.manage without verifying platform administration authority. The default-language and translation stores have no merchant scope, so these writes affect other brands and administrators.
Evidence
- Source/control: default_language and translation strings submitted to the registered settings language POST endpoints.
- Sink/decision: setDefaultLanguage updates default flags across op_languages; saveTranslations updates a shared language row and storage/languages catalog file.
- Missing mitigation: The language mutation actions lack a platform-authority check before updating shared defaults and catalogs.
Suggested remediation: Require platform administration authority before all shared language mutations. If brand staff need localization controls, store and update their defaults and catalogs within the authorized merchant's scope.
Reported call path
- config/routes/web.php:216 — POST /admin/settings/language/save-default
- src/Kernel.php:319 — runs the admin middleware pipeline
- src/Middleware/PermissionMiddleware.php:116 — resolves the required route permission
- src/Middleware/PermissionMiddleware.php:258 — accepts settings.manage for the POST subroute
- src/Http/Router.php:332 — dispatches the language handler
- src/Controller/Admin/SettingsController.php:1520 — calls setDefaultLanguage without checking global authority
- src/Service/System/TranslationService.php:213 — clears default flags globally
- src/Service/System/TranslationService.php:214 — sets the attacker-selected global default
- src/Service/System/TranslationService.php:215 — commits the mutation [sink]
Finding 59 — src/Controller/Admin/SettingsController.php:211
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-862
Finding ID: 5ddc4d0d-a8ae-4fd7-bd1e-757ef2b87979
Brand settings pages omit cron_secret from their display settings, then mistake that omission for an absent global credential. Rendering an allowed brand tab therefore replaces the platform cron secret even when the caller has only viewing permission.
The brand settings page constructs a presentation map without cron_secret, then treats that omission as evidence that the global credential is missing. Opening an allowed settings tab therefore replaces the global credential even when the user has only settings.view.
Evidence
- Source/control: GET /admin/settings/branding or another allowed brand settings tab from an authenticated brand user with settings.view.
- Sink/decision: SettingsRepository::set writes a newly generated value to the global general.cron_secret setting.
- Missing mitigation: The initialization check reads a brand display array instead of the actual global credential. The resulting global mutation has no management authorization check and occurs during a viewing request.
Suggested remediation: Read the global cron secret independently of brand display settings. Move initialization and rotation into a dedicated operation authorized to manage platform credentials, and remove global credential writes from brand settings GET requests.
Remove credential writes from settings GET handlers. Read the global credential directly and initialize or rotate it only during installation or an explicitly authorized global management operation protected by CSRF validation.
Reported call path
- config/routes/web.php:194 — GET /admin/settings/{tab}
- src/Controller/Admin/SettingsController.php:770 — tab dispatches to index
- src/Controller/Admin/SettingsController.php:120 — builds brand-only settings without cron_secret
- src/Controller/Admin/SettingsController.php:211 — treats the absent display field as an absent platform secret
- src/Controller/Admin/SettingsController.php:214 — writes a new global credential
- src/Repository/SettingsRepository.php:119 — updates the global setting
- src/Controller/Page/CronController.php:69 — subsequent scheduler requests using the old database credential are rejected
- src/Middleware/PermissionMiddleware.php:209 — requires settings.view
- src/Controller/Admin/SettingsController.php:120 — builds a brand-only settings map
- src/Controller/Admin/SettingsController.php:211 — checks that map for the global credential
- src/Controller/Admin/SettingsController.php:214 — rotates the global credential [sink]
- src/Repository/SettingsRepository.php:118 — updates the global settings row
- src/Controller/Page/CronController.php:67 — subsequent cron requests use the changed database credential
Finding 60 — src/Controller/Admin/DisputeController.php:235
Low · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-552
Finding ID: 5b39f89a-7ef9-4fe4-ba88-086a3927a907
The dispute upload handler overrides the private storage directory with a directory beneath the public web root. The resulting document URL permits anyone who knows it to retrieve sensitive evidence without the current session, permission, or merchant checks protecting the dispute.
The dispute resolver overrides the private upload directory with public/assets. Sensitive evidence becomes a directly accessible static file whose retrieval bypasses the permissions and tenant checks protecting the dispute.
Evidence
- Source/control: A dispute evidence upload, followed by an unauthorized request using its complete previously obtained document URL.
- Sink/decision: Direct static delivery of evidence stored beneath public/assets/uploads/disputes.
- Missing mitigation: Evidence downloads bypass the application, so they cannot enforce current dispute permissions or merchant ownership.
Assumptions Based on these assumptions: A3 (Deployment configuration): The deployment uses the documented public/ document root and supplied static-file serving behavior, without an additional evidence-specific access restriction. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Store dispute evidence outside the public web root and stream downloads through an authenticated endpoint that checks current dispute permissions and merchant ownership. Move existing documents and remove public copies so old asset URLs stop working.
Use the default private storage directory for dispute evidence. Provide a download route that checks the current user's permission and access to the associated dispute before streaming the file.
Reported call path
- config/routes/web.php:129 — authorized dispute-resolution upload
- src/Controller/Admin/DisputeController.php:235 — private storage root is overridden with public/assets
- src/Service/System/FilesystemService.php:62 — storeUpload uses the overridden root
- src/Service/System/FilesystemService.php:136 — evidence is moved beneath the public directory
- src/Controller/Admin/DisputeController.php:248 — public file URL is retained in dispute evidence
- templates/admin/disputes/show.twig:60 — viewer receives the permanent URL
- public/.htaccess:9 — a subsequent unauthenticated request serves the existing document directly
- config/routes/web.php:129 — POST /admin/disputes/{id}/resolve
- src/Controller/Admin/DisputeController.php:195 — tenant-scoped dispute lookup
- src/Controller/Admin/DisputeController.php:235 — private root is overridden with public/assets
- src/Controller/Admin/DisputeController.php:236 — storeUpload()
- src/Service/System/FilesystemService.php:136 — evidence is moved beneath the public root
- public/.htaccess:9 — known evidence URL is served without application authorization
Scan details: findings 61–80
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 61 — src/Controller/Admin/StaffController.php:299
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 54f2f417-eb62-4d48-9be7-33dbf5f75e70
A non-superadmin staff manager can replace a reachable superadmin's password and disable its TOTP because account-management actions check merchant ownership without checking the target's privilege. The attacker can then sign in as that account and obtain platform-wide superadmin authority.
A delegated staff manager can replace a reachable superadmin's password because staff updates check merchant scope without checking the target's privilege. The factor-reset endpoint also permits clearing that target's TOTP, allowing authentication with platform-wide authority.
Staff credential changes authorize the caller by feature permission and merchant membership without protecting more privileged target accounts. A non-superadmin staff manager can replace a same-merchant superadmin's password and clear its MFA, enabling full account takeover.
Evidence
- Source/control: Attacker-selected staff ID and replacement password submitted to the staff update endpoint, followed by the target's reset-2fa endpoint when needed.
- Sink/decision: updateStaff persists the replacement password_hash; reset2fa calls disableTotp to clear enforcement and the stored secret for the accepted target.
- Missing mitigation: The account-management operations lack a rule preventing lower-privilege actors from changing superadmin credentials or recovery settings.
Suggested remediation: Reject superadmin targets when the acting user is not a superadmin before updating credentials or resetting 2FA. Enforce this rule consistently in the shared account-management layer as well as the handlers.
Before changing a superadmin's credentials or resetting their factor, require a current database-backed superadmin actor. Enforce this rule in a shared mutation layer so both endpoints apply it.
Require superadmin authority before changing a superadmin's credentials or MFA settings. Centralize the target-account privilege check and apply it consistently to administrative account mutations.
Reported call path
- config/routes/web.php:160 — POST /admin/staff/{id}/update enters StaffController::update.
- src/Controller/Admin/StaffController.php:329 — delegates to edit.
- src/Controller/Admin/StaffController.php:221 — findStaff accepts a scoped superadmin record.
- src/Controller/Admin/StaffController.php:262 — hashes the attacker-selected replacement password.
- src/Repository/MerchantUserRepository.php:317 — persists password_hash.
- Second request: config/routes/web.php:161 → StaffController::reset2fa at line 392 → disableTotp at line 406.
- src/Repository/MerchantUserRepository.php:404 — clears two_factor_enabled and totp_secret_enc.
- Subsequent login: src/Security/Authenticator.php:111 — accepts the replacement password and starts the superadmin session when TOTP is disabled.
- config/routes/web.php:160 — POST staff update
- src/Controller/Admin/StaffController.php:329 — update delegates to edit
- src/Controller/Admin/StaffController.php:221 — load target without a privilege restriction
- src/Controller/Admin/StaffController.php:262 — construct replacement password hash
- src/Controller/Admin/StaffController.php:299 — updateStaff
- src/Repository/MerchantUserRepository.php:317 — persist replacement credentials [sink]
- src/Controller/Admin/StaffController.php:406 — related reset endpoint disables target TOTP [sink]
- config/routes/web.php:160 — POST /admin/staff/{id}/update
- src/Controller/Admin/StaffController.php:262 — hash the attacker-selected replacement password
- src/Repository/MerchantUserRepository.php:317 — replace the target credential
- config/routes/web.php:161 — POST /admin/staff/{id}/reset-2fa
- src/Controller/Admin/StaffController.php:399 — select the same superadmin without a privilege check
- src/Repository/MerchantUserRepository.php:404 — clear MFA
- src/Middleware/PermissionMiddleware.php:111 — subsequent login obtains superadmin authority
Finding 62 — src/Repository/AuditLogRepository.php:120
Low · other · reachability: internal · exploitability: difficult · CWE-354
Finding ID: 4606ad50-95b3-48b0-8405-e899cd1a33ff
The audit signature does not authenticate created_at. A database-only attacker can falsify an event's chronology without invalidating its signature, and backdating can make the event eligible for an ordinary retention purge.
Evidence
- Source/control: A modified created_at value on an otherwise valid signed audit row.
- Sink/decision: The HMAC payload omits the timestamp consumed by activity ordering and retention deletion.
- Missing mitigation: The integrity calculation does not bind the timestamp even though the application uses it to present history and determine retention.
Suggested remediation: Assign the event timestamp before signing and include its canonical representation in both signing and verification. Version the signature format so existing records are explicitly identified as lacking timestamp protection.
Reported call path
- src/Controller/Admin/AuditIntegrityController.php:46 — scan invokes verification.
- src/Service/System/AuditService.php:83 — delegates to the repository.
- src/Repository/AuditLogRepository.php:158 — loads the timestamp-modified audit row.
- src/Repository/AuditLogRepository.php:178 — passes only nine fields for signature calculation.
- src/Repository/AuditLogRepository.php:120 — constructs the payload without created_at.
- src/Repository/AuditLogRepository.php:190 — accepts the original signature despite the changed timestamp.
Finding 63 — src/Middleware/IdempotencyMiddleware.php:96
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 417e8a49-40a9-41d8-9cef-3feef1a1fa73
Idempotency middleware returns merchant-shared cached responses before endpoint-specific authorization runs. Because the cache does not distinguish API-key identities, a write-only credential can retrieve a privileged caller's cached plaintext API key despite lacking the admin scope required by the controller.
Idempotency replay returns merchant-wide cached responses before endpoint authorization runs. A write-only API key can retrieve a plaintext credential generated by a more privileged caller when it supplies the matching idempotency key and request.
Evidence
- Source/control: A same-merchant write-scoped bearer credential supplying an existing Idempotency-Key and the matching method, URI, and raw request body.
- Sink/decision: The cached-response return in IdempotencyMiddleware::handle(), which bypasses ApiKeyController::enforceSecureAccess().
- Missing mitigation: Cached responses are returned without checking the current caller's complete endpoint permissions or binding access to the initiating credential. This permits sensitive results to cross the privilege boundary between credentials within one merchant.
Suggested remediation: Perform endpoint authorization before returning cached responses and bind replay records to the initiating API-key identity. Exclude plaintext credential responses from generic caching unless replay preserves their access restrictions.
Authorize the endpoint before returning cached responses and bind sensitive replay entries to the authenticated API-key identity. Apply both controls when storing and retrieving key-generation results.
Reported call path
- config/routes/api.php:34 — POST /api/v1/api-keys
- src/Middleware/BearerAuthMiddleware.php:122 — accepts write scope
- src/Middleware/IdempotencyMiddleware.php:78 — merchant-scoped cache lookup
- src/Service/Payment/IdempotencyService.php:46 — loads existing response
- src/Middleware/IdempotencyMiddleware.php:96 — returns plaintext credential without enforceSecureAccess
- src/Controller/Api/ApiKeyController.php:117 — original response's sensitive value
- src/Middleware/BearerAuthMiddleware.php:122 — accept the attacker’s write scope
- src/Middleware/IdempotencyMiddleware.php:78 — check the merchant-wide idempotency entry
- src/Service/Payment/IdempotencyService.php:46 — retrieve the cached entry
- src/Repository/IdempotencyRepository.php:45 — match merchant, idempotency value, and expiry
- src/Middleware/IdempotencyMiddleware.php:96 — return the cached credential without controller authorization
Finding 64 — src/Gateway/GatewayBridge.php:78
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 3c2b9d17-1ce3-4383-9802-03c325904195
Payment initiation invokes a gateway without enforcing the merchant's explicit inactive plugin override. Credential lookup can fall back to usable global credentials or retained plugin settings, allowing a checkout visitor to initiate payment through a gateway disabled for that brand.
Evidence
- Source/control: The gateway and gateway_mode fields supplied by a public visitor with a valid pending checkout token.
- Sink/decision: GatewayBridge invokes the selected adapter with fallback credentials, allowing an authenticated provider payment-session request.
- Missing mitigation: No effective brand-activation check runs before credential lookup and adapter invocation. Excluding inactive credential rows alone does not enforce the brand's explicit plugin denial.
Suggested remediation: Check the merchant's effective plugin and gateway activation before resolving credentials or invoking the adapter. Treat an explicit inactive brand override as a denial even when global credentials exist.
Reported call path
- config/routes/web.php:71 — POST /checkout/{token}/pay
- src/Controller/Checkout/CheckoutController.php:562 — pay() accepts the gateway selection
- src/Controller/Checkout/CheckoutController.php:636 — invokes initiatePayment()
- src/Service/Payment/GatewayApiService.php:120 — dispatches to GatewayBridge
- src/Gateway/GatewayBridge.php:79 — selects credentials without enforcing brand activation
- src/Gateway/GatewayBridge.php:101 — invokes the disabled gateway adapter [sink]
- modules/gateways/stripe/StripeGateway.php:155 — example authenticated provider request
Finding 65 — src/Repository/MerchantUserRepository.php:317
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 3b7b1311-63bc-49af-9d59-e6e1557812d4
Staff updates validate role ownership but do not restrict which permissions the caller may delegate. A staff.manage holder can assign a stronger merchant-owned role to their own account and gain permissions that the role editor explicitly prohibits them from granting.
Evidence
- Source/control: The role_id field submitted to POST /admin/staff/{id}/update for the caller's own account.
- Sink/decision: updateStaff persists the accepted role_id as the account's effective role.
- Missing mitigation: The assigned role's permissions are not compared with the caller's authority to grant them. Merchant ownership alone does not prevent privilege escalation within a merchant.
Suggested remediation: Apply the existing permission-delegation ceiling before persisting any account-role assignment. Reject roles exceeding the caller's grant authority, including assignments to the caller's own account, and reuse the check during staff creation.
Reported call path
- config/routes/web.php:160 — POST /admin/staff/{id}/update
- src/Middleware/PermissionMiddleware.php:258 — require staff.manage
- src/Controller/Admin/StaffController.php:329 — update delegates to edit
- src/Controller/Admin/StaffController.php:295 — accept a stronger merchant-owned role
- src/Repository/MerchantUserRepository.php:317 — persist role_id
- src/Middleware/PermissionMiddleware.php:129 — load the stronger role on a subsequent request
Finding 66 — src/Controller/Admin/SettingsController.php:1462
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-862
Finding ID: 35997415-509f-499c-8034-9674d7c8f69f
A brand settings manager can replace the platform's database-backed cron credential because the rotation handler never checks platform administration authority. Where cron authentication uses that credential, existing scheduled requests immediately lose access.
Evidence
- Source/control: An authenticated brand-scoped caller submits POST /admin/settings/cron/regenerate.
- Sink/decision: SettingsRepository::set writes general.cron_secret in the global settings scope.
- Missing mitigation: The credential-rotation action does not distinguish brand settings authority from authority over platform-wide cron authentication.
Suggested remediation: Require platform administration authority before generating or persisting a replacement cron credential. Enforce the check on the POST action before the global settings write.
Reported call path
- config/routes/web.php:197 — POST /admin/settings/cron/regenerate
- src/Middleware/PermissionMiddleware.php:258 — settings.manage authorizes the POST
- src/Controller/Admin/SettingsController.php:1462 — global credential update without a global-authority check [sink]
- config/routes/web.php:211 — alternate POST /admin/settings/optimize/logs
- src/Controller/Admin/SettingsController.php:946 — unscoped audit-log deletion [alternate sink]
Finding 67 — src/Controller/Checkout/PaymentLinkCheckoutController.php:224
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-472
Finding ID: 300ad069-a4f2-4e92-bbcb-387f8a2cb9de
The public submission handler creates a linked transaction using the payer's amount even when the merchant configured a fixed price. A payer can therefore complete an underpriced payment that counts as successful use of that link.
Evidence
- Source/control: The amount field in POST /pay/{slug}/submit.
- Sink/decision: TransactionRepository::create persists amount and net_amount from the request together with the selected payment_link_id.
- Missing mitigation: The transaction creation path does not enforce the merchant's fixed-price setting. Optional custom-amount bounds cannot substitute for that check.
Suggested remediation: Use the stored amount whenever a fixed price is configured, or reject custom-amount submissions for those links. Apply this rule before inserting the transaction.
Reported call path
- config/routes/web.php:90 — POST /pay/{slug}/submit
- src/Controller/Checkout/PaymentLinkCheckoutController.php:224 — accept supplied amount
- src/Controller/Checkout/PaymentLinkCheckoutController.php:294 — persist lower-priced linked transaction [sink]
- src/Controller/Checkout/CheckoutController.php:636 — initiate persisted amount
- src/Service/Payment/PaymentCompletionListener.php:77 — count successful link payment
Finding 68 — src/Controller/Admin/SettingsController.php:838
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: 287b80b5-9c1e-46fd-bfa0-a61a21c3a253
A brand settings manager can invoke platform-wide cache clearing because the handler checks no platform authority beyond the route's settings.manage permission. This removes shared security state, including other accounts' consumed TOTP windows.
Evidence
- Source/control: An authenticated brand-scoped caller submits POST /admin/settings/optimize/cache or /admin/settings/optimize/all.
- Sink/decision: The shared CacheInterface instance is flushed at SettingsController.php:844 or :1019.
- Missing mitigation: The maintenance handlers do not verify that the caller may modify platform-wide state before flushing a cache shared by all accounts.
Suggested remediation: Check platform administration authority before either maintenance handler performs side effects. Keep consumed TOTP windows in security storage that ordinary cache maintenance cannot erase.
Reported call path
- config/routes/web.php:209 — POST /admin/settings/optimize/cache
- config/middleware.php:39 — admin middleware group
- src/Middleware/PermissionMiddleware.php:116 — resolves the required permission
- src/Middleware/PermissionMiddleware.php:256 — accepts settings.manage for the maintenance POST
- src/Controller/Admin/SettingsController.php:844 — flushes the shared cache
- src/Cache/FileCache.php:102 — unlinks cache entries belonging to all users
- config/routes/web.php:213 — alternate POST /admin/settings/optimize/all
- src/Controller/Admin/SettingsController.php:1019 — repeats the global cache flush
- src/Controller/Admin/SettingsController.php:1072 — deletes aged audit records across merchants
Finding 69 — src/Controller/Admin/TransactionController.php:340
Low · other · reachability: external · exploitability: difficult · CWE-841
Finding ID: 26f344eb-a4f4-43a0-8f79-00cb24933762
The manual refunded-status branch posts a reversal for the original payment amount without subtracting earlier refunds. After a partial refund, it can reduce cash and merchant payable by more than the original payment across the combined refund journals.
Evidence
- Source/control: An authenticated staff submission with status=refunded for an accessible completed transaction that already has a completed partial refund.
- Sink/decision: recordRefund receives the original transaction amount under a distinct full-amount refund ID, producing an additional full reversal.
- Missing mitigation: The manual accounting branch does not enforce the aggregate refund limit before changing payment status, creating the refund record, and posting its journal.
Suggested remediation: Route manual refund accounting through a shared operation that locks the payment and validates the remaining amount against pending and completed refunds. Record only the remaining eligible amount and commit the refund record, payment status, and journal together.
Reported call path
- config/routes/web.php:108 — POST /admin/transactions/{id}/update dispatches updateStatus.
- src/Controller/Admin/TransactionController.php:279 — a partially refunded, completed transaction passes eligibility.
- src/Controller/Admin/TransactionController.php:313 — selects the full original amount.
- src/Controller/Admin/TransactionController.php:333 — inserts a distinct completed full-amount refund.
- src/Controller/Admin/TransactionController.php:340 — calls LedgerService::recordRefund.
- src/Service/Payment/LedgerService.php:207 — constructs another full cash and merchant-payable reversal.
- src/Repository/LedgerRepository.php:142 — persists the resulting balance changes.
Finding 70 — src/Repository/DisputeRepository.php:86
Low · authorization_bypass · reachability: external · exploitability: difficult · CWE-841
Finding ID: 16c930c0-6478-4d40-b6ba-86f774e78fe6
The application presents finalized disputes as locked, but resolution updates check only record and merchant IDs. A user authorized to resolve active disputes can submit another resolution request and overwrite finalized evidence and verdict metadata.
Evidence
- Source/control: A repeated POST /admin/disputes/{id}/resolve with an allowed final status and replacement evidence.
- Sink/decision: The UPDATE replaces status, evidence, resolved_at, and updated_at without requiring an active starting status.
- Missing mitigation: The finalization rule is enforced only by hiding the form; the database update does not restrict the allowed starting state.
Suggested remediation: Add a current-status condition allowing resolution only from open or under_review, and reject updates that affect no rows. Provide any necessary corrections through a separately authorized, audited revision operation.
Reported call path
- config/routes/web.php:129 — POST /admin/disputes/{id}/resolve
- src/Controller/Admin/DisputeController.php:195 — loads the dispute without checking its current status
- src/Controller/Admin/DisputeController.php:219 — validates only the requested final status
- src/Controller/Admin/DisputeController.php:254 — calls DisputeService::resolve
- src/Service/Payment/DisputeService.php:83 — calls the scoped repository
- src/Repository/DisputeRepository.php:86 — overwrites the finalized verdict and evidence
Finding 71 — src/Controller/Admin/DomainController.php:442
Low · ssrf · reachability: external · exploitability: moderate · CWE-918
Finding ID: 13c9ea17-4eb4-41f8-b278-c0c9961fbe28
The SSL diagnostic connects to a merchant-selected destination without restricting its network address. Domain validation accepts private and loopback dotted IPv4 addresses, allowing domain managers to initiate internal TLS connection attempts on port 443.
Evidence
- Source/control: The domain submitted to the administrative domain-creation route and subsequently selected through that mapping’s check-ssl action.
- Sink/decision: stream_socket_client opens ssl://{stored domain}:443.
- Missing mitigation: No destination-address policy runs before the socket opens, and pending mappings remain eligible for the diagnostic.
Suggested remediation: Resolve destinations and reject loopback, private, link-local, and other prohibited addresses before connecting. Pin the connection to the validated address while retaining hostname certificate verification so another DNS lookup cannot bypass the policy.
Reported call path
- src/Controller/Admin/DomainController.php:125 — store() receives the selected hostname.
- src/Service/Domain/DomainService.php:107 — map() stores it as an unverified mapping.
- src/Controller/Admin/DomainController.php:392 — checkSsl() retrieves the attacker-owned mapping.
- src/Controller/Admin/DomainController.php:403 — checkSsl() passes its hostname to checkSslStatus().
- src/Controller/Admin/DomainController.php:442 — stream_socket_client() connects to the selected address on port 443 [sink].
Finding 72 — src/Controller/Admin/SmsTemplateAdminController.php:533
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-841
Finding ID: 12c0f350-11f7-4bb1-839f-fe2f8263601c
Manual SMS matching completes a payment and posts its ledger entries without requiring a valid SMS to be linked. A positive nonexistent or foreign SMS ID causes a zero-row update that is ignored, allowing an SMS manager to mark a pending payment as received without supporting SMS evidence.
Evidence
- Source/control: sms_id and transaction_id supplied to POST /admin/sms-center/match by an authenticated caller with sms.manage.
- Sink/decision: TransactionService::complete changes payment status, followed by LedgerService::recordPaymentReceived posting the transaction amount and fee.
- Missing mitigation: Payment completion does not depend on successfully consuming an existing, eligible SMS that supports the selected transaction.
Suggested remediation: Load and lock the merchant-owned SMS, validate its eligibility and payment details, and abort unless a conditional link update succeeds. If evidence-free manual approval is intended, expose it separately under explicit financial approval authority.
Reported call path
- config/routes/web.php:251 — POST /admin/sms-center/match
- src/Middleware/PermissionMiddleware.php:258 — authorizes sms.manage
- src/Controller/Admin/SmsTemplateAdminController.php:515 — validates only the selected transaction's merchant
- src/Controller/Admin/SmsTemplateAdminController.php:533 — ignores SMS linking failure [sink]
- src/Repository/SmsParsedRepository.php:61 — returns the scoped update result
- src/Controller/Admin/SmsTemplateAdminController.php:540 — completes the payment regardless of that result
- src/Service/Payment/TransactionService.php:98 — persists completed status
- src/Controller/Admin/SmsTemplateAdminController.php:541 — posts payment funds
- src/Service/Payment/LedgerService.php:167 — records the financial journal
Finding 73 — src/Controller/Admin/DisputeController.php:260
Low · other · reachability: external · exploitability: difficult · CWE-778
Finding ID: 01f940cb-a98d-4054-82d0-2c6c4bf6213c
The controller supplies a table name to a database method that requires a complete SQL statement. The resulting audit failure occurs after the dispute update, leaving the resolution committed without its promised separate audit record.
Evidence
- Source/control: An authenticated, CSRF-valid dispute-resolution request containing an allowed resolution status and evidence.
- Sink/decision: The malformed Database::insert('op_audit_logs', ...) call after DisputeService::resolve.
- Missing mitigation: The controller does not use the existing audit-record API and does not commit the dispute update and required audit record together. Catching the audit exception leaves the earlier state change intact.
Suggested remediation: Write the event through AuditLogRepository::record or the corresponding audit service. Wrap the dispute update and required audit write in one database transaction so an audit failure rolls back the mutation.
Reported call path
- config/routes/web.php:129 — POST /admin/disputes/{id}/resolve
- src/Controller/Admin/DisputeController.php:254 — performs dispute resolution
- src/Service/Payment/DisputeService.php:83 — updates the dispute
- src/Controller/Admin/DisputeController.php:260 — supplies a table name as SQL to Database::insert
- src/Core/Database.php:293 — forwards the malformed statement to execute
- src/Core/Database.php:251 — prepares invalid SQL
- src/Controller/Admin/DisputeController.php:280 — catches the audit failure after the mutation
Finding 74 — src/Controller/Admin/ApiKeyController.php:100
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: fa5285ad-5794-4f33-b15f-d838aa7410b8
Public checkout persists its merchant selection in the same session field used by administrative operations. Those operations trust the selected merchant without checking the staff member's tenant access, allowing restricted staff to generate credentials owned by another merchant.
Public checkout persists its merchant selection into the administrative session. Protected requests trust that selection without checking the user's authority over the merchant, allowing tenant staff with API-key management permission to create credentials for another merchant.
Evidence
- Source/control: A restricted staff member visits another merchant's public GET /pay/{slug} URL on the master application domain using their authenticated session.
- Sink/decision: ApiKeyController::generate passes the changed merchant ID to ApiKeyService::generate, which inserts an active victim-owned API key and returns its secret to the initiating session.
- Missing mitigation: Public checkout context is persisted into administrative tenant state, and protected key operations do not verify that the authenticated user may operate on the selected merchant.
Suggested remediation: Keep public checkout merchant context request-local instead of writing administrative session selection. Before administrative operations, verify that the selected merchant belongs to the user's authorized tenant scope.
Keep checkout merchant selection local to the checkout request. Before protected administrative operations, validate the selected merchant and global-view state against the current user's merchant and current cross-brand permissions.
Reported call path
- config/routes/web.php:89 — GET /pay/{slug}
- src/Controller/Checkout/PaymentLinkCheckoutController.php:77 — resolve the public link
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — set its merchant as active
- src/Service/Brand/BrandContext.php:203 — persist active_brand_id
- config/routes/web.php:258 — subsequent POST /admin/api-keys/generate
- src/Middleware/PermissionMiddleware.php:56 — resolve the persisted merchant
- src/Middleware/PermissionMiddleware.php:140 — authorize the caller’s operation permission
- src/Controller/Admin/ApiKeyController.php:100 — generate the victim-owned key
- src/Service/Customer/ApiKeyService.php:45 — insert under the selected tenant
- src/Controller/Admin/DeveloperController.php:145 — disclose the generated credential to the attacker’s session
- src/Controller/Checkout/PaymentLinkCheckoutController.php:88 — show() selects the public link's merchant
- src/Service/Brand/BrandContext.php:203 — setActiveBrandId() persists that merchant in the shared session
- src/Middleware/PermissionMiddleware.php:56 — restores the selected merchant without caller-to-merchant authorization
- src/Controller/Admin/ApiKeyController.php:100 — generate() requests a key for that merchant
- src/Service/Customer/ApiKeyService.php:45 — generate() performs the scoped insert
- src/Repository/TenantScope.php:115 — createScoped() assigns the selected merchant
- src/Repository/BaseRepository.php:235 — create() inserts the victim-owned credential [sink]
Finding 75 — modules/gateways/google-pay/GooglePayGateway.php:188
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: f0238508-2a53-4c97-b4b2-27cb0fe7bbaf
Google Pay accepts a mock payment identifier and a caller-supplied amount whenever its configured mode is non-live, including in production. Apple Pay, Authorize.Net, and Giropay have corresponding simulation branches that omit the explicit production prohibition, allowing forged confirmations to complete real transactions.
Evidence
- Source/control: Query parameters on the public checkout status endpoint, including paymentID, amount, and adapter-specific simulated identifiers.
- Sink/decision: The adapter reports successful payment verification without provider evidence; GatewayApiService subsequently completes the transaction and records payment received.
- Missing mitigation: The simulation branches do not check the application environment before accepting fabricated payment evidence. GatewayDefaults explicitly requires production to reject these confirmations even when the gateway is configured in non-live mode.
Suggested remediation: Reject simulated confirmations when isProductionEnv() returns true before returning successful verification in each affected adapter. Apply the same production restriction to simulated initiation so checkout cannot offer an unusable mock payment flow.
Reported call path
- config/routes/web.php:74 — public checkout status
- src/Controller/Checkout/CheckoutController.php:838 — forward callback query
- src/Service/Payment/GatewayApiService.php:172 — request adapter verification
- src/Gateway/GatewayBridge.php:122 — invoke selected adapter
- modules/gateways/google-pay/GooglePayGateway.php:180 — accept mock prefix outside live mode
- modules/gateways/google-pay/GooglePayGateway.php:196 — return simulated success
- src/Service/Payment/GatewayApiService.php:244 — complete transaction [sink]
Finding 76 — modules/gateways/blik/BlikGateway.php:226
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: edbde054-deed-41b2-8f82-6be26e4fa207
In non-live gateway mode, a caller-selected SIM_ transaction identifier produces successful verification with the caller's declared amount. The branch omits the production guard and can authorize settlement without a provider payment.
Evidence
- Source/control: Customer-controlled gateway_trx_id, reference, and amount query fields, with a nonempty paymentID to trigger checkout status callback handling.
- Sink/decision: The simulation branch returns successful payment verification without contacting the provider.
- Missing mitigation: The simulated verification branch does not reject production environments before granting payment success.
Suggested remediation: Apply isProductionEnv() before simulated verification and reject simulated identifiers in production regardless of gateway mode. Require provider-confirmed payment before completing real transactions or posting payment ledger entries.
Reported call path
- src/Controller/Checkout/CheckoutController.php:619 — claims checkout for gateway processing
- src/Service/Payment/GatewayApiService.php:120 — initiates BLIK checkout
- modules/gateways/blik/BlikGateway.php:93 — returns code-collection form
- config/routes/web.php:74 — public checkout status route
- src/Controller/Checkout/CheckoutController.php:838 — forwards callback query
- src/Gateway/GatewayBridge.php:122 — invokes adapter verification
- modules/gateways/blik/BlikGateway.php:226 — accepts SIM_ payment without production check
- src/Service/Payment/GatewayApiService.php:244 — completes unpaid transaction
- src/Service/Payment/GatewayApiService.php:247 — records payment received
Finding 77 — modules/gateways/braintree/BraintreeGateway.php:201
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: eb4762b0-b78a-429e-8b08-ad14d9e8042d
When the payment nonce is missing and credential mode is not live, verification reports a simulated successful payment and echoes the caller's amount. This return bypasses the production guard, allowing an unpaid production transaction to complete and receive a ledger entry.
When payment_method_nonce is absent and the merchant's configured mode is not live, verification reports a completed payment without provider confirmation. This branch also runs in production, allowing a customer to turn an unpaid checkout into a completed transaction and payment ledger entry.
Evidence
- Source/control: Query parameters on the public checkout status route: a nonempty paymentID, the expected amount, and no payment_method_nonce.
- Sink/decision: The simulated-success return is accepted by GatewayApiService::handleCallback, which completes the transaction and calls recordPaymentReceived.
- Missing mitigation: The missing-nonce success branch neither requires provider confirmation nor applies the explicit production prohibition on simulated payments.
Suggested remediation: Reject callbacks without a payment nonce for real payments. If simulation remains supported, require explicit sandbox mode and a nonproduction environment before every simulated-success return.
Reject missing payment nonces in production regardless of the configured gateway mode. If simulation is retained for local testing, apply the existing production-environment guard before returning simulated success, and require provider-confirmed payment for production completion.
Reported call path
- config/routes/web.php:74 — checkout status route
- src/Controller/Checkout/CheckoutController.php:809 — processes callback for a processing checkout
- src/Controller/Checkout/CheckoutController.php:838 — invokes handleCallback
- src/Service/Payment/GatewayApiService.php:172 — invokes verification
- src/Gateway/GatewayBridge.php:122 — invokes Braintree adapter
- modules/gateways/braintree/BraintreeGateway.php:201 — missing nonce enters simulated success
- src/Service/Payment/GatewayApiService.php:244 — completes unpaid checkout
- src/Service/Payment/GatewayApiService.php:247 — records payment received
Finding 78 — src/Controller/Admin/AuthController.php:224
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-362
Finding ID: df229500-4679-46d4-ad67-5d2607a88bf9
TOTP consumption is persisted with an unconditional cache write after verification against an earlier read. Concurrent requests can both accept the same unused account-wide time window and then establish authenticated sessions.
Evidence
- Source/control: Concurrent POST /2fa requests supplying the same valid code from separate password-authenticated pending sessions for one account.
- Sink/decision: The unconditional replay-state write succeeds independently in each request, after which startSession() and the second-factor verification flag grant authenticated access.
- Missing mitigation: No account-wide atomic consumption operation must succeed before authentication is granted.
Suggested remediation: Atomically claim the verified account and time window before starting the authenticated session, and reject requests that lose that claim. Ensure concurrent writes cannot move the consumed window backwards.
Reported call path
- config/routes/web.php:67 — POST /2fa
- src/Controller/Admin/AuthController.php:224 — read the consumed-window snapshot
- src/Controller/Admin/AuthController.php:228 — verify against that snapshot
- src/Middleware/TwoFactorMiddleware.php:141 — accept the matching unused window
- src/Controller/Admin/AuthController.php:235 — independently record consumption
- src/Controller/Admin/AuthController.php:241 — create the authenticated session
- src/Controller/Admin/AuthController.php:249 — mark two-factor verification complete
Finding 79 — modules/gateways/tap-payments/TapPaymentsGateway.php:208
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-841
Finding ID: d6352930-b0af-4adf-a980-a8ebe875d591
Tap Payments accepts a callback identifier beginning with SIM_ as successful payment evidence whenever gateway mode is non-live. It omits the application's production restriction, allowing fabricated evidence to complete ordinary production transactions and create payment-received ledger entries.
Evidence
- Source/control: Query parameters supplied by a checkout customer: gateway_trx_id beginning with SIM_, the expected amount, and a nonempty paymentID or payment_id.
- Sink/decision: TapPaymentsGateway::verify() returns success and completed status without contacting the provider.
- Missing mitigation: The simulation branch does not enforce the production-environment restriction before returning successful payment verification.
Suggested remediation: Reject simulation callbacks in production before returning success, using the shared production-environment guard. Keep simulated payments in an isolated test flow and require authoritative provider confirmation for ordinary production transactions.
Reported call path
- config/routes/web.php:74 — public checkout status route
- src/Controller/Checkout/CheckoutController.php:833 — forward attacker-supplied simulation fields
- src/Service/Payment/GatewayApiService.php:172 — request verification
- src/Gateway/GatewayBridge.php:122 — dispatch to TapPaymentsGateway::verify
- modules/gateways/tap-payments/TapPaymentsGateway.php:208 — accept SIM_ evidence in non-live mode
- src/Service/Payment/GatewayApiService.php:244 — complete the unpaid transaction
- src/Service/Payment/GatewayApiService.php:247 — record the ledger credit
Finding 80 — modules/gateways/xendit/XenditGateway.php:203
Medium · authorization_bypass · reachability: external · exploitability: difficult
Finding ID: cf766c47-a80d-4d67-aecb-23d247d05f0f
Xendit verification accepts a caller-selected paid invoice without binding its external_id to the local transaction being completed. A customer can reuse payment evidence from one invoice to complete other eligible transactions with matching verified amounts.
Evidence
- Source/control: The id, invoice_id, or gateway_trx_id query parameter on GET /checkout/{token}/status, together with a nonempty paymentID or payment_id trigger.
- Sink/decision: XenditGateway::verify returns successful verification without order binding; GatewayApiService::handleCallback completes the independently selected local transaction at line 244 and records ledger credit.
- Missing mitigation: The returned provider external_id is discarded, and completion does not compare the verified invoice with the expected local order or enforce one-time consumption of that provider payment.
Suggested remediation: Persist the expected provider invoice identifier during initiation and require the verified external_id and invoice identifier to match the local transaction. Enforce atomic, merchant-and-provider-scoped uniqueness when consuming a provider payment.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:833 — build callback data for the selected local checkout
- src/Controller/Checkout/CheckoutController.php:838 — handleCallback()
- src/Service/Payment/GatewayApiService.php:172 — verify callback
- src/Gateway/GatewayBridge.php:122 — XenditGateway::verify()
- modules/gateways/xendit/XenditGateway.php:179 — retrieve caller-selected provider invoice
- modules/gateways/xendit/XenditGateway.php:205 — accept paid invoice without checking external_id
- src/Service/Payment/GatewayApiService.php:244 — complete unrelated local transaction
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Scan details: findings 81–100
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 81 — modules/gateways/tsys/TsysGateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-347
Finding ID: c80056ab-3647-48e5-a256-ea17bde34e7f
TSYS accepts a signature header without validating its value and directly completes the pending payment referenced by the body. A fabricated notification can therefore mark an unpaid transaction and its linked invoice paid.
Evidence
- Source/control: An unauthenticated POST to /webhook/tsys with an arbitrary nonempty X-TSYS-Signature and JSON reference identifying a pending checkout.
- Sink/decision: TsysGateway::handleWebhook() calls TransactionService::complete() without authoritative payment verification.
- Missing mitigation: No authenticated notification or provider lookup confirms successful payment and the expected payment value before completion.
Suggested remediation: Implement provider-supported notification authentication and reject invalid or unverifiable notifications. Confirm successful payment and match its merchant, local reference, provider identifier, amount, and currency before completing the transaction.
Reported call path
- config/routes/web.php:337 — POST /webhook/tsys
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke TSYS verifier
- modules/gateways/tsys/TsysGateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/tsys/TsysGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 82 — modules/gateways/skrill/SkrillGateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: bcbbbbe3-ee77-497d-aace-a715ad20640d
Skrill webhook authentication checks only whether a signature header is nonempty, so callers can fabricate accepted notifications. The handler completes the referenced pending transaction without authenticating a successful matching payment, allowing an unpaid invoice to be marked paid.
Evidence
- Source/control: Unauthenticated POST /webhook/skrill with an arbitrary nonempty X-Skrill-Signature header and JSON reference identifying a pending checkout.
- Sink/decision: SkrillGateway::handleWebhook calls TransactionService::complete at line 294.
- Missing mitigation: The notification is not authenticated with the provider's supported verification mechanism, and no successful-payment check binds its contents to the stored transaction before completion.
Suggested remediation: Implement Skrill's provider-defined notification authentication and reject invalid evidence before dispatch. Complete a transaction only after authenticated evidence confirms successful payment for the matching merchant, reference, provider identifier, amount, and currency.
Reported call path
- config/routes/web.php:337 — POST /webhook/skrill
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Skrill verifier
- modules/gateways/skrill/SkrillGateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/skrill/SkrillGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 83 — modules/gateways/btcpay/BTCPayGateway.php:99
Low · ssrf · reachability: external · exploitability: difficult · CWE-918
Finding ID: ad51f70a-89dc-4e72-b554-48015588b523
Merchant plugin settings control the complete BTCPay base URL, and the payment adapter connects to it without restricting its destination. A staff account authorized to configure the merchant's integration can thereby send requests from the payment server to loopback or private-network destinations.
Evidence
- Source/control: settings[server_url] submitted by authenticated staff with plugins.manage to POST /admin/plugins/btcpay/settings.
- Sink/decision: BTCPayGateway::initiate executes curl_exec using a URL built directly from persisted server_url.
- Missing mitigation: Neither settings validation nor the outbound request checks whether the configured host, port, and resolved addresses are authorized for merchant-controlled connections.
Suggested remediation: Apply a platform-controlled destination policy before connecting, restricting schemes, ports, and resolved addresses. Reject loopback and private destinations by default, pin validated DNS results, and require an explicit administrator-approved exception for private BTCPay deployments.
Reported call path
- config/routes/web.php:308 — configuration request: POST /admin/plugins/btcpay/settings
- src/Controller/Admin/PluginController.php:589 — saveSettings() applies presence-only validation
- src/Controller/Admin/PluginController.php:598 — saveSettings() calls saveGatewayCredentials()
- src/Controller/Admin/PluginController.php:830 — saveGatewayCredentials() retains server_url in the persisted payload
- config/routes/web.php:71 — trigger request: POST /checkout/{token}/pay
- src/Controller/Checkout/CheckoutController.php:636 — pay() calls initiatePayment() with btcpay
- src/Service/Payment/GatewayApiService.php:120 — initiatePayment() calls GatewayBridge::initiate()
- src/Gateway/GatewayBridge.php:79 — initiate() decrypts the configured credentials
- src/Gateway/GatewayBridge.php:101 — initiate() invokes BTCPayGateway::initiate()
- modules/gateways/btcpay/BTCPayGateway.php:80 — initiate() reads server_url
- modules/gateways/btcpay/BTCPayGateway.php:83 — curl_init() receives the selected destination
- modules/gateways/btcpay/BTCPayGateway.php:99 — curl_exec() makes the server-side request [sink]
Finding 84 — src/Controller/Admin/AuditIntegrityController.php:43
Low · csrf · reachability: external · exploitability: difficult · CWE-352
Finding ID: 9ff1704b-db30-4d45-b816-2598043175fd
The GET integrity page permanently signs unsigned audit records before displaying its results. Because GET bypasses CSRF validation, a cross-site navigation can trigger this maintenance write using a superadministrator's session.
Evidence
- Source/control: An attacker-controlled link or redirect navigating the victim to GET /admin/audit-integrity.
- Sink/decision: signExistingLogs() ultimately updates op_audit_logs.signature for every unsigned row.
- Missing mitigation: The handler does not require a CSRF-validated unsafe request method before creating signatures.
Assumptions Based on these assumptions: A3 (Deployment configuration): The deployed session cookie uses the shipped SameSite=Lax configuration in config/app.php:55-62, applied by SessionMiddleware.php:58-79. Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.
Suggested remediation: Make GET display existing integrity information without signing records. Run signature creation only through a CSRF-protected POST action.
Reported call path
- config/routes/web.php:280 — GET /admin/audit-integrity.
- src/Middleware/CsrfMiddleware.php:45 — bypass token validation for GET.
- src/Controller/Admin/AuditIntegrityController.php:43 — invoke signature creation.
- src/Service/System/AuditService.php:93 — forward to the repository.
- src/Repository/AuditLogRepository.php:205 — select unsigned rows across merchants.
- src/Repository/AuditLogRepository.php:232 — persist newly calculated signatures [sink].
Finding 85 — modules/gateways/worldpay/WorldpayGateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult
Finding ID: 978accf0-09d8-4f8d-b158-b04c9548a8ce
The Worldpay webhook verifier accepts any nonempty signature header without authenticating the notification. Its registered handler then marks a referenced pending transaction complete without establishing that payment occurred.
Evidence
- Source/control: An unauthenticated POST /webhook/worldpay containing an arbitrary nonempty X-Worldpay-Signature header and a customer-known pending transaction reference.
- Sink/decision: WorldpayGateway::handleWebhook calls TransactionService::complete at line 294, triggering completion of the transaction and payment of its linked invoice.
- Missing mitigation: The webhook path lacks authentication that binds the notification body to Worldpay and lacks confirmation of successful settlement for the selected transaction.
Suggested remediation: Implement Worldpay's supported notification authentication and reject invalid notifications. Before completion, confirm successful payment and bind the provider payment, merchant, reference, amount, and currency to the local transaction.
Reported call path
- config/routes/web.php:337 — POST /webhook/worldpay
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Worldpay verifier
- modules/gateways/worldpay/WorldpayGateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/worldpay/WorldpayGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 86 — src/Controller/Admin/DeveloperController.php:117
High · sensitive_data_exposure · reachability: external · exploitability: moderate · CWE-200
Finding ID: 9425acd3-b504-40e1-a5c5-dc469ccc2245
The Developer Hub configures tenant state but calls pagination that ignores it. The resulting records include other merchants' webhook signing secrets, which are passed unfiltered to the requesting operator's HTML.
The Developer Hub selects a tenant but calls a paginator that ignores that selection. It consequently loads webhook records across merchants and returns their complete signing secrets to a merchant-scoped viewer.
The Developer Hub configures a tenant on the webhook repository but calls a paginator that ignores that configuration. Its response can therefore include other merchants' webhook records and complete signing secrets.
Evidence
- Source/control: GET /admin/developer from an authenticated merchant-scoped operator with api_keys.view.
- Sink/decision: Unscoped webhook pagination retrieves complete records, and the template embeds complete signing secrets in copy-button attributes and serialized edit data.
- Missing mitigation: The query does not apply the authorized merchant predicate, and no ownership filter removes unauthorized webhook records before rendering.
Suggested remediation: Call paginateScoped() on the tenant-configured repository, or use a dedicated query that binds the authorized merchant ID. If this page has exposed other merchants' signing secrets, rotate those secrets.
Replace this call with tenant-scoped pagination and verify that each merchant receives only its own webhook records. Rotate signing secrets that were exposed through this page.
Call paginateScoped for this listing so both row and count queries include the selected merchant. Limit returned secret fields to those required by the authorized merchant's feature.
Reported call path
- config/routes/web.php:264 — GET /admin/developer
- src/Middleware/PermissionMiddleware.php:226 — requires api_keys.view
- src/Controller/Admin/DeveloperController.php:117 — calls WebhookRepository::forTenant(...)->paginate
- src/Repository/TenantScope.php:29 — returns a clone with tenant state
- src/Repository/BaseRepository.php:162 — retrieves webhook rows without consulting tenant state
- src/Controller/Admin/DeveloperController.php:149 — passes rows to the administrative template
- src/Controller/Admin/AdminPageTrait.php:183 — renders the response
- templates/admin/developer/index.twig:317 — exposes complete signing secrets in HTML
- config/routes/web.php:264 — GET /admin/developer dispatches DeveloperController::index.
- src/Middleware/PermissionMiddleware.php:226 — the route requires api_keys.view.
- src/Controller/Admin/DeveloperController.php:117 — calls forTenant($mid)->paginate(1, 100).
- src/Repository/BaseRepository.php:162 — selects webhook rows without a merchant predicate.
- src/Controller/Admin/DeveloperController.php:149 — forwards the records as webhooks.
- templates/admin/developer/index.twig:317 — emits the complete signing secret.
- src/Middleware/PermissionMiddleware.php:140 — checks api_keys.view
- src/Controller/Admin/DeveloperController.php:117 — invokes paginate on a tenant clone
- src/Repository/BaseRepository.php:163 — selects webhook rows without merchant filtering
- src/Controller/Admin/DeveloperController.php:149 — supplies returned rows to the template
- templates/admin/developer/index.twig:317 — embeds complete webhook signing secrets
Finding 87 — src/Controller/Admin/BrandController.php:405
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-863
Finding ID: 8fe134d5-ba02-4e7a-bdf0-1bbf49841cc5
Requests trust previously established global session scope after the permission authorizing that scope is revoked. Current operation permissions are checked independently, allowing a formerly global operator to continue acting on other merchants.
Evidence
- Source/control: An active non-superadministrator session that legitimately entered global view before losing brands.access_all.
- Sink/decision: An ID-only DELETE against op_merchants executes using stale global authority.
- Missing mitigation: Request authorization does not revalidate the permission supporting global scope, and permission changes do not clear affected scope.
Suggested remediation: Before dispatching a request in global scope, require current superadministrator status or brands.access_all. When that authority is absent, restore the user's authorized home scope or reject the request before any cross-brand operation.
Reported call path
- config/routes/web.php:153 — POST /admin/brands/{id}/delete
- src/Kernel.php:319 — execute the admin middleware pipeline
- src/Middleware/PermissionMiddleware.php:56 — resolve the existing global session context
- src/Middleware/PermissionMiddleware.php:58 — skip the single-brand restriction for active ID zero
- src/Middleware/PermissionMiddleware.php:129 — load current role permissions
- src/Middleware/PermissionMiddleware.php:140 — require brands.manage without rechecking global authority
- src/Controller/Admin/BrandController.php:405 — delete the selected merchant
Finding 88 — modules/gateways/stax/StaxGateway.php:260
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-347
Finding ID: 86d87d98-0946-4e14-b031-0a26ec18cf8f
Stax treats the presence of a signature header as successful authentication and directly completes the pending transaction identified by the body. An arbitrary header and known checkout reference can therefore replace proof of payment.
Evidence
- Source/control: An unauthenticated POST to /webhook/stax containing an arbitrary nonempty X-Stax-Signature header and JSON reference.
- Sink/decision: StaxGateway::handleWebhook() calls TransactionService::complete() without authoritative payment verification.
- Missing mitigation: The notification body is not cryptographically authenticated, and the handler does not confirm successful payment or its expected value before completion.
Suggested remediation: Implement the provider-supported notification authentication and fail closed when verification is unavailable or fails. Confirm successful payment and match its merchant, reference, provider identifier, amount, and currency before completing the local transaction.
Reported call path
- config/routes/web.php:337 — POST /webhook/stax
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Stax verifier
- modules/gateways/stax/StaxGateway.php:260 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/stax/StaxGateway.php:293 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 89 — modules/gateways/sofort/SofortGateway.php:264
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: 79fec4a9-3bb1-487b-9cbc-6863e2c1e127
Sofort accepts unauthenticated webhook bodies and completes the pending transaction selected by their reason field. The handler never obtains authoritative payment confirmation, so a customer can mark an unpaid transaction and its linked invoice paid.
Evidence
- Source/control: An unauthenticated POST to /webhook/sofort with reference and reason set to a known pending checkout reference, and an arbitrary transaction value.
- Sink/decision: handleWebhook() calls TransactionService::complete() using the transaction selected from the submitted reason.
- Missing mitigation: No authenticated notification or provider lookup establishes successful payment for the selected transaction before completion.
Suggested remediation: Reject unverifiable notifications and obtain authoritative payment confirmation before completing the transaction. Match the merchant, local reference, provider transaction, successful status, amount, and currency against stored payment data.
Reported call path
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:89 — invokes webhook signature verification
- src/Gateway/GatewayBridge.php:162 — calls the registered adapter's verifyWebhook()
- modules/gateways/sofort/SofortGateway.php:239 — accepts the unsigned payload
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatches webhook.incoming.sofort
- src/Event/EventManager.php:252 — invokes the handler registered at SofortGateway.php:52
- modules/gateways/sofort/SofortGateway.php:264 — calls TransactionService::complete() [sink]
- src/Service/Payment/TransactionService.php:98 — persists completed status
- src/Service/Payment/TransactionService.php:108 — emits payment.transaction.completed
- src/Service/Payment/PaymentCompletionListener.php:67 — marks a linked invoice paid
Finding 90 — src/Cache/RedisCache.php:72
Low · other · reachability: external · exploitability: difficult
Finding ID: 7371bdb7-f087-415c-a537-d6b65e3a1fb8
Cache writes use the configured prefix literally, but flush interprets it as part of a Redis glob. A custom prefix containing glob characters can make application cache maintenance delete records outside the promised literal namespace.
Evidence
- Source/control: An authenticated application administrator with settings.manage invokes POST /admin/settings/optimize/cache under an operator-selected Redis prefix containing glob syntax.
- Sink/decision: RedisCache::flush passes all SCAN matches to Redis DEL without checking that their keys begin with the literal prefix.
- Missing mitigation: The prefix is not escaped before use in a Redis glob, and returned keys are not checked against the literal namespace before deletion.
Suggested remediation: Escape Redis glob metacharacters in the configured prefix before constructing the SCAN pattern. Also verify that each deletion candidate starts with the literal prefix before passing it to DEL.
Reported call path
- config/routes/web.php:209 — POST /admin/settings/optimize/cache.
- src/Middleware/PermissionMiddleware.php:258 — require settings.manage.
- src/Controller/Admin/SettingsController.php:844 — invoke cache flush.
- src/Cache/RedisCache.php:72 — construct an unescaped namespace glob.
- src/Cache/RedisCache.php:75 — collect expanded matches.
- src/Cache/RedisCache.php:77 — delete all returned keys [sink].
Finding 91 — modules/gateways/paddle/PaddleGateway.php:186
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 71340ee6-60ef-4d6e-a87a-51bd7de61d1b
Paddle, Payfast, and Xendit independently return successful payment verification for simulated or missing provider identifiers in non-live gateway mode, including when the application runs in production. Each branch accepts the callback's amount without provider evidence, allowing a customer to complete an unpaid real checkout.
Evidence
- Source/control: Customer-controlled query parameters on checkout status routes, including a SIM_ provider identifier and the checkout's expected amount.
- Sink/decision: Paddle lines 186–191, Payfast lines 166–171, and Xendit lines 171–176 return simulated success that the shared callback service uses for completion and ledger posting.
- Missing mitigation: Each adapter's simulation-success branch omits the existing production-environment guard and returns payment success without authenticated provider evidence.
Suggested remediation: Reject simulated and missing provider identifiers in production before any success return in all three adapters. Restrict simulation acceptance to explicit test environments and require authoritative provider evidence for real settlement.
Reported call path
- config/routes/web.php:74 — public checkout status route
- src/Controller/Checkout/CheckoutController.php:833 — merge query parameters with the server-selected transaction reference
- src/Controller/Checkout/CheckoutController.php:838 — handleCallback()
- src/Service/Payment/GatewayApiService.php:172 — GatewayBridge::verify()
- src/Gateway/GatewayBridge.php:122 — invoke selected adapter
- modules/gateways/paddle/PaddleGateway.php:186 — simulation success; equivalent branches exist in PayfastGateway.php:166 and XenditGateway.php:171
- src/Service/Payment/GatewayApiService.php:244 — complete transaction
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Finding 92 — modules/gateways/trustcommerce/TrustCommerceGateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-347
Finding ID: 7001f96b-7534-412c-899a-e6cfc1dfc3c6
TrustCommerce accepts a signature header without verifying its contents and completes the pending transaction named by the notification. An attacker with a checkout reference can therefore substitute a fabricated notification for proof of payment.
Evidence
- Source/control: An unauthenticated POST to /webhook/trustcommerce with any nonempty X-TC-Signature header and a known pending transaction reference in JSON.
- Sink/decision: TrustCommerceGateway::handleWebhook() calls TransactionService::complete() without authoritative payment verification.
- Missing mitigation: The handler lacks cryptographic notification verification and authoritative confirmation that the referenced payment succeeded for the expected value.
Suggested remediation: Validate notifications using the provider-supported authentication mechanism and reject unverifiable requests. Before completion, confirm successful payment and match its merchant, reference, provider identifier, amount, and currency to the stored transaction.
Reported call path
- config/routes/web.php:337 — POST /webhook/trustcommerce
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke TrustCommerce verifier
- modules/gateways/trustcommerce/TrustCommerceGateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/trustcommerce/TrustCommerceGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 93 — modules/gateways/bitpay/BitpayGateway.php:139
High · injection · reachability: external · exploitability: moderate · CWE-20
Finding ID: 6b16af0d-b858-4f18-b22f-0dcbfb46fad6
The callback invoice identifier is inserted into a credential-bearing URL without path encoding. Query and fragment delimiters in that identifier can replace the configured merchant token with an attacker-controlled token, allowing an invoice belonging to another account to authorize local settlement.
Evidence
- Source/control: The id or session_id field in a public BitPay webhook payload or checkout status query.
- Sink/decision: curl_init receives an invoice lookup URL whose authentication query can be changed by the callback identifier.
- Missing mitigation: The invoice identifier is not confined to a single URL path segment, so lower-trust input can change the authentication query used for payment verification.
Suggested remediation: Encode the invoice identifier with rawurlencode and build the token query separately with http_build_query. Before settlement, also require the retrieved invoice to match the locally recorded payment attempt and order.
Reported call path
- config/routes/web.php:337 — public POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:89 — invokes adapter webhook gate
- modules/gateways/bitpay/BitpayGateway.php:179 — accepts the webhook trigger
- src/Controller/Webhook/UnifiedWebhookController.php:151 — invokes core callback handling
- src/Service/Payment/GatewayApiService.php:172 — verifies callback
- src/Gateway/GatewayBridge.php:122 — invokes the selected adapter
- modules/gateways/bitpay/BitpayGateway.php:139 — invoice identifier overrides request authentication
- src/Service/Payment/GatewayApiService.php:244 — completes the selected local transaction
Finding 94 — modules/gateways/przelewy24/Przelewy24Gateway.php:264
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 6841496f-66c6-4bf7-96ae-8634bf795e94
Webhook authentication always succeeds without examining the notification or credentials. The registered handler then completes a pending transaction using the caller's sessionId, allowing an unpaid transaction and its linked invoice to be marked complete.
Evidence
- Source/control: Unauthenticated POST /webhook/przelewy24 with JSON sessionId identifying a pending transaction; a matching reference can supply merchant resolution on the master domain.
- Sink/decision: Przelewy24Gateway::handleWebhook calls TransactionService::complete at line 289 without authenticated payment evidence.
- Missing mitigation: No authenticated notification or authoritative provider confirmation binds the selected pending transaction to a successful matching payment before completion.
Suggested remediation: Implement the provider's notification authentication and required transaction confirmation before calling complete. Check the merchant, local reference, provider order identifier, amount, currency, and successful payment state against stored transaction data, rejecting unverifiable notifications.
Reported call path
- config/routes/web.php:337 — POST /webhook/przelewy24
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Przelewy24 verifier
- modules/gateways/przelewy24/Przelewy24Gateway.php:264 — accept unsigned request
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/przelewy24/Przelewy24Gateway.php:289 — complete sessionId-selected payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 95 — modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:357
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-863
Finding ID: 61a839e0-acca-4455-be71-3162a5445718
Nagad verification combines successful payment evidence for a callback-selected provider reference with an independently selected local transaction. It never establishes that the provider payment belongs to that transaction, so a customer can reuse a successful payment for another same-amount checkout.
Evidence
- Source/control: The payment_ref_id query parameter supplied to the public checkout status route independently of the checkout token.
- Sink/decision: The adapter returns successful verification with the callback-derived local trx_id, and GatewayApiService completes that local transaction and posts payment receipt.
- Missing mitigation: The initiation reference is not persisted and compared during verification, and successful provider payments are not atomically restricted to their associated local transaction.
Suggested remediation: Persist the Nagad payment reference when initiating the local transaction and require that exact reference during verification. Check the provider's order and merchant identity and atomically prevent the same provider payment from settling a different transaction.
Reported call path
- config/routes/web.php:74 — public checkout status route
- src/Controller/Checkout/CheckoutController.php:833 — combines supplied payment reference with the selected checkout's trx_id
- src/Controller/Checkout/CheckoutController.php:838 — calls handleCallback
- src/Service/Payment/GatewayApiService.php:172 — invokes bridge verification
- src/Gateway/GatewayBridge.php:122 — invokes Nagad verify
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:333 — queries the supplied payment reference
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:366 — returns success without order binding
- src/Service/Payment/GatewayApiService.php:205 — selects the target local transaction
- src/Service/Payment/GatewayApiService.php:244 — completes the target transaction
- src/Service/Payment/TransactionService.php:98 — invokes repository completion
- src/Repository/TransactionRepository.php:126 — persists completed status
- src/Service/Payment/GatewayApiService.php:247 — records payment received
Finding 96 — modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:330
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: 5f0ec7e0-fa01-4e02-98a8-19fa9a219e91
Nagad sandbox verification sends its status request over HTTP and accepts the returned JSON without authenticating it. An on-path attacker can replace the response with a successful status and the expected amount, causing an unpaid transaction to be completed and credited.
Evidence
- Source/control: Attacker-modified response to the outbound sandbox payment-verification request.
- Sink/decision: curl_exec() receives the unauthenticated response; lines 359–371 convert its status and amount into successful payment verification.
- Missing mitigation: The sandbox verification response has neither authenticated transport nor a checked provider signature before it authorizes settlement.
Suggested remediation: Use an authenticated HTTPS endpoint for sandbox verification and fail closed when secure transport is unavailable. Keep sandbox results from settling real transactions, and verify provider response signatures and transaction binding where supported.
Reported call path
- config/routes/web.php:74 — public checkout status route
- src/Controller/Checkout/CheckoutController.php:838 — status calls handleCallback
- src/Service/Payment/GatewayApiService.php:172 — handleCallback calls bridge verification
- src/Gateway/GatewayBridge.php:122 — dispatches to Nagad verify
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:344 — receives unauthenticated HTTP response
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:359 — treats response status as payment success
- src/Service/Payment/GatewayApiService.php:244 — completes the transaction
- src/Service/Payment/TransactionService.php:98 — invokes repository completion
- src/Repository/TransactionRepository.php:126 — persists completed status
- src/Service/Payment/GatewayApiService.php:247 — records payment received
Finding 97 — modules/gateways/rapyd/RapydGateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 5aff8f9e-59de-41ca-b105-4a6912281ac9
Webhook authentication checks only that a signature header is nonempty, allowing callers to fabricate accepted payment notifications. The handler completes the referenced pending transaction without checking authenticated payment status or value, which can mark an unpaid invoice paid.
Evidence
- Source/control: Public POST /webhook/rapyd with an arbitrary nonempty signature header and a JSON reference identifying a pending checkout.
- Sink/decision: RapydGateway::handleWebhook calls TransactionService::complete at line 294.
- Missing mitigation: The webhook gate does not authenticate the notification using the provider's verification scheme, and the completion handler does not establish a successful payment matching stored transaction data.
Suggested remediation: Replace the signature-presence check with provider-defined authentication and reject invalid notifications before dispatch. Complete only after authenticated payment evidence matches the stored merchant, reference, provider identifier, amount, currency, and successful state.
Reported call path
- config/routes/web.php:337 — POST /webhook/rapyd
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Rapyd verifier
- modules/gateways/rapyd/RapydGateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/rapyd/RapydGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 98 — src/Controller/Admin/CurrencyController.php:86
High · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: 5aa5e397-35ed-4fd6-a92e-d2d552246060
Currency updates consume a brand operator's settings.manage permission without checking authority to change platform-wide currency data. A brand-scoped operator can consequently change shared definitions and exchange rates used by other merchants.
Brand-scoped settings permission authorizes writes to globally shared exchange rates without checking global administrative authority. A staff member confined to one brand can change conversion rates used by other brands.
Evidence
- Source/control: Currency update POST fields supplied by an authenticated brand-scoped settings manager.
- Sink/decision: CurrencyService::upsert() and updateExchangeRate() write shared op_currencies and op_exchange_rates records.
- Missing mitigation: The shared currency write path does not check current platform-wide authority before accepting a brand-scoped operator's request.
Suggested remediation: Require current authority to manage platform-wide settings and the appropriate global scope before currency updates, toggles, or forced synchronization. Keep brand-scoped settings writes limited to that brand's default currency.
Require explicit global currency-management authority before invoking currency updates, status changes, or synchronization. Enforce this on the server independently of which controls the settings page displays.
Reported call path
- config/routes/web.php:225 — POST /admin/currencies/update
- src/Middleware/PermissionMiddleware.php:229 — resolve the currency route's settings permission
- src/Middleware/PermissionMiddleware.php:258 — require settings.manage for POST
- src/Controller/Admin/CurrencyController.php:86 — upsert the shared currency definition
- src/Controller/Admin/CurrencyController.php:95 — update the supplied exchange rate
- src/Service/Payment/CurrencyService.php:269 — persist a shared exchange rate [sink]
- src/Controller/Checkout/PaymentIntentCheckoutController.php:749 — subsequent checkout converts another merchant's payment using the modified rate
- src/Controller/Checkout/PaymentIntentCheckoutController.php:774 — submit the converted amount to gateway initiation
- src/Middleware/PermissionMiddleware.php:256 — authorizes settings.manage for the endpoint
- src/Controller/Admin/CurrencyController.php:86 — updates shared currency metadata
- src/Controller/Admin/CurrencyController.php:95 — calls updateExchangeRate
- src/Service/Payment/CurrencyService.php:268 — overwrites the shared rate [sink]
- src/Controller/Checkout/PaymentIntentCheckoutController.php:557 — subsequent checkout converts using the shared rate
Finding 99 — modules/gateways/giropay/GiropayGateway.php:239
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 5a0c37fe-72f9-493f-afbc-b5db51485f62
Giropay webhook authentication always succeeds without examining the body, headers, or credentials. Its registered handler completes a pending transaction selected by the caller's purpose field without confirming payment, allowing an unpaid invoice to become paid.
Evidence
- Source/control: Unauthenticated POST /webhook/giropay containing JSON purpose identifying a pending checkout and reference carrying the same identifier for merchant resolution.
- Sink/decision: GiropayGateway::handleWebhook calls TransactionService::complete at line 264.
- Missing mitigation: No provider authentication or authoritative matching-payment check protects the direct transaction completion operation.
Suggested remediation: Reject notifications until provider-defined authentication and payment confirmation succeed. Bind the confirmed merchant, purpose, provider identifier, amount, currency, and successful status to the stored transaction before completing it.
Reported call path
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:77 — resolve merchant from supplied reference
- src/Gateway/GatewayBridge.php:162 — invoke adapter signature check
- modules/gateways/shift4/Shift4Gateway.php:261 — approve arbitrary nonempty signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch registered webhook handler
- modules/gateways/shift4/Shift4Gateway.php:294 — complete selected transaction [sink]
- src/Service/Payment/TransactionService.php:108 — emit completion effects
Finding 100 — modules/gateways/payfast/PayfastGateway.php:211
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-347
Finding ID: 4ef460cc-8ce9-47bd-837a-435df2c06218
Payfast verifies a form-decoded representation of the request but completes payments using a separately decoded JSON representation. When the optional passphrase is empty, a crafted JSON body can satisfy the form signature check without authenticating the payment fields consumed by the handler.
When the optional passphrase is empty, the webhook verifier accepts a checksum that anyone can compute. It also authenticates form-parsed values while the handler consumes JSON, allowing a crafted JSON body to pass signature verification and complete an unpaid pending transaction.
Evidence
- Source/control: An unauthenticated POST /webhook/payfast containing JSON transaction fields and an embedded form-style signature segment.
- Sink/decision: The signature comparison approves the alternate form representation; handleWebhook then reads JSON m_payment_id and calls TransactionService::complete at line 259.
- Missing mitigation: The object used for settlement is not the object authenticated by the verifier. The handler also lacks an authoritative successful-payment and expected-amount check before completion.
Suggested remediation: Parse the supported Payfast notification format once and pass the verified data to the handler, rejecting alternate representations. Require provider validation and successful payment evidence matching the stored merchant, transaction, amount, and currency before completion.
Fail closed when a webhook passphrase is missing, or independently confirm the payment with Payfast before completing it. Parse and validate one supported payload format consistently in both verification and handling so the authenticated fields are exactly those consumed.
Reported call path
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:89 — verifyWebhookSignature()
- src/Gateway/GatewayBridge.php:162 — adapter verifyWebhook()
- modules/gateways/payfast/PayfastGateway.php:211 — authenticate form representation
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch registered webhook action
- modules/gateways/payfast/PayfastGateway.php:243 — consume JSON representation
- modules/gateways/payfast/PayfastGateway.php:259 — complete payment
- src/Service/Payment/TransactionService.php:98 — markCompletedIfNotTerminal()
Scan details: findings 101–120
Reported by CodeRabbit; these claims and recommendations have not been independently verified.
Finding 101 — modules/gateways/bluesnap/BlueSnapGateway.php:244
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: 4d2cc4c9-d57a-4583-83cc-34a09b82f836
The webhook verifier accepts any nonempty Authorization header without authenticating its value or the notification. The custom handler then completes the caller-selected pending transaction without confirming payment with BlueSnap.
Evidence
- Source/control: POST /webhook/bluesnap with an arbitrary nonempty Authorization header and a known pending transaction reference in the JSON body.
- Sink/decision: The permissive authentication result allows handleWebhook to call TransactionService::complete at line 294.
- Missing mitigation: The application does not authenticate the supplied header or verify provider payment state before completing the transaction.
Suggested remediation: Implement BlueSnap's supported notification authentication and reject invalid credentials. Confirm successful payment and the expected transaction binding, amount, and currency before completion.
Reported call path
- config/routes/web.php:337 — public webhook route
- src/Controller/Webhook/UnifiedWebhookController.php:89 — invokes signature gate
- src/Gateway/GatewayBridge.php:162 — calls BlueSnap verifier
- modules/gateways/bluesnap/BlueSnapGateway.php:261 — accepts arbitrary nonempty Authorization
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatches registered handler
- modules/gateways/bluesnap/BlueSnapGateway.php:294 — completes unpaid transaction
- src/Service/Payment/TransactionService.php:108 — emits completion event
- src/Service/Payment/PaymentCompletionListener.php:67 — marks linked invoice paid
Finding 102 — modules/gateways/paytabs/PayTabsGateway.php:182
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 4cb99d79-ef02-40e0-bbf1-0bf37177a62b
PayTabs returns successful verification for a simulated or missing provider identifier whenever its effective credential mode is not live. It also treats the callback's amount as verified payment evidence, allowing an unpaid checkout to become completed and credit the merchant ledger even in production.
Evidence
- Source/control: Unauthenticated GET /checkout/{token}/status query parameters, including a nonempty paymentID, a SIM_-prefixed gateway_trx_id, and an amount matching the checkout's expected payment amount.
- Sink/decision: PayTabsGateway::verify returns success and completed status without provider confirmation at lines 182-187. GatewayApiService subsequently completes the transaction and records payment-received ledger entries.
- Missing mitigation: The simulated-success branch does not check the application environment before allowing ordinary payment completion. Its output contains no authoritative evidence that the expected payment occurred.
Suggested remediation: Reject simulated verification in production before returning success, using the existing production-environment helper. Keep simulated transactions separate from ordinary payment records and ledger balances, and require provider-confirmed payment details before completing ordinary payments.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:838 — handle caller-supplied callback query
- src/Service/Payment/GatewayApiService.php:172 — request provider verification
- src/Gateway/GatewayBridge.php:122 — invoke PayTabsGateway::verify
- modules/gateways/paytabs/PayTabsGateway.php:182 — return fabricated payment success
- src/Service/Payment/GatewayApiService.php:244 — complete transaction
- src/Service/Payment/GatewayApiService.php:247 — post received payment
- src/Service/Payment/LedgerService.php:163 — credit merchant payable balance
Finding 103 — modules/gateways/binance-personal/BinancePersonalGateway.php:253
High · broken_auth · reachability: external · exploitability: moderate · CWE-345
Finding ID: 483f233b-cbdc-4fca-b649-4ecd831d0684
The blockchain verifier accepts recipient information and successful execution as sufficient payment proof, then returns the caller's declared amount. A successful zero-value or dust transaction can consequently authorize settlement for a substantially larger order.
Evidence
- Source/control: Attacker-controlled txhash, amount, trx_id, and reference fields submitted to POST /webhook/binance-personal.
- Sink/decision: The API-backed branch returns payment success and an amount that was never established from the blockchain transaction.
- Missing mitigation: The successful verification decision does not bind authoritative transferred value and an accepted asset to the checkout's payment requirements.
Suggested remediation: Derive the received amount from native transaction value or validated transfer events for an explicitly accepted asset and recipient. Compare it with the stored payment requirements before returning success, and return the authoritative amount rather than the callback claim.
Reported call path
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:89 — request adapter webhook verification
- modules/gateways/binance-personal/BinancePersonalGateway.php:266 — accept the webhook
- src/Controller/Webhook/UnifiedWebhookController.php:151 — invoke core callback handling
- src/Service/Payment/GatewayApiService.php:172 — invoke adapter payment verification
- src/Gateway/GatewayBridge.php:122 — dispatch to Binance Personal
- modules/gateways/binance-personal/BinancePersonalGateway.php:229 — match recipient text
- modules/gateways/binance-personal/BinancePersonalGateway.php:253 — accept receipt success without transferred-value verification
- src/Service/Payment/GatewayApiService.php:231 — compare the echoed claim with the stored amount
- src/Service/Payment/GatewayApiService.php:244 — complete the unpaid order
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Finding 104 — src/Controller/Admin/DashboardController.php:548
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-620
Finding ID: 46cfba1c-94bc-4936-a886-21d599d17763
The profile action changes the password-recovery email using session authority alone. Temporary access to an authenticated session can therefore bypass the current-password requirement for password replacement by redirecting recovery to an attacker-controlled mailbox.
Evidence
- Source/control: A replacement email submitted with type=profile using the victim's authenticated session.
- Sink/decision: updateProfile() immediately replaces the email trusted by password recovery, allowing a reset credential to authorize a new password.
- Missing mitigation: The recovery identity can change without fresh authentication or approval through a previously trusted recovery channel.
Suggested remediation: Require the current password or equivalent fresh authentication before changing the recovery email. Keep the existing recovery address authoritative until the change has been securely approved.
Reported call path
- config/routes/web.php:292 — POST account update
- src/Controller/Admin/DashboardController.php:529 — profile branch
- src/Controller/Admin/DashboardController.php:548 — replaces recovery email
- src/Controller/Admin/AuthController.php:296 — requests recovery for the replacement address
- src/Service/Auth/PasswordResetService.php:85 — sends reset credential to attacker mailbox
- src/Controller/Admin/AuthController.php:343 — submits received reset token
- src/Service/Auth/PasswordResetService.php:144 — replaces account password
Finding 105 — modules/gateways/authorize-net/AuthorizeNetGateway.php:197
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 434b7862-ce48-4689-b811-8549c70e0e68
In non-live mode, an absent or SIM_-prefixed gateway transaction identifier produces successful verification using the caller's amount. The branch omits the production guard and can complete real transactions without provider-confirmed payment.
Evidence
- Source/control: Customer-controlled gateway_trx_id and amount query parameters, with a nonempty paymentID to trigger checkout status callback handling.
- Sink/decision: The simulated verification result grants success and returns the callback amount without querying Authorize.Net.
- Missing mitigation: The simulated success branch does not enforce production isolation before accepting unauthenticated payment claims.
Suggested remediation: Reject simulated verification in production before returning success, including when the gateway transaction identifier is absent. Require provider-confirmed payment before completing production transactions.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:809 — enter callback processing for the checkout
- src/Controller/Checkout/CheckoutController.php:838 — invoke callback handling with supplied query fields
- src/Service/Payment/GatewayApiService.php:172 — invoke gateway verification
- src/Gateway/GatewayBridge.php:122 — invoke Authorize.Net verification
- modules/gateways/authorize-net/AuthorizeNetGateway.php:197 — select simulated acceptance
- modules/gateways/authorize-net/AuthorizeNetGateway.php:209 — return the claimed amount as verified
- src/Service/Payment/GatewayApiService.php:244 — complete the unpaid order
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Finding 106 — modules/gateways/shift4/Shift4Gateway.php:261
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 3e8cb3bd-0565-4c6a-8c67-53a49cc3aa39
Shift4 webhook authentication accepts any nonempty signature header without checking authenticity. The handler then completes the referenced pending transaction without confirming a successful matching payment, which can mark an unpaid invoice paid.
Evidence
- Source/control: Public POST /webhook/shift4 with an arbitrary nonempty Shift4-Signature header and JSON reference identifying a pending checkout.
- Sink/decision: Shift4Gateway::handleWebhook calls TransactionService::complete at line 294.
- Missing mitigation: The webhook authentication decision does not verify the provider's signature, and completion lacks authenticated successful-payment evidence bound to stored transaction data.
Suggested remediation: Implement provider-defined signature verification using the configured webhook secret and reject invalid notifications before dispatch. Require a successful payment matching the stored merchant, reference, provider identifier, amount, and currency before calling complete.
Reported call path
- config/routes/web.php:337 — POST /webhook/shift4
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Shift4 verifier
- modules/gateways/shift4/Shift4Gateway.php:261 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/shift4/Shift4Gateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 107 — modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:292
Low · security_misconfiguration · reachability: external · exploitability: difficult · CWE-319
Finding ID: 3c09e6fb-a657-477c-bc98-746135e1fc7a
The supported Nagad sandbox uses HTTP, and the adapter trusts the final response's callBackUrl as a browser destination without authenticating that response. An attacker intercepting the server-to-sandbox connection can replace the payment handoff with an attacker-controlled destination.
Evidence
- Source/control: The complete-payment HTTP response received from the Nagad sandbox, modifiable by an attacker on that network path.
- Sink/decision: The unverified callBackUrl is returned as redirect_url and consumed by an HTTP redirect or window.location.href.
- Missing mitigation: The final handoff response has no authenticated transport or verified response signature before its destination is trusted. The returned destination also has no provider-origin restriction.
Suggested remediation: Use an authenticated HTTPS sandbox endpoint and reject sandbox initiation if authenticated transport is unavailable. Restrict returned handoff URLs to documented provider HTTPS origins before forwarding them to the browser.
Reported call path
- src/Controller/Checkout/PaymentIntentCheckoutController.php:774 — initiate selected gateway
- src/Service/Payment/GatewayApiService.php:120 — call gateway bridge
- src/Gateway/GatewayBridge.php:101 — invoke adapter
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:142 — select HTTP sandbox base URL
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:279 — receive unauthenticated response
- modules/gateways/nagad-merchant-api/NagadMerchantApiGateway.php:304 — return response-selected destination
- public/assets/js/checkout.js:223 — navigate browser
Finding 108 — modules/gateways/xendit/XenditGateway.php:245
Medium · other · reachability: external · exploitability: difficult
Finding ID: 3abb123f-dbb2-4857-bb41-81100645c6c8
The Xendit webhook handler treats a matching invoice reference as sufficient evidence of payment. When optional expiry notifications are enabled, an authentic notification for an unpaid expired invoice can complete its pending local transaction.
Evidence
- Source/control: A genuine Xendit EXPIRED notification carrying the unpaid invoice's external_id and id.
- Sink/decision: TransactionService::complete at XenditGateway.php:251 changes the local transaction to completed and triggers linked-invoice payment.
- Missing mitigation: The authenticated webhook path does not distinguish successful payment from invoice expiry before invoking completion, and it does not validate paid amount or currency.
Suggested remediation: Complete transactions only for authenticated successful-payment events whose provider identity, local reference, paid amount, and currency match the expected transaction. Process EXPIRED events without invoking payment completion.
Reported call path
- config/routes/web.php:337 — POST /webhook/{gateway}
- src/Controller/Webhook/UnifiedWebhookController.php:89 — verify webhook authenticity
- src/Gateway/GatewayBridge.php:162 — XenditGateway::verifyWebhook()
- modules/gateways/xendit/XenditGateway.php:226 — accept valid provider callback token
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch webhook.incoming.xendit
- modules/gateways/xendit/XenditGateway.php:245 — check only local pending state
- modules/gateways/xendit/XenditGateway.php:251 — complete unpaid transaction
- src/Service/Payment/TransactionService.php:108 — emit payment.transaction.completed
- src/Service/Payment/PaymentCompletionListener.php:67 — mark associated invoice paid
Finding 109 — src/Service/Payment/GatewayApiService.php:244
Medium · authorization_bypass · reachability: external · exploitability: difficult
Finding ID: 3506d32d-4bb7-432c-951b-fdb0a78f678f
The callback handler completes the checkout selected by callback data without checking that EPS verified payment for that same checkout. A valid payment reference for another order can therefore authorize completion and ledger credit for an unpaid order with the same amount.
Callback processing selects the local transaction from untrusted callback fields before considering the provider-authenticated reference, and never requires those identities to match. One successful provider payment can consequently authorize completion and accounting credit for additional equal-value local transactions.
The callback service selects the local transaction from outer callback fields before considering the provider-verified transaction reference. A customer can therefore reuse a genuinely paid session to complete another equal-amount checkout, violating the requirement that each completed purchase have its own corresponding payment.
Evidence
- Source/control: MerchantTransactionId and Status query parameters supplied to GET /checkout/{token}/status. CheckoutController forwards them while setting trx_id to the checkout identified by the route token.
- Sink/decision: TransactionService::complete() and LedgerService::recordPaymentReceived() consume the selected transaction without binding it to the provider-confirmed order reference.
- Missing mitigation: The handler does not require the provider-confirmed order reference to match the checkout being completed. Its state guard prevents repeated completion of one local transaction, but does not prevent applying another order's payment to it.
Suggested remediation: Before completing an EPS checkout, require a nonempty provider-confirmed ValueA that matches the selected local transaction, and bind the provider transaction identifier to that payment attempt. Store that identifier atomically with completion and reject its reuse for another transaction; changing rand() alone will not fix this flaw.
Persist the provider session or payment association during initiation and require verification to match that transaction before completion. Atomically enforce unique consumption of the provider payment within its gateway and merchant account scope.
Persist the provider payment attempt against its initiating transaction and reject callbacks whose verified identity conflicts with that binding. Atomically enforce a unique association between each provider payment and its local transaction within the applicable provider account.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:838 — status() forwards the selected transaction and supplied provider identifier
- src/Service/Payment/GatewayApiService.php:172 — handleCallback() invokes adapter verification
- src/Gateway/GatewayBridge.php:122 — verify() invokes StripeGateway::verify()
- modules/gateways/stripe/StripeGateway.php:253 — verify() returns the paid session's original reference
- src/Service/Payment/GatewayApiService.php:178 — handleCallback() selects the callback reference instead
- src/Service/Payment/GatewayApiService.php:244 — completes the selected transaction [sink]
- src/Service/Payment/GatewayApiService.php:247 — records its payment ledger credit [sink]
- config/routes/web.php:81 — public intent status route
- src/Controller/Checkout/PaymentIntentCheckoutController.php:908 — combine supplied session data with target trx_id
- src/Controller/Checkout/PaymentIntentCheckoutController.php:916 — invoke handleCallback
- src/Gateway/GatewayBridge.php:122 — invoke adapter verification
- modules/gateways/stripe/StripeGateway.php:220 — retrieve supplied Stripe session
- src/Service/Payment/GatewayApiService.php:178 — prefer target reference over verified identity
- src/Service/Payment/GatewayApiService.php:244 — complete target transaction
- src/Service/Payment/GatewayApiService.php:247 — record payment credit
Finding 110 — modules/gateways/przelewy24/Przelewy24Gateway.php:188
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 2f347e1b-5b75-48e5-9445-ce0e98b5ba4a
The non-live simulation branch treats a caller-chosen SIM_ identifier and amount as authenticated payment evidence. It omits the production-environment restriction, allowing forged callbacks to complete ordinary transactions and credit merchant accounting.
Evidence
- Source/control: Public GET /checkout/{token}/status query parameters, including paymentID, reference, gateway_trx_id, and amount.
- Sink/decision: Przelewy24Gateway::verify returns successful verification without provider confirmation; GatewayApiService subsequently completes the transaction and records payment received.
- Missing mitigation: The simulation branch does not prevent fabricated verification results from reaching production transaction completion and accounting.
Suggested remediation: Reject simulated verification in production regardless of gateway mode. Keep simulation transactions isolated from ordinary accounting and require provider-confirmed payment evidence for ordinary completion.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:838 — process callback query
- src/Service/Payment/GatewayApiService.php:172 — request provider verification
- src/Gateway/GatewayBridge.php:122 — invoke Przelewy24Gateway::verify
- modules/gateways/przelewy24/Przelewy24Gateway.php:188 — return fabricated payment success
- src/Service/Payment/GatewayApiService.php:244 — complete transaction
- src/Service/Payment/GatewayApiService.php:247 — post received payment
- src/Service/Payment/LedgerService.php:163 — credit merchant payable balance
Finding 111 — modules/gateways/neteller/NetellerGateway.php:261
High · broken_auth · reachability: external · exploitability: trivial · CWE-287
Finding ID: 2ba4a8a9-66fe-4e1e-8b00-7520831101d2
Neteller treats the presence of an Authorization header as proof that a webhook is authentic. An attacker can supply an arbitrary header and a pending transaction reference, causing the handler to mark an unpaid transaction complete and its linked invoice paid.
Evidence
- Source/control: An unauthenticated POST /webhook/neteller with any nonempty Authorization header and JSON reference.
- Sink/decision: NetellerGateway::handleWebhook calls TransactionService::complete at line 294 without authoritative payment verification.
- Missing mitigation: The Authorization value is never validated against trusted credentials, and no authenticated payment status or expected amount is checked before completion.
Suggested remediation: Validate notifications using Neteller's supported authentication mechanism and reject invalid requests. Before completion, require authoritative successful payment evidence bound to the stored merchant, transaction, amount, currency, and provider identifier.
Reported call path
- config/routes/web.php:337 — POST /webhook/neteller
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke Neteller verifier
- modules/gateways/neteller/NetellerGateway.php:261 — accept arbitrary Authorization
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch registered handler
- modules/gateways/neteller/NetellerGateway.php:294 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completed status
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 112 — src/Controller/Admin/AdminPageTrait.php:259
Medium · authorization_bypass · reachability: external · exploitability: moderate · CWE-862
Finding ID: 26bf4bc6-e178-49b2-9f89-a002a3db42d6
The shared admin renderer retrieves and displays transaction and dispute notifications without enforcing their respective read permissions. Staff allowed to view their account page can therefore receive payment details that the dedicated feature routes deny them.
Evidence
- Source/control: An active authenticated staff member with admin.access requests GET /admin/my-account while lacking transactions.view or disputes.view.
- Sink/decision: The unchecked transaction query at line 266 and dispute query at line 285 supply amounts, sender accounts, gateways, statuses, and dispute reasons to the shared notification panel.
- Missing mitigation: The notification helper does not apply transactions.view to payment notifications or disputes.view to dispute notifications before exposing their details.
Suggested remediation: Check the current user's relevant read permission before querying each notification category. Omit unauthorized categories from both the notification data and rendered response.
Reported call path
- config/routes/web.php:291 — GET /admin/my-account
- src/Middleware/PermissionMiddleware.php:230 — selects admin.access
- src/Middleware/PermissionMiddleware.php:140 — enforces the selected page permission
- src/Controller/Admin/DashboardController.php:500 — myAccount() calls renderAdminPage()
- src/Controller/Admin/AdminPageTrait.php:70 — unconditionally calls resolveNotificationsBell()
- src/Controller/Admin/AdminPageTrait.php:259 — queries protected transaction details
- templates/admin/layout/base.twig:30 — includes the notification panel
- templates/admin/layout/notification_panel.twig:23 — renders the payment details
Finding 113 — modules/gateways/blik/BlikGateway.php:308
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: 15a86a22-7f92-4ea2-9bbd-965b2880d518
The webhook verifier always returns true. Its registered handler then treats caller-supplied transaction identifiers as payment confirmation and completes an unpaid pending transaction.
Evidence
- Source/control: Unauthenticated JSON sent to POST /webhook/blik, with sessionId and reference identifying the same known pending transaction and an arbitrary orderId.
- Sink/decision: The unconditional authentication decision permits handleWebhook to call TransactionService::complete at line 335.
- Missing mitigation: No notification authentication or authenticated provider payment confirmation occurs before transaction completion.
Suggested remediation: Reject notifications that cannot be authenticated using the provider's supported mechanism. Before completing payment, verify successful provider state and its binding to the local transaction, amount, and currency.
Reported call path
- config/routes/web.php:337 — public webhook route
- src/Controller/Webhook/UnifiedWebhookController.php:89 — invokes signature verification
- src/Gateway/GatewayBridge.php:162 — invokes BLIK webhook verifier
- modules/gateways/blik/BlikGateway.php:310 — returns true unconditionally
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatches plugin handler
- modules/gateways/blik/BlikGateway.php:335 — completes selected pending transaction
- src/Service/Payment/TransactionService.php:108 — emits completion event
- src/Service/Payment/PaymentCompletionListener.php:67 — marks linked invoice paid
Finding 114 — modules/gateways/nmi/NmiGateway.php:260
High · broken_auth · reachability: external · exploitability: trivial · CWE-347
Finding ID: 10b7e4bf-e37d-4a9a-89ed-2f5fb7681136
NMI accepts an arbitrary nonempty signature header as an authentic webhook. Its handler then completes the attacker-selected pending transaction without proving payment, allowing an unpaid linked invoice to become paid.
Evidence
- Source/control: An unauthenticated POST /webhook/nmi with an arbitrary nonempty X-NMI-Signature and a JSON transaction reference.
- Sink/decision: NmiGateway::handleWebhook invokes TransactionService::complete at line 293.
- Missing mitigation: The signature value and notification body are never cryptographically verified, and no authoritative payment check protects completion.
Suggested remediation: Implement NMI's supported notification authentication and reject unverifiable requests. Complete transactions only after successful payment evidence matches the stored merchant, reference, provider identifier, amount, and currency.
Reported call path
- config/routes/web.php:337 — POST /webhook/nmi
- src/Controller/Webhook/UnifiedWebhookController.php:89 — authenticate notification
- src/Gateway/GatewayBridge.php:162 — invoke NMI verifier
- modules/gateways/nmi/NmiGateway.php:260 — accept arbitrary signature
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatch handler
- modules/gateways/nmi/NmiGateway.php:293 — complete payment
- src/Service/Payment/TransactionService.php:98 — persist completion
- src/Service/Payment/PaymentCompletionListener.php:67 — mark invoice paid
Finding 115 — modules/gateways/tap/TapGateway.php:193
Medium · authorization_bypass · reachability: external · exploitability: difficult · CWE-841
Finding ID: 0e99a9ff-9645-4471-bd41-5c14e10ef378
Tap issues signed simulated payment evidence after a failed initiation request in non-live mode and accepts that evidence without checking the application environment. In production, a customer can use the returned simulation to complete an unpaid transaction and create payment-received ledger entries.
Evidence
- Source/control: A customer receives the server-generated simulation redirect after a non-200 response or transport failure, then submits its fields to their checkout status endpoint with a nonempty paymentID or payment_id.
- Sink/decision: TapGateway::verify() returns success and completed status based on the simulation signature, bypassing the provider verification request.
- Missing mitigation: Neither simulation generation nor acceptance enforces the production-environment restriction before simulated evidence enters the ordinary payment completion flow.
Suggested remediation: Apply the production-environment guard before generating and accepting simulations. In production, return an initiation failure when the provider fails, and reserve simulated completions for isolated test transactions.
Reported call path
- src/Controller/Checkout/CheckoutController.php:636 — initiate the customer's checkout
- src/Service/Payment/GatewayApiService.php:120 — call GatewayBridge::initiate
- src/Gateway/GatewayBridge.php:101 — dispatch to TapGateway::initiate
- modules/gateways/tap/TapGateway.php:140 — return a signed successful simulation after provider failure
- src/Controller/Checkout/CheckoutController.php:833 — accept the returned simulation fields in a status query
- src/Service/Payment/GatewayApiService.php:172 — verify the callback through GatewayBridge
- src/Gateway/GatewayBridge.php:122 — dispatch to TapGateway::verify
- modules/gateways/tap/TapGateway.php:203 — validate the server-issued simulation signature and return success
- src/Service/Payment/GatewayApiService.php:244 — complete the transaction
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Finding 116 — modules/gateways/checkout-com/CheckoutComGateway.php:282
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-345
Finding ID: 08c7434d-3bf7-4a6f-bcde-38924b23bbbb
The webhook verifier accepts an arbitrary nonempty signature when its authentication secret is absent. Because activation can enable the plugin before credentials exist, an unauthenticated notification can reach the custom handler and complete an unpaid pending transaction.
Evidence
- Source/control: POST /webhook/checkout-com with an arbitrary nonempty Cko-Signature and a JSON reference identifying a known pending transaction.
- Sink/decision: The empty-secret authentication bypass permits handleWebhook to call TransactionService::complete at line 321.
- Missing mitigation: The webhook authentication decision does not fail closed when the required secret is missing, and activation does not prevent that exposed state.
Suggested remediation: Reject webhook requests whenever the secret is empty, and prevent activation of payment notifications until required credentials are configured. Complete transactions only after authenticating successful payment and checking the expected transaction details.
Reported call path
- src/Plugin/PluginManager.php:275 — active configuration can lack credentials
- config/routes/web.php:337 — public webhook route
- src/Controller/Webhook/UnifiedWebhookController.php:89 — requests signature verification
- src/Gateway/GatewayBridge.php:161 — resolves absent credentials
- modules/gateways/checkout-com/CheckoutComGateway.php:284 — accepts an arbitrary signature without a secret
- src/Controller/Webhook/UnifiedWebhookController.php:130 — dispatches custom handler
- modules/gateways/checkout-com/CheckoutComGateway.php:321 — completes the pending transaction
- src/Service/Payment/TransactionService.php:108 — emits completion event
- src/Service/Payment/PaymentCompletionListener.php:67 — marks invoice paid
Finding 117 — modules/gateways/airtel-money/AirtelMoneyGateway.php:85
Medium · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-200
Finding ID: 6c0ecdd8-0985-47f0-bb74-c8f2637018a0
The Airtel adapter copies an access token obtained using the merchant's client credentials into the shopper-facing redirect URL. This exposes an application authentication credential to a shopper who is authorized only to initiate their checkout.
Evidence
- Source/control: The access_token returned by the configured Airtel endpoint for a client_credentials grant using the merchant's client_id and client_secret.
- Sink/decision: The redirect_url returned by AirtelMoneyGateway::initiate includes the application token and is subsequently returned to the shopper.
- Missing mitigation: The adapter does not keep the merchant's application access token within server-side provider communication. It returns that private token where a payment-specific public checkout reference should be used.
Suggested remediation: Keep the application token server-side and use it only for authenticated provider requests. Return the provider's intended customer checkout URL or a payment-specific reference that does not grant application-level authority.
Reported call path
- config/routes/web.php:71 — POST /checkout/{token}/pay
- src/Controller/Checkout/CheckoutController.php:636 — initiate selected gateway
- src/Service/Payment/GatewayApiService.php:120 — invoke GatewayBridge::initiate
- src/Gateway/GatewayBridge.php:101 — invoke AirtelMoneyGateway::initiate with merchant credentials
- modules/gateways/airtel-money/AirtelMoneyGateway.php:76 — execute client-credentials token exchange
- modules/gateways/airtel-money/AirtelMoneyGateway.php:85 — place access token in redirect URL
- src/Controller/Checkout/CheckoutController.php:648 — return URL in AJAX response
- src/Controller/Checkout/CheckoutController.php:653 — alternatively return HTTP redirect
Finding 118 — modules/gateways/apple-pay/ApplePayGateway.php:180
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 53e0207f-b736-4158-9879-c76e20f7ac6c
In non-live gateway mode, an arbitrary APAY_MOCK_ identifier produces successful verification with the caller's declared amount. This branch omits the production guard, allowing simulated proof to authorize real transaction completion.
Evidence
- Source/control: Customer-controlled paymentID and amount query parameters on GET /checkout/{token}/status.
- Sink/decision: The mock branch returns successful verification and the callback amount without authenticating a provider payment.
- Missing mitigation: The mock verification branch does not reject production environments before granting successful payment verification.
Suggested remediation: Check isProductionEnv() before accepting mock identifiers and reject them in production regardless of gateway mode. Keep simulated payments isolated from real transaction completion and ledger posting.
Reported call path
- config/routes/web.php:74 — GET /checkout/{token}/status
- src/Controller/Checkout/CheckoutController.php:809 — accept a payment identifier for a processing checkout
- src/Controller/Checkout/CheckoutController.php:838 — invoke callback handling
- src/Service/Payment/GatewayApiService.php:172 — invoke gateway verification
- src/Gateway/GatewayBridge.php:122 — invoke Apple Pay verification
- modules/gateways/apple-pay/ApplePayGateway.php:180 — select mock acceptance
- modules/gateways/apple-pay/ApplePayGateway.php:194 — return the attacker's claimed amount
- src/Service/Payment/GatewayApiService.php:244 — complete the unpaid order
- src/Service/Payment/GatewayApiService.php:247 — record payment received
Finding 119 — modules/gateways/alipay/AlipayGateway.php:63
Medium · sensitive_data_exposure · reachability: external · exploitability: difficult · CWE-200
Finding ID: 389d60c3-3b78-4863-95fc-056909aae8a9
The Alipay private signing key is declared as an ordinary textarea, so the settings renderer includes its decrypted stored value in the page. Staff allowed to view plugin settings can therefore obtain a signing credential even without settings-management permission, including an inherited global credential when that fallback applies.
Evidence
- Source/control: Private-key credentials loaded and decrypted by PluginController::readGatewayCredentials for the active brand, including GatewayConfigRepository's global fallback.
- Sink/decision: SettingsRenderer::textarea includes the escaped but readable private key in the settings HTML at line 167.
- Missing mitigation: The private-key field does not use the renderer's secret-value suppression. Its textarea type also excludes it from the existing password-field handling that preserves stored secrets on blank submission.
Suggested remediation: Declare the private key as a secret field that renders blank and preserves its stored value when submitted blank, using the existing password-field handling or an equivalent multiline secret control. Keep inherited global secrets out of brand settings responses as well.
Reported call path
- config/routes/web.php:307 — GET /admin/plugins/{slug}/settings
- src/Middleware/PermissionMiddleware.php:256 — authorize GET using plugins.view
- src/Controller/Admin/PluginController.php:522 — read active brand's gateway credentials
- src/Controller/Admin/PluginController.php:766 — select brand or inherited global configuration
- src/Controller/Admin/PluginController.php:778 — decrypt credentials
- src/Controller/Admin/PluginController.php:533 — render full credential values
- src/View/SettingsRenderer.php:78 — dispatch private_key to textarea rendering
- src/View/SettingsRenderer.php:167 — insert private key into HTML
- templates/admin/plugins/settings.twig:36 — emit settings HTML
Finding 120 — modules/addons/telegram-bot/Plugin.php:752
Medium · broken_auth · reachability: external · exploitability: difficult · CWE-287
Finding ID: 0f84f504-ae57-44a3-a0f9-3ad9875a6c9b
The Telegram webhook trusts a chat ID supplied in unauthenticated request JSON. An attacker who supplies the configured ID can invoke administrative actions, including refunding an eligible transaction using its merchant's stored gateway credentials. Missing chat configuration also permits an omitted chat ID to pass the empty-string comparison.
Evidence
- Source/control: Unauthenticated POST /plugins/telegram-bot/webhook JSON, particularly callback_query.message.chat.id and callback_query.data.
- Sink/decision: executeTransactionRefund calls RefundService::create with authority derived from the attacker-selected transaction.
- Missing mitigation: The handler does not verify Telegram delivery before trusting command or callback identity. The refund action consequently receives no authenticated administrative principal.
Suggested remediation: Register a high-entropy Telegram secret_token and verify the X-Telegram-Bot-Api-Secret-Token header with a constant-time comparison before processing any update. Reject missing required configuration and retain chat and operator authorization after delivery authentication.
Reported call path
- modules/addons/telegram-bot/manifest.json:23 — POST /plugins/telegram-bot/webhook
- src/Http/Router.php:231 — selects api-public middleware; dispatch invokes the loaded plugin
- modules/addons/telegram-bot/Plugin.php:145 — handleWebhook parses the untrusted update
- modules/addons/telegram-bot/Plugin.php:172 — accepts the attacker-supplied configured chat ID
- modules/addons/telegram-bot/Plugin.php:178 — dispatches /createinvoice to cmdCreateInvoice
- modules/addons/telegram-bot/Plugin.php:476 — calls CustomerPiiService::create
- src/Service/Customer/CustomerPiiService.php:82 — createScoped persists the unauthorized customer
- modules/addons/telegram-bot/Plugin.php:487 — InvoiceService::create persists the associated draft invoice
- modules/addons/telegram-bot/Plugin.php:158 — alternate callback branch invokes handleCallbackQuery
- modules/addons/telegram-bot/Plugin.php:220 — applies the same forgeable chat-ID check
- modules/addons/telegram-bot/Plugin.php:283 — dispatches txn_refund to executeTransactionRefund
- modules/addons/telegram-bot/Plugin.php:752 — calls RefundService::create for the selected transaction
- src/Service/Payment/RefundService.php:209 — invokes GatewayBridge::refund
- src/Gateway/GatewayBridge.php:140 — invokes the adapter with merchant credentials
- modules/gateways/stripe/StripeGateway.php:339 — sends the privileged refund request
Enrichment: duplicates, validation, triage plan
Baseline caveat first. The scan targets main at 96aaa12, but development happens on dev, which has diverged: dev is 401 commits ahead of main (and 74 behind), and the seven most recently merged PRs all target dev. Several findings here are already fixed on dev and only remain on main, so the real backlog against dev is smaller than 120.
Confirmed duplicates (fixed on dev, still present on main)
- Finding 13 (High · TOTP secret sent to
api.qrserver.com) duplicates #274. The fix merged todevin PR #520 (2026-08-13):devrenders an inlineqr_data_uri({% if qr_data_uri %}…<img src="{{ qr_data_uri }}">), whilemainstill calls the third-party service attemplates/admin/my-account-2fa.twig:44. #274 is closed asFixed; againstmainthe leak is live. - Findings 11 and 22 (High · checkout persists its merchant into the admin tenant-selection session field), plus 39, 54, 74, 86 as downstream effects, duplicate the BRD-2 audit findings #238 / #395 / #396. On
dev,PermissionMiddlewarenow assertsactive_brand_id === auth_merchant_idfor non-superadmins and resets mismatches (the #238 fix from PR #520). Onmainthat guard does not exist, andBrandContext::resolveFromRequest()accepts the session value after an existence check only — e.g.ApiKeyController::generateandDeveloperControllerderive$midstraight from that context.
Related issues (context, not duplicates)
- #681 (same-day umbrella report, already has an implementation plan) overlaps this scan at Finding 6 (blacklist SVG sanitiser ≈ #681 S2), Finding 2 (stale global-view permission ≈ #681 S6), and the gateway-webhook findings against #681 S5 (the unwired
RequestSignatureMiddlewaredecision). - #656 covers the ledger/gateway-stub architectural issues that frame the gateway findings below.
Spot-validation of the remaining Highs
The report states no reproduction was performed, so I checked the code for these:
- Gateway webhook/payment verification — 93, 95, 103, 111, 114: confirmed real.
NmiGateway::verifyWebhook()returnstruefor any nonemptyX-NMI-Signature(comment: "timing-safe validation check simulation") andhandleWebhook()then completes a pending transaction by reference; Neteller (#111) does the same on mere header presence. Nagad (#95) and Binance Personal (#103) never bind provider evidence to the local transaction/amount, and Bitpay (#93) interpolates the callback id and API token into the request URL unvalidated. These sit alongside the ~35 Medium gateway findings (75–120), which are mostly the same per-adapter pattern. - 72 (manual SMS match completes a payment without requiring a linked valid SMS) and 98 (currency updates gated only by
settings.manage, no global-scope check) are consistent with their call paths; 4 (language upload) is the same class. - 39 / 54 / 74 / 86 are not independent defects — they are the BrandContext session-selection root cause surfacing in payment-link, plugin, API-key, and developer pages.
Implementation plan
- Re-baseline: re-run the scan against
dev(or syncmain↔dev) and drop findings that no longer reproduce before doing any work againstmain. - Workstream A — session-based tenant selection (6 Highs): mostly landed on
devvia PR #520; verify remaining coverage for Finding 2 (stalebrand_view_modesurvivesbrands.access_allrevocation) and carry the guard over when the branches converge. - Workstream B — gateway webhook verification (5 Highs + ~35 Mediums): make each adapter's
verifyWebhook()validate the provider credential and bind merchant, reference, amount, and currency beforeTransactionService::complete(); settle the #681 S5RequestSignatureMiddlewarequestion once for the whole route group instead of adapter by adapter; remove all "header presence = valid" returns (NMI, Neteller, and siblings). - Workstream C — platform-wide mutations (98, 4, related Mediums): extend the
PermissionMiddlewareglobal-only prefix list so brand-scopedsettings.managecannot rewrite shared currency and language state. - Finding 72: require a linked, verified SMS row before manual match may complete a transaction.
- Backlog the 39 Lows (CRLF log forging 7/12/33, file-queue DoS 19, flatten DoS 20, test-only tmpdir 16, …): validate each before fixing, since the scan reproduced nothing.
No code changes made; nothing closed or labeled.

mimo-v2.6-flash-free (free) | 𝕏