View Issue Details

IDProjectCategoryView StatusLast Update
0009327GNUnetutil librarypublic2024-12-09 17:03
Reporterfefe Assigned Toschanzen Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.23.0Fixed in Version0.23.0 
Summary0009327: GNUNET_DNSPARSER_builder_add_uri: integer overflow
Description  1258 if (*off + sizeof(struct GNUNET_TUN_DnsUriRecord) > dst_len)
  1259 return GNUNET_NO;

adding sizeof(...) to *off could overflow.

  1262 GNUNET_memcpy (&dst[*off], &sd, sizeof(sd));
  1263 (*off) += sizeof(sd);
  1264 strncpy (&dst[*off], uri->target, dst_len - sizeof(struct
  1265 GNUNET_TUN_DnsUriRecord)
  1266 - 1);

The "- 1" could make the value negative and cause underflow, negating the length check in strncpy and causing memory corruption.

  1267 (*off) += strlen (uri->target);
  1268 dst[*off] = '\0';

If strncpy truncated the copy, adding strlen(src) will move *off past the end of the buffer.
Writing the 0 terminator is then memory corruption.
TagsNo tags attached.

Activities

schanzen

2024-11-05 08:04

administrator   ~0023661

Fix committed to master branch.

schanzen

2024-12-09 17:03

administrator   ~0023820

Released

Issue History

Date ModifiedUsernameFieldChange
2024-11-04 16:11fefeNew Issue
2024-11-04 18:26schanzenTarget Version => 0.22.3
2024-11-05 08:04schanzen
2024-11-05 08:04schanzenNote Added: 0023661
2024-11-05 08:04schanzenAssigned To => schanzen
2024-11-05 08:04schanzenStatusnew => resolved
2024-11-05 08:04schanzenResolutionopen => fixed
2024-11-14 08:43schanzenTarget Version0.22.3 => 0.23.0
2024-12-09 17:03schanzenFixed in Version => 0.23.0
2024-12-09 17:03schanzenNote Added: 0023820
2024-12-09 17:03schanzenStatusresolved => closed