chungen0126 commented on code in PR #11061:
URL: https://github.com/apache/ozone/pull/11061#discussion_r3891562967
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/SignedChunksInputStream.java:
##########
@@ -72,10 +77,22 @@
public class SignedChunksInputStream extends InputStream {
private final Pattern signatureLinePattern =
- Pattern.compile("([0-9A-Fa-f]+);chunk-signature=.*");
+ Pattern.compile("([0-9A-Fa-f]+);chunk-signature=(.*)");
Review Comment:
The regular expression here could be made stricter to limit the length of
the `chunk-signature`. Since an HMAC-SHA256 signature is always exactly 64 hex
characters, using `(.*)` seems a bit too permissive.
```suggestion
Pattern.compile("([0-9A-Fa-f]+);chunk-signature=([a-fA-F0-9]{64})");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]