AWS AmazonCloudFront: CloudFront signed URL policy matching and percent-encoded URLs
Summary
Adds a new note explaining that CloudFront matches the policy Resource against the raw, undecoded request URL and that percent-encoded characters (e.g. %3B, %3F, %23) are treated as data, not delimiters, so wildcards can match across encoded forms; also rewords two example intros.
Security assessment
The new paragraph is explicit access-control guidance for signed URL custom policies: it warns that wildcard matching operates on the raw URL and can span percent-encoded delimiter characters, which is directly relevant to preventing wildcard/encoding mismatches that could grant access to unintended paths. It documents behavior rather than announcing a fix, so no concrete vulnerability is referenced.
Evidence
+**Percent-encoded characters** – CloudFront matches the policy `Resource` against the raw (undecoded) request URL and forwards that URL to the origin unchanged. A percent-encoded character in the request URL, such as `%3B` for `;`, `%3F` for `?`, or `%23` for `#`, is treated as data rather than as a URL delimiter.
Diff
diff --git a/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.md b/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.md index bc73fe299..65e70c1c8 100644 --- a//AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.md +++ b//AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.md @@ -213,0 +214,2 @@ For example, the value: `https://d111111abcdef8.cloudfront.net/*game_download.zi +**Percent-encoded characters** – CloudFront matches the policy `Resource` against the raw (undecoded) request URL and forwards that URL to the origin unchanged. A percent-encoded character in the request URL, such as `%3B` for `;`, `%3F` for `?`, or `%23` for `#`, is treated as data rather than as a URL delimiter. For more information, see [RFC 3986](https://tools.ietf.org/html/rfc3986) on the IETF website. For example, a wildcard can't match across a literal semicolon (`;`), but it can match across the encoded form (`%3B`). + @@ -301 +303 @@ The following example custom policy in a signed URL specifies that a user can ac -The following example custom policy allows you to create signed URLs for any file in the `training` directory, as indicated by the asterisk wildcard character (`*`) in the `Resource` parameter. Users can access the file from an IP address in the range `192.0.2.0/24` until January 31, 2023 10:00 AM UTC: +With the following example custom policy, you can create signed URLs for any file in the `training` directory, as indicated by the asterisk wildcard character (`*`) in the `Resource` parameter. Users can access the file from an IP address in the range `192.0.2.0/24` until January 31, 2023 10:00 AM UTC: @@ -326 +328 @@ Each signed URL with which you use this policy has a URL that identifies a speci -The following example custom policy allows you to create signed URLs for any file associated with any distribution, as indicated by the asterisk wildcard character (`*`) in the `Resource` parameter. The signed URL must use the `https://` protocol, not `http://`. The user must use the IP address `192.0.2.10/32`. (The value `192.0.2.10/32` in CIDR notation refers to a single IP address, `192.0.2.10`.) The files are available only from January 31, 2023 10:00 AM UTC until February 2, 2023 10:00 AM UTC: +With the following example custom policy, you can create signed URLs for any file associated with any distribution, as indicated by the asterisk wildcard character (`*`) in the `Resource` parameter. The signed URL must use the `https://` protocol, not `http://`. The user must use the IP address `192.0.2.10/32`. (The value `192.0.2.10/32` in CIDR notation refers to a single IP address, `192.0.2.10`.) The files are available only from January 31, 2023 10:00 AM UTC until February 2, 2023 10:00 AM UTC: