Reject the NULL character in paths in StrictHttpFirewall
Adds `setAllowNull` By default, denies null in paths
This commit is contained in:
committed by
Josh Cummings
parent
406cde8798
commit
efb6953017
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -377,6 +377,18 @@ public class StrictHttpFirewallTests {
|
||||
this.firewall.getFirewalledRequest(this.request);
|
||||
}
|
||||
|
||||
@Test(expected = RequestRejectedException.class)
|
||||
public void getFirewalledRequestWhenContainsNullThenException() {
|
||||
this.request.setRequestURI("/\0");
|
||||
this.firewall.getFirewalledRequest(this.request);
|
||||
}
|
||||
|
||||
@Test(expected = RequestRejectedException.class)
|
||||
public void getFirewalledRequestWhenContainsEncodedNullThenException() {
|
||||
this.request.setRequestURI("/something%00/");
|
||||
this.firewall.getFirewalledRequest(this.request);
|
||||
}
|
||||
|
||||
// --- from DefaultHttpFirewallTests ---
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user