distribution/registry/handlers
Stephen J Day 58d239d723
registry/{storage,handlers}: limit content sizes
Under certain circumstances, the use of `StorageDriver.GetContent` can
result in unbounded memory allocations. In particualr, this happens when
accessing a layer through the manifests endpoint.

This problem is mitigated by setting a 4MB limit when using to access
content that may have been accepted from a user. In practice, this means
setting the limit with the use of `BlobProvider.Get` by wrapping
`StorageDriver.GetContent` in a helper that uses `StorageDriver.Reader`
with a `limitReader` that returns an error.

When mitigating this security issue, we also noticed that the size of
manifests uploaded to the registry is also unlimited. We apply similar
logic to the request body of payloads that are full buffered.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 55ea440428)
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-20 13:39:13 -07:00
..
api_test.go Merge pull request #1706 from aibaars/registry-size-close 2016-06-13 16:29:35 -07:00
app.go Update to fix lint errors 2016-11-11 11:58:28 -08:00
app_test.go StorageDriver: Test case for #1698 2016-05-06 13:04:30 +01:00
basicauth.go Move registry package into handler package 2015-02-10 17:25:40 -08:00
basicauth_prego14.go Move registry package into handler package 2015-02-10 17:25:40 -08:00
blob.go Add an "enabled" parameter under "readonly", and make it as if the mutable handlers don't exist when read-only mode is enabled 2015-09-22 15:49:26 -07:00
blobupload.go registry/{storage,handlers}: limit content sizes 2017-07-20 13:39:13 -07:00
catalog.go Stop ErrFinishedWalk from escaping from Repositories walk 2016-08-26 11:20:37 -07:00
context.go Update auth context keys to use constant 2016-01-28 17:02:09 -08:00
health_test.go Move initialization code from main.go to the registry package 2015-09-09 14:39:31 -07:00
helpers.go registry/{storage,handlers}: limit content sizes 2017-07-20 13:39:13 -07:00
hmac.go Refactor Blob Service API 2015-05-15 17:05:18 -07:00
hmac_test.go Refactor Blob Service API 2015-05-15 17:05:18 -07:00
hooks.go Feature: Web Panic Reporting via hooks 2015-05-31 14:21:22 +00:00
images.go registry/{storage,handlers}: limit content sizes 2017-07-20 13:39:13 -07:00
mail.go Feature: Web Panic Reporting via hooks 2015-05-31 14:21:22 +00:00
tags.go Pass through known errors 2016-04-29 23:34:24 +02:00