View Issue Details

IDProjectCategoryView StatusLast Update
0008051GNUnetutil librarypublic2024-03-07 19:26
Reporterfefe Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version0.21.0 
Summary0008051: GNUNET_STRINGS_base64_encode: integer overflow
DescriptionThis is in gnunet/src/lib/util/strings.c:

1607 size_t
1608 GNUNET_STRINGS_base64_encode (const void *in,
1609 size_t len,
1610 char **output)
1611 {
1612 const unsigned char *data = in;
1613 size_t ret;
1614 char *opt;
1615
1616 ret = 0;
1617 GNUNET_assert (len < SIZE_MAX / 4 * 3);
1618 opt = GNUNET_malloc (2 + (len * 4 / 3) + 8);

The maximum value of len that passes through line 1617 is 0xbffffffd (using 32-bit for illustration).
That causes an overflow in line 1618 when multiplying by 4.
The maximum value that will not cause overflow (and then memory corruption) is SIZE_MAX / 4.
TagsNo tags attached.

Activities

Christian Grothoff

2024-01-09 18:38

manager   ~0020852

Fix committed to master branch.

schanzen

2024-03-07 19:26

administrator   ~0021796

0.21 released

Issue History

Date ModifiedUsernameFieldChange
2024-01-09 17:33fefeNew Issue
2024-01-09 18:38Christian Grothoff
2024-01-09 18:38Christian GrothoffNote Added: 0020852
2024-01-09 18:38Christian GrothoffAssigned To => Christian Grothoff
2024-01-09 18:38Christian GrothoffStatusnew => resolved
2024-01-09 18:38Christian GrothoffResolutionopen => fixed
2024-01-09 19:10Christian GrothoffProjectTaler => GNUnet
2024-01-09 19:10Christian GrothoffCategoryother => util library
2024-03-07 19:26schanzenFixed in Version => 0.21.0
2024-03-07 19:26schanzenNote Added: 0021796
2024-03-07 19:26schanzenStatusresolved => closed