View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012264 | Taler | exchange | public | 2026-11-21 10:27 | 2026-11-21 22:42 |
| Reporter | bot-oec [agent] | ||||
| Implementer | oec | Reviewer | Christian Grothoff | ||
| Priority | normal | Severity | major | ||
| Status | reviewing | ||||
| Summary | 0012264: Clause-Schnorr planchets are signed under the nonce the client chose; a repeated nonce exposes the denomination private key | ||||
| Description | For a Clause-Schnorr (CS) envelope, the signing helper derives `R` from the envelope's nonce (`src/util/secmod_cs.c`, `GNUNET_CRYPTO_cs_r_derive (&planchet->nonce, for_melt ? "rm" : "rw", ...)`). `taler-exchange-httpd_post-withdraw.c` (around lines 640–668) and `taler-exchange-httpd_post-melt.c` (around lines 1228–1256) derive the nonces from `blinding_seed` only to compute the stored `cs_r_values`. No code compares the envelope's nonce with the derived one. So the client chooses the nonce under which the exchange signs, and one repeated nonce exposes the denomination private key. `GNUNET_CRYPTO_cs_sign_derive` derives the signer's choice `b` and the secret `r_b` from the nonce and the key only (`gnunet_crypto_lib.h`). Two requests with the same nonce and different blinded challenges (the client changes both, so `c_b ≠ c'_b` whatever `b` is) give `s = r_b + c_b·x` and `s' = r_b + c'_b·x`, hence `x = (s − s')/(c_b − c'_b)`. The uniqueness tables for `blinding_seed` do not prevent this, because signing does not use the seed. **Steps to reproduce:** with a CS denomination: 1. Withdraw one CS planchet carrying the nonce derived from the blinding seed: 200 (control). 2. Withdraw one CS planchet carrying a random nonce: expected 4xx, gets 200. The test `src/testing/test_exchange_api_cs_nonce.c` does this; it fails on master at step 2 (expects 4xx, gets 200). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit. **Proposed fix:** before signing, in withdraw, age-withdraw and melt (all batches), reject envelopes whose nonce differs from the derived one, or sign with the derived nonce. As a check in `phase_check_keys` of `post-withdraw.c` and `post-melt.c`: for every CS coin `i` and every one of its κ candidates, the planchet's nonce must equal `TALER_cs_nonce_derive_indexed (blinding_seed, for_melt, i)` (the client library derives it so), else 400 (`TALER_EC_GENERIC_PARAMETER_MALFORMED`). With it the test passes, and the CS withdraw, age-restriction, revocation and auditor tests still pass. The melt side has no negative test yet. wallet-core derives the nonces from `blinding_seed` (labels `withdraw-n` and `refresh-n`), so it is not affected by the check. **Found by:** the formalization of the Taler protocols; the rule violated is (E1) in `spec/ext-cs.md`: before signing, the exchange checks that each CS envelope's nonce equals the nonce derived from the blinding seed and the envelope's index. | ||||
| Tags | No tags attached. | ||||
| related to | 0012269 | implementing | The coin history has no entry with the blinded signatures of a reveal |
| Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit 6d202bb13525 "testing: Clause-Schnorr nonce must be derived from the blinding seed (0012264)", on master 7b658d8da. test_exchange_api_cs_nonce_cs withdraws a CS coin whose planchet carries a nonce the client chose instead of the one derived from the blinding seed. The exchange must refuse it (4xx); it signs it (200). New command TALER_TESTING_cmd_withdraw_cs_nonce. Fails on master at withdraw-foreign-nonce. | |
| Fix proposed for review: exchange branch dev/oec/fix-12237, commits 4e256063b (the test of the note above) and fee5dc76c (/withdraw and /melt refuse a CS envelope whose nonce is not the one derived from blinding_seed for the coin's index, 400 TALER_EC_GENERIC_PARAMETER_MALFORMED). test_exchange_api_cs_nonce_cs and the exchange suite pass; the documentation side is #12237. | |
| Fixed in exchange master: 4e256063b (test_exchange_api_cs_nonce_cs) and fee5dc76c (/withdraw and /melt refuse a CS envelope whose nonce is not the one derived from blinding_seed for the coin's index). The documentation side is #12237 (taler-docs f064277e). | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-21 10:27 | bot-oec | New Issue | |
| 2026-11-21 10:27 | bot-oec | Implementer | => oec |
| 2026-11-21 10:27 | bot-oec | Reviewer | => Christian Grothoff |
| 2026-11-21 10:27 | bot-oec | Release signed by | => Christian Grothoff |
| 2026-11-21 10:27 | bot-oec | Deployed by | => Christian Grothoff |
| 2026-11-21 10:27 | bot-oec | Verifier | => oec |
| 2026-11-21 10:27 | bot-oec | Communicator | => CM_7 |
| 2026-11-21 10:47 | bot-oec | Note Added: 0030665 | |
| 2026-11-21 12:27 | bot-oec | Note Added: 0030695 | |
| 2026-11-21 16:11 | oec | Release signed by | Christian Grothoff => Florian Dold |
| 2026-11-21 16:11 | oec | Deployed by | Christian Grothoff => Florian Dold |
| 2026-11-21 16:11 | oec | Verifier | oec => Florian Dold |
| 2026-11-21 16:50 | bot-oec | Note Added: 0030699 | |
| 2026-11-21 16:52 | oec | Locked by | => oec |
| 2026-11-21 16:52 | oec | Status | new => implementing |
| 2026-11-21 16:52 | oec | Locked by | oec => |
| 2026-11-21 16:52 | oec | Status | implementing => reviewing |
| 2026-11-21 22:42 | Christian Grothoff | View Status | private => public |