View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012214 | Taler | exchange | public | 2026-11-18 16:41 | 2026-11-18 16:43 |
| Reporter | bot-cg [agent] | ||||
| Implementer | oec | ||||
| Priority | normal | Severity | minor | ||
| Status | implementing | ||||
| Product Version | git (master) | ||||
| Target Version | 1.7 | ||||
| Summary | 0012214: libtalerexchange: the age_mask of a /keys denomination is not validated, and withdrawing from it aborts the client | ||||
| Description | parse_denomination_group() and parse_denom_pub() (src/json/json_helper.c) accept any 32-bit age_mask from the exchange. The age restriction code assumes that a non-empty mask has bit 0 set: TALER_age_restriction_from_secret() (src/util/age_restriction.c) asserts it, and the number of age groups, and so the number of keys in a commitment, is derived from the mask's bits on that basis. The withdraw client (exchange_api_post-withdraw.c) calls TALER_age_restriction_from_secret() with the denomination's mask, so a /keys reply with, say, "age_mask": 2 makes an age-restricted withdraw from that denomination abort the client. The exchange never produces such a mask (TALER_parse_age_group_string() always sets bit 0), and the in-tree C clients that withdraw are the test commands. Confirmed by reading the code at 2a57cbcaf. The attached patch makes both parsers refuse a non-zero mask without bit 0. | ||||
| Additional Information | Not addressed here: a mask with all 32 bits set is valid for the configuration parser, but TALER_age_restriction_from_secret() asserts 31 > num_priv, which such a mask violates for max_age >= 31. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 12214-json-refuse-denomination-age-masks-without-the-zerot.patch (1,577 bytes)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Wed, 18 Nov 2026 17:41:26 +0100
Subject: [PATCH] json: refuse denomination age masks without the zeroth age
group
The age restriction code asserts that a non-empty mask has bit 0 set,
and the mask comes from the exchange's /keys.
Issue: https://bugs.taler.net/n/12214
Assisted by LLM
---
src/json/json_helper.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index 69278c990..814deebd2 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -589,6 +589,14 @@ parse_denomination_group (void *cls,
if (age_mask_missing)
group->age_mask.bits = 0;
+ /* a non-empty age mask always marks the zeroth age group;
+ the age restriction code asserts this */
+ if ( (0 != group->age_mask.bits) &&
+ (0 == (group->age_mask.bits & 1)) )
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
return GNUNET_OK;
}
@@ -858,6 +866,14 @@ parse_denom_pub (void *cls,
if (age_mask_missing)
denom_pub->age_mask.bits = 0;
+ /* a non-empty age mask always marks the zeroth age group;
+ the age restriction code asserts this */
+ if ( (0 != denom_pub->age_mask.bits) &&
+ (0 == (denom_pub->age_mask.bits & 1)) )
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
bsign_pub = GNUNET_new (struct GNUNET_CRYPTO_BlindSignPublicKey);
bsign_pub->rc = 1;
bsign_pub->cipher = string_to_cipher (cipher);
--
2.47.3
| ||||
| child of | 0012186 | new | Unchecked array lengths and counts in exchange, merchant and anastasis: review after 2a57cbcaf [meta] |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-18 16:41 | bot-cg | New Issue | |
| 2026-11-18 16:41 | bot-cg | Relationship added | child of 0012186 |
| 2026-11-18 16:41 | bot-cg | Implementer | => oec |
| 2026-11-18 16:41 | bot-cg | Reviewer | => Christian Grothoff |
| 2026-11-18 16:41 | bot-cg | Release signed by | => Christian Grothoff |
| 2026-11-18 16:41 | bot-cg | Deployed by | => Christian Grothoff |
| 2026-11-18 16:41 | bot-cg | Verifier | => oec |
| 2026-11-18 16:41 | bot-cg | Communicator | => CM_7 |
| 2026-11-18 16:41 | bot-cg | File Added: 12214-json-refuse-denomination-age-masks-without-the-zerot.patch | |
| 2026-11-18 16:43 | Christian Grothoff | Target Version | => 1.7 |
| 2026-11-18 16:43 | Christian Grothoff | Locked by | => Christian Grothoff |
| 2026-11-18 16:43 | Christian Grothoff | Status | new => planning |
| 2026-11-18 16:43 | Christian Grothoff | Locked by | Christian Grothoff => |
| 2026-11-18 16:43 | Christian Grothoff | Status | planning => implementing |