View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012266 | Taler | exchange | public | 2026-11-21 10:28 | 2026-11-22 09:37 |
| Reporter | bot-oec [agent] | ||||
| Priority | none | Severity | minor | ||
| Status | acknowledged | ||||
| Summary | 0012266: Refunds of a coin deposited twice into one contract are bounded by one deposit | ||||
| Description | Refunds of a coin for a contract should be bounded by the sum of that coin's deposits into the contract. `src/exchangedb/do_refund.sql` reads one `coin_deposits` row with `SELECT INTO`. When a coin was deposited twice into the same contract, the bound is that one row's amount, and a refund up to the sum is refused. **Steps to reproduce:** 1. Deposit one coin twice into the same contract of one merchant, EUR:1 and EUR:2: both 200. 2. Refund EUR:3 with a fresh transaction id (so it is not an inconsistent replay): expected 200, gets 409 (the refund exceeds the deposit row read). The test `src/testing/test_exchange_api_refund_bound.c` does this; it fails on master at step 2 (expects 200, gets 409). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit. **Proposed fix:** the bound alone is not enough. Refund rows reference one deposit row, and the aggregator caps the merchant's share per deposit row: a refund of EUR:3 recorded on the EUR:1 row would leave the EUR:2 row to be paid out, while the coin got EUR:3 back. A fix has to split a refund over the contract's deposit rows of the coin, or refuse a second deposit of a coin into the same contract. **Found by:** the formalization of the Taler protocols; the rule violated is (E1) in `spec/refund.md`: refunds of a coin for a contract are bounded by the sum of that coin's deposits into the contract. | ||||
| Tags | No tags attached. | ||||
| Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit a1177870731e "testing: refunds of a coin deposited twice into one contract (0012266)", on master 7b658d8da. test_exchange_api_refund_bound_{cs,rsa} deposits one coin twice into one contract (EUR:1 and EUR:2) and refunds EUR:3 with a fresh transaction id: expected 200, gets 409 (the refund exceeds the one deposit row read). Fails on master at refund-both. | |
| Not convinced we care. This should basically not happen in practice, partially spent coins are refreshed, not then deposited again. | |
| https://git-www.taler.net/exchange.git/log/?h=dev/oec/formalization-findings | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-21 10:28 | bot-oec | New Issue | |
| 2026-11-21 10:28 | bot-oec | Implementer | => oec |
| 2026-11-21 10:28 | bot-oec | Reviewer | => Christian Grothoff |
| 2026-11-21 10:28 | bot-oec | Release signed by | => Christian Grothoff |
| 2026-11-21 10:28 | bot-oec | Deployed by | => Christian Grothoff |
| 2026-11-21 10:28 | bot-oec | Verifier | => oec |
| 2026-11-21 10:28 | bot-oec | Communicator | => CM_7 |
| 2026-11-21 10:47 | bot-oec | Note Added: 0030667 | |
| 2026-11-21 22:37 | Christian Grothoff | Status | new => acknowledged |
| 2026-11-21 22:37 | Christian Grothoff | Note Added: 0030709 | |
| 2026-11-21 22:38 | Christian Grothoff | View Status | private => public |
| 2026-11-21 22:38 | Christian Grothoff | Priority | normal => none |
| 2026-11-22 09:37 | bot-oec | Note Added: 0030762 |