View Issue Details

IDProjectCategoryView StatusLast Update
0012189Talerexchangepublic2026-11-18 15:02
Reporterbot-cg [agent]  
PrioritynormalSeveritycrash 
Status new 
Summary0012189: POST /reveal-withdraw for a withdraw that is not age-restricted aborts taler-exchange-httpd
Descriptionfind_original_withdraw() (taler-exchange-httpd_post-reveal-withdraw.c) loads the withdraw by (reserve_pub, planchets_h) without asking whether it is age-restricted, and the handler never looks at withdraw.age_proof_required. For a plain withdraw, max_age, noreveal_index and selected_h are NULL in the database and stay zero, and the denominations have age mask 0. verify_commitment_and_max_age() nevertheless runs the kappa cut-and-choose: for the batches other than noreveal_index it calls calculate_blinded_hash(), which calls TALER_age_restriction_from_secret() with the denomination's mask, and that function does GNUNET_assert (mask->bits & 1). So a reveal-withdraw request naming an ordinary withdraw aborts the httpd. The reserve owner knows reserve_pub and planchets_h of their own withdrawals, and the endpoint takes no signature.

Found by reading the code at 2a57cbcaf; not reproduced at runtime. The attached patch answers 404 TALER_EC_EXCHANGE_WITHDRAW_COMMITMENT_UNKNOWN for a withdraw that is not age-restricted, since there is no age-withdraw commitment to reveal.
TagsNo tags attached.
Attached Files
12189-exchange-refuse-reveal-withdraw-for-withdrawals-with.patch (1,502 bytes)   
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Wed, 18 Nov 2026 16:01:54 +0100
Subject: [PATCH] exchange: refuse /reveal-withdraw for withdrawals without age
 restriction

Only an age-restricted withdraw has kappa batches to reveal; for any
other the age derivation asserts on the denomination's empty age mask.

Issue: https://bugs.taler.net/n/12189

Assisted by LLM
---
 .../taler-exchange-httpd_post-reveal-withdraw.c      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c b/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c
index a1c59f508..3441b391b 100644
--- a/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c
+++ b/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c
@@ -662,6 +662,18 @@ TEH_handler_reveal_withdraw (
           &result))
       break;
 
+    /* Only an age-restricted withdraw has kappa batches to reveal */
+    if (! actx.withdraw.age_proof_required)
+    {
+      GNUNET_break_op (0);
+      result = TALER_MHD_reply_with_error (
+        rc->connection,
+        MHD_HTTP_NOT_FOUND,
+        TALER_EC_EXCHANGE_WITHDRAW_COMMITMENT_UNKNOWN,
+        "withdraw is not age-restricted");
+      break;
+    }
+
     /* Verify the computed planchets_h equals the committed one and that coins
      * have a maximum age group corresponding max_age (age-mask dependent) */
     if (GNUNET_OK !=
-- 
2.47.3

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

child of 0012186 new Unchecked array lengths and counts in exchange, merchant and anastasis: review after 2a57cbcaf [meta] 

Activities

Issue History

Date ModifiedUsernameFieldChange
2026-11-18 15:01bot-cgNew Issue
2026-11-18 15:01bot-cgRelationship addedchild of 0012186
2026-11-18 15:01bot-cgImplementer => oec
2026-11-18 15:01bot-cgReviewer => Christian Grothoff
2026-11-18 15:01bot-cgRelease signed by => Christian Grothoff
2026-11-18 15:01bot-cgDeployed by => Christian Grothoff
2026-11-18 15:01bot-cgVerifier => Christian Grothoff
2026-11-18 15:01bot-cgCommunicator => CM_7
2026-11-18 15:02bot-cgFile Added: 12189-exchange-refuse-reveal-withdraw-for-withdrawals-with.patch