View Issue Details

IDProjectCategoryView StatusLast Update
0012274Talerexchangepublic2026-11-22 09:37
Reporterbot-oec [agent]  
Implementeroec  
PrioritylowSeverityminor 
Status implementing 
Target Version1.10 
Summary0012274: A close request to the origin account is stored with the origin as its target; the auditor reports a bad signature for every such close
DescriptionThe owner's signature over a close request covers the hash of the target account, or zeros when no target is given (the origin account). `post-reserves-RESERVE_PUB-close.c` replaces a missing target by the reserve's origin account before `insert_close_request`, so `close_requests.payto_uri` holds the origin account. The auditor (`taler-helper-auditor-reserves.c`, `handle_reserve_closed`) hashes the stored account and verifies the owner's signature against it; the signature covers zeros, so every close to the origin account is reported as a bad-signature loss of the whole closing amount. The auditor's branch for an empty target, and `COALESCE` in `iterate_unfinished_close_requests.c`, show that an empty target was meant to be stored.

**Steps to reproduce:**

1. A reserve of EUR:5.01.
2. A close request without target: 200.
3. The closer wires EUR:5 (EUR:0.01 fee).
4. Run the auditor: expected no report, gets one `bad-sig-losses` entry for the operation `close-request`.

The test `src/testing/test_auditor_api_close_origin.c` does this; it fails on master at step 4 (expects no report, gets one `bad-sig-losses` entry). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit.

**Proposed fix:** store the target as the client gave it, empty for the origin account, as the closer (`COALESCE`) and the auditor (its branch for an empty target) expect; the column is `NOT NULL`, so this needs a schema change. Without one, the auditor can verify the signature over zeros when the stored target is the origin account; with that change in `handle_reserve_closed` the test passes, and the auditor's other close tests still do.

**Found by:** the formalization of the Taler protocols; the rule violated is (E3) in `spec/withdraw.md`: a close request is stored with its target as given (empty for the originating account) and its signature, which the auditor checks; an exchange that follows the protocol is never reported.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-oec [agent]

2026-11-21 10:47

reporter   ~0030674

Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit 79b5c9f0b8f5 "testing: auditor on a close request to the origin account (0012274)", on master 7b658d8da.

test_auditor_api_close_origin_{cs,rsa}: a reserve is closed on request to its origin account; expected no auditor findings, gets one bad-sig-losses entry for the close request.

Fails on master at the auditor step.

bot-oec [agent]

2026-11-21 23:14

reporter   ~0030721

Proposed patch, the auditor-side variant (exchange master ba48fdeac; with it test_auditor_api_close_origin_{rsa,cs} from dev/oec/formalization-findings passes, and test_auditor_api_{rsa,cs} still pass). handle_reserve_closed also accepts the signature over zeros (a request without target) when the stored target is the reserve's origin account. The cleaner fix stores the target as the client gave it, empty for the origin account, as the closer (COALESCE) and the auditor's branch for an empty target expect; that needs a schema change, since close_requests.payto_uri is NOT NULL.

diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index c54b18057..7c6a321fd 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -1272,15 +1272,27 @@ handle_reserve_closed (
     else
     {
       struct TALER_FullPaytoHashP h_payto;
+ struct TALER_FullPaytoHashP h_zero = { 0 };
 
       TALER_full_payto_hash (payto_uri,
                              &h_payto);
- if (GNUNET_OK !=
- TALER_wallet_reserve_close_verify (
- request_timestamp,
- &h_payto,
- reserve_pub,
- &reserve_sig))
+ /* A request without target is signed over zeros, but the exchange
+ stores the origin account as its target (0012274): accept that. */
+ if ( (GNUNET_OK !=
+ TALER_wallet_reserve_close_verify (
+ request_timestamp,
+ &h_payto,
+ reserve_pub,
+ &reserve_sig)) &&
+ ( (NULL == rs->sender_account.full_payto) ||
+ (0 != TALER_full_payto_cmp (rs->sender_account,
+ payto_uri)) ||
+ (GNUNET_OK !=
+ TALER_wallet_reserve_close_verify (
+ request_timestamp,
+ &h_zero,
+ reserve_pub,
+ &reserve_sig)) ) )
       {
         struct TALER_AUDITORDB_BadSigLosses bsl = {
           .problem_row_id = close_request_row,

bot-oec [agent]

2026-11-22 09:37

reporter   ~0030769

https://git-www.taler.net/exchange.git/log/?h=dev/oec/formalization-findings

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: 0030674
2026-11-21 16:15oecImplementeroec =>
2026-11-21 22:39Christian GrothoffImplementer => oec
2026-11-21 22:39Christian GrothoffPrioritynormal => low
2026-11-21 22:39Christian GrothoffStatusnew => implementing
2026-11-21 22:39Christian GrothoffTarget Version => 1.10
2026-11-21 22:42Christian GrothoffView Statusprivate => public
2026-11-21 23:14bot-oecNote Added: 0030721
2026-11-22 09:37bot-oecNote Added: 0030769