Issue metadata
Sign in to add a comment
|
Security: depthcharge write_sparse_image potential oob reads
Reported by
derrek.h...@gmail.com,
May 4 2017
|
||||||||||||||||||||||
Issue descriptionDear Chromium Security Team, Please have a look at the "write_sparse_image" function that implements sparse-image writing (which required by fastboot): https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/firmware-smaug-7900.B/src/fastboot/backend.c#108 The important arguments are: "image_addr" - a ptr to the downloaded image data, and "image_size", which is the size of that image. Now, when you look for references to this "image_size" variable you will notice that there aren't any. All the following code assumes that the supplied image is not malformed. Among other fields, no lengths from its headers/chunks are verified (e.g total_chunks, chunk_size_lba). It just makes sure that the chunk size does not exceed the partition size, but not whether it fits into the downloaded image. Thus, this could very likely go out of bounds. Kind regards, -derrek
,
May 5 2017
I can take a look but the week after next, since I'm OOO next week.
,
May 5 2017
Thanks! If there's someone else who can take a look too, please assign it to them :) For now, Security_Impact-None to get this out of the queue since it's not obvious that this is a real vulnerability yet.
,
May 8 2017
furquan@, the commit logs suggest you wrote this code. Any comments on the absence of image_size checks? Where is the data processed by this function coming from? received via fastboot? If that's the case, it may allow someone to cause RAM contents to be written to a partition, which may or may not be a problem depending on memory contents.
,
May 8 2017
After looking a bit more at the code, I'm pretty sure the data is indeed an image received from fastboot. One would have to experiment with writing images with inconsistent sizes to see whether this can be exploited. One thing I'd try would be to write to a large partition but only provide a short image, then read back that partition and look at the returned data. Anyhow, we definitely should get this addressed, so assigning to furquan@. I'll set Impact-Stable and Severity-Low since for now given that this apparently affects production code, but we haven't come up with a plausible way to exploit this.
,
May 8 2017
,
May 8 2017
Yes, I will take a look.
,
May 8 2017
Re#4: Yes the data is received via fastboot. Re#5: It is not possible to read back partition from the device using fastboot. Fastboot only allows writing to partitions on the device, not reading them back. I will push a change out to add checks for image_size.
,
May 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/f24e564cef473cf9beae54963cb73147aaebfd53 commit f24e564cef473cf9beae54963cb73147aaebfd53 Author: Furquan Shaikh <furquan@chromium.org> Date: Wed May 10 09:08:29 2017 fastboot/backend: Check image_size for overflow in sparse image write Add proper checks in sparse image write to avoid image read beyond image_size. BUG= chromium:718526 BRANCH=None TEST=Compiles successfully. Change-Id: I4c1d320ceaeb05cd366676123f0c67b4bb5f905f Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/499048 Reviewed-by: Aaron Durbin <adurbin@chromium.org> [modify] https://crrev.com/f24e564cef473cf9beae54963cb73147aaebfd53/src/fastboot/backend.c [modify] https://crrev.com/f24e564cef473cf9beae54963cb73147aaebfd53/src/fastboot/backend.h [modify] https://crrev.com/f24e564cef473cf9beae54963cb73147aaebfd53/src/fastboot/fastboot.c
,
May 10 2017
Can confirm the fix looks right.
,
May 10 2017
,
May 11 2017
,
May 16 2017
The NextAction date has arrived: 2017-05-16
,
May 16 2017
This looks like it should at least make it to the rewards panel?
,
May 16 2017
Sure, we'll take a look.
,
May 25 2017
I'm afraid the VRP panel declined to reward for this bug, but did say they would reconsider if you describe how this could be exploitable. Thanks!
,
May 25 2017
,
Jul 13 2017
I guess the only ways to exploit this flaw is: - dumping/tracing partition data using external hardware attached to the storage device's bus. - getting access to the partition when the OS is running (another vuln might be required, I am not sure).
,
Aug 17 2017
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 22 2018
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by och...@chromium.org
, May 4 2017Owner: jorgelo@chromium.org
Status: Assigned (was: Unconfirmed)