Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce Content-MD5 of PUT requests #668

Closed
gaul opened this issue Sep 10, 2013 · 1 comment
Closed

Enforce Content-MD5 of PUT requests #668

gaul opened this issue Sep 10, 2013 · 1 comment

Comments

@gaul
Copy link

gaul commented Sep 10, 2013

RiakCS should reject PUT requests with mismatched Content-MD5 and data. I tested using the S3-compatible API via jclouds and riakcs.net does not reject the request:

    @Test
    public void testPutBlobIncorrectMd5() throws Exception {
        String blobName = makeBlobName();
        byte[] input = TestUtils.makeRandomBuffer(/*size=*/ 1024);
        byte[] contentMd5 = Hashing.md5().hashBytes(input).asBytes();
        // Modify the first byte of the MD5
        contentMd5[0]++;
        BlobStore blobStore = blobStoreContext.getBlobStore();
        Blob blob = blobStore.blobBuilder(blobName)
                    .payload(input)
                    .contentMD5(contentMd5)
                    .build();
        thrown.expect(HttpResponseException.class);
        blobStore.putBlob(containerName, blob);
    }

Further reference:
https://twitter.com/reiddraper/status/347801372571340802

@reiddraper
Copy link
Contributor

riakcs.net is running an older version of Riak CS at the moment. This was fixed in #596 and further tested in #626.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants