CVE Watchtower

CVE-2026-65961invoiceplane/invoiceplane >= 1.6.2, Insufficient Verification of Data Authenticity

NVD

Vulnerability Summary

Summary The guest PayPal payment endpoint `guest/gateways/paypal/paypal_capture_payment/{order_id}` records a payment using the `amount.value` and `invoice_id` taken directly from the PayPal capture response, without validating the payment currency against the store's configured PayPal currency and without validating the captured amount against the invoice balance. An unauthenticated attacker who supplies an `order_id` for a PayPal order they created in a weak currency (for example 100 VND, worth about USD 0.004) has that order captured with the operator's own credentials and gets a target invoice marked fully paid, because the numeric `value` (100) is stored as a 100-unit payment while the currency code is ignored. This is a payment forgery: the invoice is settled without the operator receiving the invoice amount. Affected versions `invoiceplane/invoiceplane` versions `>= 1.6.2` (the first release shipping the `PaypalLib` PayPal REST Orders v2 flow) through the latest release `1.7.2-beta-1`, and the current `develop` branch (commit `a97dacc38843f1cc92d6fd204611547025a21d82`). Patched in: N/A. Privilege required Unauthenticated. `application/modules/guest/controllers/gateways/Paypal.php` is a guest controller reachable without any login. The only precondition is that the PayPal gateway is enabled by the operator (a standard configuration) and the attacker knows or obtains a capturable `order_id`. The PayPal `client_id` needed to create an order against the operator's account is public (it is embedded in the PayPal JS SDK URL served on the invoice payment page). Vulnerable code (file:line) `application/modules/guest/controllers/gateways/Paypal.php:64` `paypal_capture_payment()` (v1.6.5): ```php public function paypal_capture_payment(string $order_id) { $paypal_response = $this->lib_paypal->captureOrder($order_id); if ($paypal_response['status']) { $paypal_object = json_decode($paypal_response['response']->getBody()); $capture_status = mb_strtoupper($paypal_object->purchase_units[0]->payments->captures[0]->status) ?? null; if ($capture_status === 'COMPLETED' || $capture_status === 'PENDING') { $invoice_id = $paypal_object->purchase_units[0]->payments->captures[0]->invoice_id; $amount = $paypal_object->purchase_units[0]->payments->captures[0]->amount->value; $this->load->model('payments/mdl_payments'); $this->mdl_payments->save(null, [ 'invoice_id' => $invoice_id, 'payment_date' => date('Y-m-d'), 'payment_amount' => $amount, 'payment_method_id' => get_setting('gateway_paypal_payment_method'), 'payment_note' => $payment_note, ]); } } } ``` Reachability / How input reaches sink `$order_id` is fully attacker-controlled (URL path segment; no authentication and, in this release line, no method/CSRF gate). The handler captures that order with the operator's OAuth2 credentials and then trusts the capture response verbatim: - `amount = ...->amount->value` is stored as `payment_amount` with no comparison to the invoice's `invoice_balance`. `Mdl_payments::validate_payment_amount()` (the `payment_cannot_exceed_balance` check) reads `$this->input->post('invoice_id')` and only runs on the admin form path; the gateway calls `save(null, $db_array)`, so no amount ceiling is enforced here. - `...->amount->currency_code` is never read. The store's configured currency (`gateway_paypal_currency`, used at order-create time) is never compared to the currency actually captured. Because only the numeric `value` is stored, an order captured as `{ "currency_code": "VND", "value": "100" }` (100 Vietnamese Dong, roughly USD 0.004) records a payment of `100` against a 100 USD invoice and settles it. The sibling `Stripe` gateway (`application/modules/guest/controllers/gateways/Stripe.php`) reads `client_reference_id` and `amount_total` from a session it re-retrieves from Stripe, but it likewise never compares the captured amount/currency to the invoice; the PayPal handler is the more directly exploitable of the two because the capture is driven off an attacker-supplied `order_id`. The `develop` branch adds a `guest_visible()` invoice check and a `payment_external_id` de-duplication guard to this handler (improper-access-control hardening authored 2026-04-26), but neither the currency nor the amount is validated on any release or on `develop`, so the forgery remains reachable. Proof of concept End-to-end against InvoicePlane v1.6.5 on docker php:8.3-apache + MySQL 8.0. Deploy the official v1.6.5 release with a real MySQL database (all setup SQL migrations imported). Enable the PayPal gateway. Only PayPal's external server-to-server confirmation (`api-m.paypal.com` OAuth2 token + Orders v2 capture) is stubbed, via an `https` network alias with a certificate trusted by PHP; the entire InvoicePlane request pipeline and database are the real deployed application. Target invoice `#1` is 100.00 USD, guest-visible, balance 100.00. The stub returns a capture of `{ currency_code: "VND", value: "100" }`, `invoice_id: 1`, `status: COMPLETED` (simulating an order the attacker created and paid to the operator's account in a weak currency). ```text #### EXPLOIT (unpatched v1.6.5) ########## Attacker capture payload: amount = {currency_code:"VND", value:"100"} (100 VND ~= USD 0.004), invoice_id=1 before: paid=0.00/100.00 payments=0 FIRE : GET /index.php/guest/gateways/paypal/paypal_capture_payment/ORDER-ATTACKER-VND (guest, unauthenticated) stub : POST /v1/oauth2/token ; POST /v2/checkout/orders/ORDER-ATTACKER-VND/capture HTTP=200 after : paid=100.00/-100.00 payments=1 (ip_payments row: invoice_id=1 payment_amount=100.00) => 100.00 USD invoice marked FULLY PAID by a capture of 100 VND (~USD 0.004); currency ignored, amount not checked vs balance. #### CONTROLS (patched build: require capture currency == gateway_paypal_currency AND amount >= invoice_balance) ########## [N1] VND forgery vs PATCHED -> HTTP=401 REJECTED after: paid=0.00/100.00 payments=0 [N2] legit USD100 vs PATCHED -> HTTP=200 ACCEPTED after: paid=100.00/-100.00 payments=1 (payment_amount=100.00) ``` The DB ground truth (`ip_invoice_amounts.invoice_paid` / `invoice_balance` and the `ip_payments` row) confirms the invoice moved from unpaid to fully paid on the unpatched build off a near-zero-value capture, that the patched build rejects the forgery, and that the patched build still accepts a genuine matching-currency full payment. Impact - Unauthenticated payment forgery: any guest can mark any guest-visible invoice as fully paid while paying the operator a negligible amount, by capturing a weak-currency (or otherwise underfunded) PayPal order against the invoice total. - Financial loss: goods/services are released against invoices that were never actually settled for their stated value; the operator's accounting shows the invoice paid in full. - Amount confusion generalizes the same root cause: because the captured `value` is never compared to `invoice_balance`, any underpayment recorded through this path is trusted as-is. Suggested fix Bind the captured payment to the invoice's expected currency and balance before recording it, mirroring the settings the store already configures for order creation: ```php $this->load->model('invoices/mdl_invoices'); $expected_currency = mb_strtoupper((string) get_setting('gateway_paypal_currency')); $capture_currency = mb_strtoupper((string) ($paypal_object->purchase_units[0]->payments->captures[0]->amount->currency_code ?? '')); $invoice_row = $this->mdl_invoices->where('ip_invoices.invoice_id', $invoice_id)->get()->row(); if ( ! $invoice_row || $capture_currency !== $expected_currency || (float) $amount + 0.0001 < (float) $invoice_row->invoice_balance) { log_message('error', CLASS . '::' . FUNCTION . ' - Rejected capture: currency/amount mismatch for invoice ' . $invoice_id); show_error('Payment rejected', 401); return; } ``` The currency comparison uses the same `gateway_paypal_currency` setting that `paypal_create_order()` already applies, and the amount comparison uses the invoice's `invoice_balance`, so a genuine full payment in the configured currency is accepted while an underfunded or wrong-currency capture is rejected. The same currency/amount binding should be added to the `Stripe` gateway's `callback()`. Fix PR https://github.com/InvoicePlane/InvoicePlane-ghsa-35qh-94hc-hm2w/pull/1 (private advisory fork; adds the capture currency + amount binding to the PayPal handler and the sibling Stripe callback). Credit Reported by tonghuaroot.
Severity Level
HIGH
Published Date
Sep 28, 2026
Last Modified
Sep 28, 2026
Exploitation Status
Public exploit available
CVE Record Status
Reserved
This CVE ID is referenced in a public advisory, but the CVE Program has not published its official CVE Record yet. Full CVSS/CPE data from NVD will appear here once it does.
Root Weakness (CWE)
The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.

Affected & Patched Versions

Affected Versions
  • invoiceplane/invoiceplane >= 1.6.2, <= 1.7.2-beta-1
Patched Versions
  • invoiceplane/invoiceplane 1.7.2

What to do

Prioritize this fix. Exploit code is public, so attacks can follow quickly.

  1. Check whether you run invoiceplane/invoiceplane >= 1.6.2, and which version.
  2. Update to a patched version listed above, then confirm the new version.
  3. Review logs and exposed services for signs of earlier compromise.

Timeline

  • Sep 28, 2026Published
  • Sep 28, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new invoiceplane/invoiceplane >= 1.6.2, CVEsYou are reading CVE-2026-65961. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 23, 2026 17:00 UTC