Details
Assignee
Michael OffnerMichael OffnerReporter
Jamie JacksonJamie JacksonPriority
NewLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Affects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Jamie Jackson
Jamie JacksonPriority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Affects versions
Created 26 July 2022 at 18:12
Updated 6 March 2025 at 11:30
Given I have an S3 bucket whose public access is blocked (see image)
and I have a mapping of
this.mappings["/s3new"] = "s3://REDACTED:REDACTED@mybucketname";
and the
foo/
directory exists in the bucketWhen I perform a
fileWrite("/s3new/foo/delete_me_2.txt", "delete me now" );
Then I get an access denied message from S3
Whereas the same operation from AWS CLI (
aws s3 cp foo.txt s3://mybucketname/foo/delete_me_2.txt
, using the same credentials, succeedsIf I do not block public access on the bucket, then I am able to successfully upload from Lucee.
Here is the reason:
The (successful) AWS CLI request has the following request parameters (as seen in CloudTrail):
{ "bucketName":"mybucketname.s3.amazonaws.com", "Host":"mybucketname.s3.amazonaws.com", "key":"foo/delete_me_2.txt" }
The (unsuccessful) Lucee
fileWrite
request gives the following request parameters:{ "bucketName":"mybucketname.s3.amazonaws.com", "Host":"mybucketname.s3.amazonaws.com:443", "x-amz-acl":"public-read", "key":"foo/delete_me_2.txt" }
The errant
"x-amz-acl":"public-read"
is the trouble.I just got off of the phone with AWS support. Here’s the scoop:
The workaround of unblocking public access is unacceptable (IMO): While I could still prevent the public, at large, from having public access (by virtue of not configuring the access in its policy), it would still be an odd/untidy configuration.
Worse, however, is that the
"x-amz-acl":"public-read"
yields public access on the object that’s written.It seems like Lucee is defaulting to poor security here, with no way to fix it (or am I missing something?).
Related:
https://dev.lucee.org/t/writing-to-s3-bucket/7592/15
https://luceeserver.atlassian.net/browse/LDEV-2336 ?
Tangent: Why does Lucee use jetS3t? It doesn’t seem the be the most lively project out there for java/s3.