View Issue Details

IDProjectCategoryView StatusLast Update
0008050GNUnetutil librarypublic2024-03-07 19:25
Reporterfefe Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionreopened 
Fixed in Version0.21.0 
Summary0008050: GNUNET_STRINGS_parse_ipv6_policy: integer overflow
DescriptionThis is in gnunet/src/lib/util/strings.c:

1474 unsigned int count;

1476 unsigned int len;

1491 len = strlen (routeListX);

len should be a size_t to prevent truncation here.

1495 count = 0;
1496 for (i = 0; i < len; i++)
1497 if (';' == routeList[i])
1498 count++;

count could be arbitrarily large here, up to and including 0xffffffff.

1508 result = GNUNET_malloc (sizeof(struct GNUNET_STRINGS_IPv6NetworkPolicy)
1509 * (count + 1));

The fact that count is an unsigned int, the multiplication cannot overflow, but the addition can, leading to a 0 byte allocation.
count should be a size_t and there should be integer overflow checking here.
TagsNo tags attached.

Activities

Christian Grothoff

2024-01-09 18:49

manager   ~0020853

Fix committed to master branch.

schanzen

2024-03-01 10:19

administrator   ~0021598

The fix causes tests in util for fail and other palces as well where this is parsed
in particular test_regex in util for a simple case but parsers in transport communicators also seem to be affected.

Christian Grothoff

2024-03-01 11:32

manager   ~0021601

Fixed regression in 505d22064..08c15135e

schanzen

2024-03-07 19:25

administrator   ~0021794

0.21 released

Issue History

Date ModifiedUsernameFieldChange
2024-01-09 17:22fefeNew Issue
2024-01-09 18:49Christian Grothoff
2024-01-09 18:49Christian GrothoffNote Added: 0020853
2024-01-09 18:49Christian GrothoffAssigned To => Christian Grothoff
2024-01-09 18:49Christian GrothoffStatusnew => resolved
2024-01-09 18:49Christian GrothoffResolutionopen => fixed
2024-01-09 19:10Christian GrothoffProjectTaler => GNUnet
2024-01-09 19:10Christian GrothoffCategoryother => util library
2024-03-01 10:19schanzenStatusresolved => feedback
2024-03-01 10:19schanzenResolutionfixed => reopened
2024-03-01 10:19schanzenNote Added: 0021598
2024-03-01 11:32Christian GrothoffNote Added: 0021601
2024-03-01 11:32Christian GrothoffStatusfeedback => resolved
2024-03-01 11:32Christian GrothoffFixed in Version => 0.21.0
2024-03-07 19:25schanzenNote Added: 0021794
2024-03-07 19:25schanzenStatusresolved => closed