AWS AmazonCloudFront: CloudFront: avoid forwarding S3 response-* params in custom policies
Summary
Added a note recommending that custom origin request policies for Amazon S3 origins not include response-content-type, response-content-disposition, or response-content-encoding, and to use an allow list instead of all query strings.
Security assessment
These S3 response override parameters can alter returned Content-Type/Disposition headers, which is a known vector for content-sniffing/XSS; the guidance is a hardening best practice rather than a fix for a specific disclosed vulnerability.
Evidence
+If you create a custom origin request policy for an Amazon S3 origin, we recommend that you don't include `response-content-type`, `response-content-disposition`, or `response-content-encoding`. If your policy includes all query strings, use an allow list instead.
Diff
diff --git a/AmazonCloudFront/latest/DeveloperGuide/origin-request-create-origin-request-policy.md b/AmazonCloudFront/latest/DeveloperGuide/origin-request-create-origin-request-policy.md index 6d5fe00..32996e8 100644 --- a//AmazonCloudFront/latest/DeveloperGuide/origin-request-create-origin-request-policy.md +++ b//AmazonCloudFront/latest/DeveloperGuide/origin-request-create-origin-request-policy.md @@ -18,0 +19,4 @@ To use an origin request policy, the cache behavior must also use a [cache polic +###### Note + +If you create a custom origin request policy for an Amazon S3 origin, we recommend that you don't include `response-content-type`, `response-content-disposition`, or `response-content-encoding`. If your policy includes all query strings, use an allow list instead. +