Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-04-09 Thread Daniel P. Berrange
On Wed, Apr 01, 2015 at 02:41:57PM +0100, Peter Maydell wrote: > On 1 April 2015 at 14:36, Gerd Hoffmann wrote: > > Confirmed. Fixes the issues I've seen in testing and looks sensible to > > me. Comment from Daniel would be nice, especially as I know next to > > nothing about websockets, but he

Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-04-01 Thread Peter Maydell
On 1 April 2015 at 14:36, Gerd Hoffmann wrote: > Confirmed. Fixes the issues I've seen in testing and looks sensible to > me. Comment from Daniel would be nice, especially as I know next to > nothing about websockets, but he seems to be off into the easter > holidays already. > > So, with -rc2 w

Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-04-01 Thread Gerd Hoffmann
Hi, > > +if (input->offset < *payload_remain) { > > +*payload_size = input->offset - (input->offset % 4); > > +} else { > > +*payload_size = input->offset; > > This can set *payload_size to a value larger than > *payload_remain, if the input buffer happens to contain > f

Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-03-31 Thread Peter Maydell
On 23 March 2015 at 22:58, Daniel P. Berrange wrote: > -if (*payload_size < 126) { > -header_size = 6; > -mask = header->u.m; > -} else if (*payload_size == 126 && input->offset >= 8) { > -*payload_size = be16_to_cpu(header->u.s16.l16); > -header_size = 8; >

Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-03-31 Thread Peter Maydell
On 23 March 2015 at 22:58, Daniel P. Berrange wrote: > +int vncws_decode_frame_payload(Buffer *input, > + size_t *payload_remain, WsMask *payload_mask, > + uint8_t **payload, size_t *payload_size) > +{ > +size_t i; > +uint32_t *pa

[Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames

2015-03-23 Thread Daniel P. Berrange
The logic for decoding websocket frames wants to fully decode the frame header and payload, before allowing the VNC server to see any of the payload data. There is no size limit on websocket payloads, so this allows a malicious network client to consume 2^64 bytes in memory in QEMU. It can trigger