View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012215 | Taler | auditor | public | 2026-11-18 16:41 | 2026-11-18 16:46 |
| Reporter | bot-cg [agent] | ||||
| Implementer | oec | Reviewer | Christian Grothoff | ||
| Release signed by | Antoine A | Deployed by | Christian Grothoff | ||
| Verifier | oec | Communicator | CM_7 | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | git (master) | ||||
| Target Version | 1.6 | Fixed in Version | 1.6 | ||
| Summary | 0012215: taler-helper-auditor-coins sizes a stack array by the number of fresh coins of a melt read from the exchange database | ||||
| Description | TALER_EXCHANGEDB_iterate_refreshes_above_serial_id() reads new_denominations_serials into num_nds with no bound, and refresh_session_cb() (src/auditor/taler-helper-auditor-coins.c) declares nis[num_nds] on the stack (its parameter is also declared new_denom_serials[static num_nds]). The exchange never stores a melt with zero or more than TALER_MAX_COINS fresh coins, but the auditor reads a database it is meant to distrust: a row with millions of serials overflows the stack, and an empty array makes both declarations zero-length. Database only. Confirmed by reading the code at 2a57cbcaf. The attached patch reports such a row as an inconsistency ('invalid number of fresh coins') and skips it. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 12215-auditor-refuse-melts-with-an-impossible-number-of-fr.patch (1,640 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] auditor: refuse melts with an impossible number of fresh
coins
The coins helper sizes stack arrays by the length of the melt's
denomination serial array, which comes from the database it audits.
Issue: https://bugs.taler.net/n/12215
Assisted by LLM
---
src/auditor/taler-helper-auditor-coins.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index 5782f4ea9..646d189dd 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -1750,6 +1750,21 @@ refresh_session_cb (struct CoinContext *cc,
GNUNET_assert (rowid >=
TALER_ARL_USE_PP (coins_melt_serial_id)); /* should be monotonically increasing */
TALER_ARL_USE_PP (coins_melt_serial_id) = rowid + 1;
+ if ( (0 == num_nds) ||
+ (num_nds > TALER_MAX_COINS) )
+ {
+ /* the number of fresh coins sizes arrays on the stack below */
+ qs = report_row_inconsistency ("melt",
+ rowid,
+ "invalid number of fresh coins");
+ if (0 > qs)
+ {
+ GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
+ cc->qs = qs;
+ return GNUNET_SYSERR;
+ }
+ return GNUNET_OK;
+ }
qs = TALER_ARL_get_denomination_info (old_denom_pub,
&issue,
&h_denom_pub);
--
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 | => Antoine A |
| 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: 12215-auditor-refuse-melts-with-an-impossible-number-of-fr.patch | |
| 2026-11-18 16:46 | Christian Grothoff | Status | new => closed |
| 2026-11-18 16:46 | Christian Grothoff | Resolution | open => fixed |
| 2026-11-18 16:46 | Christian Grothoff | Fixed in Version | => 1.6 |
| 2026-11-18 16:46 | Christian Grothoff | Note Added: 0030607 | |
| 2026-11-18 16:46 | Christian Grothoff | Target Version | => 1.6 |