webhook: answer 200 for a payment id Mollie does not know #90

Stängd
öppnade 2026-10-05 12:32:48 +00:00 av supernaut · 2 kommentarer
Ägare

Problem

A well-formed payment id that Mollie does not know makes payments.get throw, so the webhook answers 500 (src/server.ts:80-83) and Mollie retries it 10 times over 26 hours. Anyone can post such ids, which also turns the endpoint into an amplifier for our API calls.

Mollie docs

Return 200 for unknown ids, so nothing leaks (https://docs.mollie.com/reference/webhooks).

Fix

Catch Mollie 404/422 in parseCallback and answer 200. Keep 500 for real failures.

Found in the Mollie docs audit of 2026-10-05.

## Problem A well-formed payment id that Mollie does not know makes `payments.get` throw, so the webhook answers 500 (`src/server.ts:80-83`) and Mollie retries it 10 times over 26 hours. Anyone can post such ids, which also turns the endpoint into an amplifier for our API calls. ## Mollie docs Return 200 for unknown ids, so nothing leaks (https://docs.mollie.com/reference/webhooks). ## Fix Catch Mollie 404/422 in `parseCallback` and answer 200. Keep 500 for real failures. Found in the Mollie docs audit of 2026-10-05.
supernaut lade till detta till projektet Bitborg Payment 2026-10-05 12:34:48 +00:00
Upphovsperson
Ägare

What

POST /webhooks/mollie passes id to payments.get unchecked. This goes beyond the amplifier risk named here.

Why

The SDK only checks the tr_ prefix. It then resolves the path with new URL("payments/" + id, "https://api.mollie.com/v2/").

Failing case

id=tr_x/../../customers resolves to https://api.mollie.com/v2/customers. id=tr_x?testmode=true adds a query. Anyone can make us send authenticated GETs to any Mollie path. The response is stored in provider_event. Not exploitable while PAYMENTS_ENABLED is off.

Fix

In src/server.ts, answer 200 without a Mollie call unless id matches /^tr_[A-Za-z0-9]{1,32}$/.

Done when

  • Malformed ids get 200 and no provider call.
  • Test: tr_x/../../customers and tr_x?testmode=true never reach parseCallback.
## What `POST /webhooks/mollie` passes `id` to `payments.get` unchecked. This goes beyond the amplifier risk named here. ## Why The SDK only checks the `tr_` prefix. It then resolves the path with `new URL("payments/" + id, "https://api.mollie.com/v2/")`. ## Failing case `id=tr_x/../../customers` resolves to `https://api.mollie.com/v2/customers`. `id=tr_x?testmode=true` adds a query. Anyone can make us send authenticated GETs to any Mollie path. The response is stored in `provider_event`. Not exploitable while `PAYMENTS_ENABLED` is off. ## Fix In `src/server.ts`, answer 200 without a Mollie call unless `id` matches `/^tr_[A-Za-z0-9]{1,32}$/`. ## Done when - [ ] Malformed ids get 200 and no provider call. - [ ] Test: `tr_x/../../customers` and `tr_x?testmode=true` never reach `parseCallback`.
Upphovsperson
Ägare

Fixed in #151. parseCallback in src/provider/mollie.ts treats a Mollie 404 on payments.get as an unknown id and returns no events, so the webhook answers 200. Other errors still give 500. A malformed id gets 200 before any Mollie call (PAYMENT_ID in src/server.ts).

Fixed in #151. `parseCallback` in `src/provider/mollie.ts` treats a Mollie 404 on `payments.get` as an unknown id and returns no events, so the webhook answers 200. Other errors still give 500. A malformed id gets 200 before any Mollie call (`PAYMENT_ID` in `src/server.ts`).
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment#90
Ingen beskrivning angiven.