View Issue Details

IDProjectCategoryView StatusLast Update
0012267Talerexchangepublic2026-11-21 22:40
Reporterbot-oec [agent]  
Implementeroec  
PriorityhighSeverityminor 
Status implementing 
Target Version1.7 
Summary0012267: A melt replay is refused once a fresh denomination expired or was revoked, instead of returning the stored cut-and-choose index
DescriptionA replayed melt should be looked up by its commitment before the denomination checks, so that it returns the same cut-and-choose index `γ` even after a fresh denomination expired or was revoked. `taler-exchange-httpd_post-melt.c` computes the commitment `rc` only after `phase_check_keys`, so such a replay is answered with `DENOMINATION_EXPIRED` or `DENOMINATION_REVOKED`. The wallet can still read `γ` from the coin history.

**Steps to reproduce:**

1. Melt a coin: 200.
2. Replay the melt: 200, the same `γ`.
3. Revoke the fresh denomination.
4. Replay the identical request again: expected 200 with the stored `γ`, gets `410 Gone`.

The test uses a new testing command, `TALER_TESTING_cmd_melt_replay`, which sends an earlier melt's request again unchanged. For CS it passes the blinding values of the first melt to the library (`TALER_EXCHANGE_post_melt_set_blinding_values`, new): otherwise the library asks `/blinding-prepare` first, which refuses the revoked denomination before the melt is sent.

The test `src/testing/test_exchange_api_melt_replay.c` does this; it fails on master at step 4 (expects 200 with the stored `γ`, gets 410). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit.

**Proposed fix:** compute the commitment in the replay lookup (`melt_is_idempotent`, for the errors that require it), in the current and the legacy form, through a helper shared with `phase_check_coin_signature`. With it the test passes for CS and RSA; `test_exchange_api_{cs,rsa}` and the CS revocation and age-restriction tests still pass.

**Found by:** the formalization of the Taler protocols; the rule violated is (E1) in `spec/refresh.md`: the replay lookup by commitment comes before the denomination checks, so a replay returns the same index even after a fresh denomination expired or was revoked.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-oec [agent]

2026-11-21 10:47

reporter   ~0030668

Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit eaef42e47481 "testing: melt replay after expiry or revocation (0012267)", on master 7b658d8da.

test_exchange_api_melt_replay_{cs,rsa} replays a melt after a fresh denomination was revoked: expected 200 with the stored cut-and-choose index, gets 410. The replay sends the blinding values of the first submission, as a wallet does: new TALER_EXCHANGE_post_melt_set_blinding_values() and the testing command TALER_TESTING_cmd_melt_replay.

Fails on master at melt-replay-after-revocation.

bot-oec [agent]

2026-11-21 11:41

reporter   ~0030691

Wallet test: branch `dev/oec/formalization-findings` of taler-typescript-core (git.taler.net), commit 46b93b9945c2 "harness: melt replay after the fresh denominations were revoked (0012267)", on wallet-core master 908b0b1b5 with exchange master 7b658d8da; run it with `taler-harness run-integrationtests refresh-melt-replay-revoked`.

test-refresh-melt-replay-revoked refreshes a coin of TESTKUDOS:10 through a fault-injecting proxy. The exchange executes the melt; the proxy then revokes the melt's fresh denominations and replaces the response with a transient error (503), so the wallet repeats the melt. The replay must get the stored cut-and-choose index (200), and after all recoups the wallet may have lost no more than fees.

With exchange master 7b658d8da the replay gets 410; the wallet then melts the coin with other denominations and gets 409, the coin being melted already, and ends the refresh as done. Of TESTKUDOS:19.84 the wallet keeps TESTKUDOS:8 after the recoups. With the exchange answering the replay as a replay (the fix proposed in the issue) the test passes and the wallet keeps TESTKUDOS:19.68.

Addition to the issue's description: as the test shows, a wallet whose melt response is lost while the fresh denominations are revoked loses the melted coin's value.

bot-oec [agent]

2026-11-21 22:32

reporter   ~0030706

Proposed fix on branch dev/oec/fix-12267 (exchange, on master ba48fdeac):
- 8a00aecbe testing: melt replay after expiry or revocation
- 50dcf4a55 exchange: answer melt replays also after expiry or revocation

The commitment computation of phase_check_coin_signature moves into a helper, compute_commitment (current and pre-#11862 form). melt_is_idempotent uses it, so a replay is found also when the error came from a check before the commitment was computed (expired or revoked fresh denomination).

test_exchange_api_melt_replay_{rsa,cs}, test_exchange_api_{rsa,cs}, test_exchange_api_revocation_{rsa,cs} and test_exchange_api_age_restriction_{rsa,cs} pass.

Issue History

Date ModifiedUsernameFieldChange
2026-11-21 10:28bot-oecNew Issue
2026-11-21 10:28bot-oecImplementer => oec
2026-11-21 10:28bot-oecReviewer => Christian Grothoff
2026-11-21 10:28bot-oecRelease signed by => Christian Grothoff
2026-11-21 10:28bot-oecDeployed by => Christian Grothoff
2026-11-21 10:28bot-oecVerifier => oec
2026-11-21 10:28bot-oecCommunicator => CM_7
2026-11-21 10:47bot-oecNote Added: 0030668
2026-11-21 11:41bot-oecNote Added: 0030691
2026-11-21 16:13oecImplementeroec =>
2026-11-21 22:32bot-oecNote Added: 0030706
2026-11-21 22:40Christian GrothoffImplementer => oec
2026-11-21 22:40Christian GrothoffPrioritynormal => high
2026-11-21 22:40Christian GrothoffStatusnew => implementing
2026-11-21 22:40Christian GrothoffTarget Version => 1.7
2026-11-21 22:40Christian GrothoffView Statusprivate => public