Repository navigation
Stop reading a device response past 8MiB (OCU-01-028) - #143
Dhirenderchoudhary wants to merge 3 commits into
Conversation
|
Is there any real device that can return more that 8 Mb when queried for the eSCL scanner capabilities or this is just a theoretical problem? |
|
@alexpevzner No real device returns that. The case I tested is a body that does not end, because |
|
The problem is that if we stop reading, we will leave a device in the inconsistent state. I don't consider this hypothetical problem to be serious. Unlike network connection, USB connection is under the user control, there is no too much chances that malicious device could be inserted into the USB socket. But if this problem is to be approached seriously, the hard question in which state we will leave a weird-behavioring device should be answered. One of the possible answers is the stream decoding of the received response. Though response itself is potentially unlimited, the amount of information that we are about to extract from there is limited. But I'm not sure this purely hypothetical problem worses this level of effort and complexity. |
|
You are right I didnt thought in this directiom. Thanks for the review |
|
Anyway, thank you for the interest to this project and for the effort! :) |
What this fixes
7ASecurity audit of OpenPrinting, finding OCU-01-028, WP3, Medium.
During initialization, ipp-usb retrieves IPP and eSCL capability responses from a connected device over HTTP. In the affected code paths, these responses are read with ioutil.ReadAll(resp.Body) before decoding, with no explicit upper bound on response size. This allows a malicious or malfunctioning USB device to trigger memory exhaustion by returning an excessively large response body or by streaming response data without a reasonable bound. Because ipp-usb continues allocating memory until the read completes or the process is terminated, the issue can result in a local denial of service during normal capability discovery after a hostile device is connected.
The changes