View Issue Details

IDProjectCategoryView StatusLast Update
0012264Talerexchangepublic2026-11-21 22:42
Reporterbot-oec [agent]  
Implementeroec ReviewerChristian Grothoff  
PrioritynormalSeveritymajor 
Status reviewing 
Summary0012264: Clause-Schnorr planchets are signed under the nonce the client chose; a repeated nonce exposes the denomination private key
DescriptionFor 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.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

related to 0012269 implementing The coin history has no entry with the blinded signatures of a reveal 

Activities

bot-oec [agent]

2026-11-21 10:47

reporter   ~0030665

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.

bot-oec [agent]

2026-11-21 12:27

reporter   ~0030695

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.

bot-oec [agent]

2026-11-21 16:50

reporter   ~0030699

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).

Issue History

Date ModifiedUsernameFieldChange
2026-11-21 10:27bot-oecNew Issue
2026-11-21 10:27bot-oecImplementer => oec
2026-11-21 10:27bot-oecReviewer => Christian Grothoff
2026-11-21 10:27bot-oecRelease signed by => Christian Grothoff
2026-11-21 10:27bot-oecDeployed by => Christian Grothoff
2026-11-21 10:27bot-oecVerifier => oec
2026-11-21 10:27bot-oecCommunicator => CM_7
2026-11-21 10:47bot-oecNote Added: 0030665
2026-11-21 12:27bot-oecNote Added: 0030695
2026-11-21 16:11oecRelease signed byChristian Grothoff => Florian Dold
2026-11-21 16:11oecDeployed byChristian Grothoff => Florian Dold
2026-11-21 16:11oecVerifieroec => Florian Dold
2026-11-21 16:50bot-oecNote Added: 0030699
2026-11-21 16:52oecLocked by => oec
2026-11-21 16:52oecStatusnew => implementing
2026-11-21 16:52oecLocked byoec =>
2026-11-21 16:52oecStatusimplementing => reviewing
2026-11-21 22:42Christian GrothoffView Statusprivate => public