AWS AmazonCloudFront: Clarify percent-encoding behavior in signed cookie policy paths
Summary
Added a note that percent-encoded characters in request URLs are treated as data rather than URL delimiters, so wildcards can match across encoded forms such as %3B but not a literal semicolon. Also minor wording rephrasing of HTTPS/Set-Cookie guidance and example introductions.
Security assessment
Resource/Path matching in a signed-cookie custom policy determines which objects a viewer can access, so documenting that encoded delimiters are data (not delimiters) helps authors avoid overly broad or unexpectedly permissive wildcard scopes. It is a clarification of authorization scoping semantics rather than a fix for a specific vulnerability.
Evidence
A percent-encoded character in the request URL (such as `%3B` for `;`, `%3F` for `?`, or `%23` for `#`) is treated as data, not as a URL delimiter. For example, a wildcard can't match across a literal semicolon (`;`), but it can match across the encoded form (`%3B`). For more information, see [Values that you specify in the policy statement for a signed URL that uses a custom policy](./private-content-creating-signed-url-custom-policy.html#private-content-custom-policy-statement-values).
Diff
diff --git a/AmazonCloudFront/latest/DeveloperGuide/private-content-setting-signed-cookie-custom-policy.md b/AmazonCloudFront/latest/DeveloperGuide/private-content-setting-signed-cookie-custom-policy.md index 1becfacd9..9cc606815 100644 --- a//AmazonCloudFront/latest/DeveloperGuide/private-content-setting-signed-cookie-custom-policy.md +++ b//AmazonCloudFront/latest/DeveloperGuide/private-content-setting-signed-cookie-custom-policy.md @@ -73 +73 @@ The path for the requested file. If you don't specify a `Path` attribute, the de -Requires that the viewer encrypt cookies before sending a request. We recommend that you send the `Set-Cookie` header over an HTTPS connection to ensure that the cookie attributes are protected from man-in-the-middle attacks. +Requires that the viewer encrypt cookies before sending a request. We recommend that you send the `Set-Cookie` header over an HTTPS connection to make sure that the cookie attributes are protected from man-in-the-middle attacks. @@ -245,0 +246,2 @@ would include (for example) the following files: +A percent-encoded character in the request URL (such as `%3B` for `;`, `%3F` for `?`, or `%23` for `#`) is treated as data, not as a URL delimiter. For example, a wildcard can't match across a literal semicolon (`;`), but it can match across the encoded form (`%3B`). For more information, see [Values that you specify in the policy statement for a signed URL that uses a custom policy](./private-content-creating-signed-url-custom-policy.html#private-content-custom-policy-statement-values). + @@ -331 +333 @@ The following example custom policy in a signed cookie specifies that a user can -The following example custom policy allows you to create signed cookies for any file in the `training` directory, as indicated by the * 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 1, 2013 10:00 am UTC: +With the following example custom policy, you can create signed cookies for any file in the `training` directory, as indicated by the * 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 1, 2013 10:00 am UTC: @@ -356 +358 @@ Each signed cookie in which you use this policy includes a base URL that identif -The following sample custom policy allows you to set signed cookies for any file associated with any distribution, as indicated by the * wildcard character in the `Resource` parameter. 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 1, 2013 10:00 am UTC until January 2, 2013 10:00 am UTC: +With the following sample custom policy, you can set signed cookies for any file associated with any distribution, as indicated by the * wildcard character in the `Resource` parameter. 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 1, 2013 10:00 am UTC until January 2, 2013 10:00 am UTC: