Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UNDERTOW-2462] adds DEFAULT_ALLOW_ENCODED_SLASH #1677

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/src/main/java/io/undertow/UndertowOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,18 @@ public class UndertowOptions {
*/
public static final Option<Integer> MAX_COOKIES = Option.simple(UndertowOptions.class, "MAX_COOKIES", Integer.class);

/**
* Default value of {@link #ALLOW_ENCODED_SLASH} option.
*/
public static final Boolean DEFAULT_ALLOW_ENCODED_SLASH = Boolean.FALSE;

/**
* If a request comes in with encoded / characters (i.e. %2F), will these be decoded.
* <p>
* This can cause security problems if a front end proxy does not perform the same decoding, and as a result
* this is disabled by default.
* <p>
* Defaults to false
* Defaults to {@link #DEFAULT_ALLOW_ENCODED_SLASH}
* <p>
* See <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0450">CVE-2007-0450</a>
* @deprecated - this option was interpreted improperly.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/undertow/util/URLUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public static boolean isAbsoluteUrl(String location) {
}

public static boolean getSlashDecodingFlag(final OptionMap options) {
final boolean allowEncodedSlash = options.get(UndertowOptions.ALLOW_ENCODED_SLASH, false);
final boolean allowEncodedSlash = options.get(UndertowOptions.ALLOW_ENCODED_SLASH, UndertowOptions.DEFAULT_ALLOW_ENCODED_SLASH);
final Boolean decodeSlash = options.get(UndertowOptions.DECODE_SLASH);
return getSlashDecodingFlag(allowEncodedSlash, decodeSlash);
}
Expand Down
Loading