[
https://issues.apache.org/jira/browse/HDDS-17766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Billy Shen reassigned HDDS-17766:
---------------------------------
Assignee: Billy Shen
> S3 Gateway returns 500 for malformed numbers in request headers and parameters
> ------------------------------------------------------------------------------
>
> Key: HDDS-17766
> URL: https://issues.apache.org/jira/browse/HDDS-17766
> Project: Apache Ozone
> Issue Type: Bug
> Reporter: Chung-En Lee
> Assignee: Billy Shen
> Priority: Major
>
> A malformed number in several request headers and query parameters makes S3
> Gateway return HTTP 500 instead of a 4xx error, for example:
> * {{x-amz-decoded-content-length: abc}} on aws-chunked PutObject or
> UploadPart (HDDS-17319 fixed only non-streaming PutObject)
> * {{part-number-marker=abc}} on ListParts
> * {{x-amz-copy-source-range: bytes=0-99999999999999999999}} on UploadPartCopy
> * {{X-Amz-Expires=abc}} on a presigned URL
> Actual: HTTP 500. AWS SDKs retry 5xx responses by default, so the client
> keeps resending a request that can never succeed.
> Expected: a 4xx S3 error such as {{InvalidArgument}}, so the client fails at
> once without retrying.
> Proposal: these values are parsed with {{Long.parseLong}} /
> {{Integer.parseInt}}, and nothing handles the {{NumberFormatException}}. Add
> a shared parsing helper that turns it into a 4xx S3 error, like
> {{RequestParameters#getInt}} already does for query parameters, and use it
> wherever a request value is parsed as a number.
> The signed aws-chunked chunk size has the same problem; HDDS-17476 tracks it.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]