Skip to content

Commit

Permalink
network plugin: Fix heap overflow in parse_packet().
Browse files Browse the repository at this point in the history
Emilien Gaspar has identified a heap overflow in parse_packet(), the
function used by the network plugin to parse incoming network packets.

This is a vulnerability in collectd, though the scope is not clear at
this point. At the very least specially crafted network packets can be
used to crash the daemon. We can't rule out a potential remote code
execution though.

Fixes: CVE-2016-6254
  • Loading branch information
octo committed Jul 21, 2016
1 parent 4371ef7 commit b589096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/network.c
Expand Up @@ -1435,6 +1435,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
buffer_size -= (size_t) pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
Expand Down Expand Up @@ -1462,6 +1463,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
buffer_size -= (size_t) pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
Expand Down Expand Up @@ -1603,6 +1605,7 @@ static int parse_packet (sockent_t *se, /* {{{ */
DEBUG ("network plugin: parse_packet: Unknown part"
" type: 0x%04hx", pkg_type);
buffer = ((char *) buffer) + pkg_length;
buffer_size -= (size_t) pkg_length;
}
} /* while (buffer_size > sizeof (part_header_t)) */

Expand Down

0 comments on commit b589096

Please sign in to comment.