yandrey321 commented on code in PR #11367:
URL: https://github.com/apache/ozone/pull/11367#discussion_r4146434425
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java:
##########
@@ -172,6 +172,29 @@ public final class HttpServer2 implements FilterContainer {
private static final int HTTP_IDLE_TIMEOUT_MS_DEFAULT = 60000;
private static final String HTTP_TEMP_DIR_KEY = "hadoop.http.temp.dir";
+ /**
+ * URI compliance mode used when {@code allowAmbiguousUri} is set. S3 object
+ * keys and WebHDFS paths legitimately contain empty path segments ("//"),
+ * percent encodings ("%25"), encoded path separators, and after decoding a
+ * backslash or other suspicious character (DEL and C0 controls), all of
which
+ * Jetty 12 rejects with 400 by default. Jetty 9.4 (pre-migration) had no
such
+ * check and passed these through, so relax those four violations to keep
that
+ * behavior; a decoded backslash or control byte is opaque key/path data in
+ * Ozone (which uses only "/" as a separator), so it does not open path
+ * traversal. Rather than Jetty's broad LEGACY mode -- which would also
+ * re-admit %2e/%2e%2e path traversal, UTF-16 and truncated UTF-8 encodings
and
+ * userinfo on the internet-facing S3 Gateway and HttpFS -- relax only those
+ * violations the use case needs. Genuinely illegal (unencoded) URI
characters
+ * such as "[" and "]" remain rejected, since conforming clients
percent-encode
+ * them.
+ */
+ private static final UriCompliance OZONE_AMBIGUOUS_URI_COMPLIANCE =
+ UriCompliance.DEFAULT.with("OZONE",
+ UriCompliance.Violation.AMBIGUOUS_EMPTY_SEGMENT,
+ UriCompliance.Violation.AMBIGUOUS_PATH_ENCODING,
+ UriCompliance.Violation.AMBIGUOUS_PATH_SEPARATOR,
+ UriCompliance.Violation.SUSPICIOUS_PATH_CHARACTERS);
Review Comment:
fixed
--
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]