forked from eclipse-ee4j/grizzly
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fish 9690 filtering incorrect characters from header rfc 9110 #39
Closed
breakponchito
wants to merge
73
commits into
payara:4.0.0.payara-maintenance
from
breakponchito:FISH-9690-filtering-incorrect-characters-from-header-rfc-9110
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FISH-376 Allow finer configuration details of HTTP GZIP compression
…nfiguration Finer configuration of GZIP Compression
as java8 is a compile time requirement, the checks for jvm version before java7 makes no sense anymore. Remove unused JdkVersion class. Signed-off-by: Tigran Mkrtchyan <[email protected]>
This fixes temporary file information disclosure vulnerability due to the use of the vulnerable `File.createTempFile()` method. The vulnerability is fixed by using the `Files.createTempFile()` method which sets the correct posix permissions. Weakness: CWE-377: Insecure Temporary File Severity: Medium CVSSS: 5.5 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.SecureTempFileCreation) Reported-by: Jonathan Leitschuh <[email protected]> Signed-off-by: Jonathan Leitschuh <[email protected]> Bug-tracker: JLLeitschuh/security-research#18 Co-authored-by: Moderne <[email protected]>
the rest of the code uses java.util.concurrent.ThreadLocalRandom. Thus no reasons tho have a private unused copy ot it.
The NullaryFunction has an equivalent in standard java API. So, lets use it.
Fixes eclipse-ee4j#2122 - Manifests should contain automatic module names
SSLParameters is a class introduced in java6 which can take over SSLEngineConfigurator. As a first step, let allow applications to use SSLParameters to configure SSLEngineConfigurator. Update SSLEngineConfigurator to use it internally instead of bunch of class fields. Signed-off-by: Tigran Mkrtchyan <[email protected]>
utils: remove unused version of ThreadLocalRandom
ssl: introduce SSLEngineConfigurator#setSSLParameters
src: drop NullaryFunction in favor or java.util.Supplier
…tV2/fix/JLL/temporary_file_local_information_disclosure [SECURITY] Fix Temporary File Information Disclosure Vulnerability
SpotBugs analysis: Holder.toString() may return null eclipse-ee4j#2182
Signed-off-by: Arjan Tijms <[email protected]>
Next version is 4.0.1
Signed-off-by: Arjan Tijms <[email protected]>
Update versions in poms and adjust pom where needed for that
This way subclasses making use of this ctor can set parameters without getting NPE. Signed-off-by: Arjan Tijms <[email protected]>
Create empty SSL parameters in protected ctor
Signed-off-by: Arjan Tijms <[email protected]>
Fix generation of javadoc
The commit cb5fdde have dropped NullaryFunction in favor or java.util.Supplier, however, the deprecation annotation was not removed. fixes: eclipse-ee4j#2196 Signed-off-by: Tigran Mkrtchyan <[email protected]>
Fixes eclipse-ee4j#2192 - Grizzly 2.4.4/4.0.0 missing Content-Type in response
src: remove unintended deprecation annotation
…aracters-from-header-rfc-9110' into FISH-9690-filtering-incorrect-characters-from-header-rfc-9110
breakponchito
changed the base branch from
4.0.0.payara-maintenance
to
4.0.2.payara-maintenance
December 9, 2024 22:09
…tenance' into FISH-9690-filtering-incorrect-characters-from-header-rfc-9110 # Conflicts: # boms/bom/pom.xml # extras/bundles/grizzly-httpservice-bundle/pom.xml # extras/bundles/pom.xml # extras/connection-pool/pom.xml # extras/grizzly-httpservice/pom.xml # extras/http-server-jaxws/pom.xml # extras/http-server-multipart/pom.xml # extras/http-servlet-extras/pom.xml # extras/pom.xml # extras/tls-sni/pom.xml # modules/bundles/comet/pom.xml # modules/bundles/core/pom.xml # modules/bundles/http-all/pom.xml # modules/bundles/http-servlet/pom.xml # modules/bundles/http/pom.xml # modules/bundles/pom.xml # modules/bundles/websockets/pom.xml # modules/comet/pom.xml # modules/comet/src/main/java/module-info.java # modules/grizzly/pom.xml # modules/grizzly/src/main/java/org/glassfish/grizzly/compression/zip/GZipEncoder.java # modules/http-ajp/pom.xml # modules/http-server/pom.xml # modules/http-servlet/pom.xml # modules/http/pom.xml # modules/http2/pom.xml # modules/monitoring/grizzly/pom.xml # modules/monitoring/http-server/pom.xml # modules/monitoring/http/pom.xml # modules/monitoring/pom.xml # modules/pom.xml # modules/portunif/pom.xml # modules/websockets/pom.xml # pom.xml # samples/connection-pool-samples/pom.xml # samples/framework-samples/pom.xml # samples/http-ajp-samples/pom.xml # samples/http-jaxws-samples/pom.xml # samples/http-multipart-samples/pom.xml # samples/http-samples/pom.xml # samples/http-server-samples/pom.xml # samples/pom.xml # samples/portunif/pom.xml # samples/tls-sni-samples/pom.xml
breakponchito
changed the base branch from
4.0.2.payara-maintenance
to
4.0.0.payara-maintenance
December 10, 2024 14:54
Signed-off-by: Andrew Pielage <[email protected]>
FISH-376 Allow finer configuration details of HTTP GZIP compression
as java8 is a compile time requirement, the checks for jvm version before java7 makes no sense anymore. Remove unused JdkVersion class. Signed-off-by: Tigran Mkrtchyan <[email protected]>
the rest of the code uses java.util.concurrent.ThreadLocalRandom. Thus no reasons tho have a private unused copy ot it.
SSLParameters is a class introduced in java6 which can take over SSLEngineConfigurator. As a first step, let allow applications to use SSLParameters to configure SSLEngineConfigurator. Update SSLEngineConfigurator to use it internally instead of bunch of class fields. Signed-off-by: Tigran Mkrtchyan <[email protected]>
The NullaryFunction has an equivalent in standard java API. So, lets use it.
This fixes temporary file information disclosure vulnerability due to the use of the vulnerable `File.createTempFile()` method. The vulnerability is fixed by using the `Files.createTempFile()` method which sets the correct posix permissions. Weakness: CWE-377: Insecure Temporary File Severity: Medium CVSSS: 5.5 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.SecureTempFileCreation) Reported-by: Jonathan Leitschuh <[email protected]> Signed-off-by: Jonathan Leitschuh <[email protected]> Bug-tracker: JLLeitschuh/security-research#18 Co-authored-by: Moderne <[email protected]>
This way subclasses making use of this ctor can set parameters without getting NPE. Signed-off-by: Arjan Tijms <[email protected]>
Signed-off-by: Arjan Tijms <[email protected]>
The commit cb5fdde have dropped NullaryFunction in favor or java.util.Supplier, however, the deprecation annotation was not removed. fixes: eclipse-ee4j#2196 Signed-off-by: Tigran Mkrtchyan <[email protected]>
Pandrex247
requested changes
Dec 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebasing onto 4.0.0 without all of the 4.0.2 commits
…aracters-from-header-rfc-9110' into FISH-9690-filtering-incorrect-characters-from-header-rfc-9110
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a PR to include new properties on the grizzly implementation to enable Header Name and Header Value validation against invalid characters mentioned on the RFC-9110, here the reference of the reported issue: Glassfish issue and here the reserved CVE CVE-2024-45687
To test this set the dependency version on the payara server: 4.0.2.payara-p2 build and run
deploy the following reproducer:
ReproducerJDK11.zip
after starting the server set the following properties on the Payara configuration. You can do it by console ui, command line or directly on the domain.xml file:
asadmin create-jvm-options --target=server-config "-Dorg.glassfish.grizzly.http.STRICT_HEADER_NAME_VALIDATION_RFC_9110\=true"
asadmin create-jvm-options --target=server-config "-Dorg.glassfish.grizzly.http.STRICT_HEADER_VALUE_VALIDATION_RFC_9110\=true"
after adding the properties you need to restart the server
by default on the grizzly side those properties are set as false
deploy the reproducer and make curl calls
Header Name Validation tests:
the result of any of those test should be error 400:
this will return status 200 but the header will be discarted because of the \0 character
Header Value Validations tests:
In the case of header validation we can't be very strict on the validation that is why the \n is permitted an is evaluated as a new line on the content for the header value and the \0 is immediately not processed from curl because by default we can't consider that character on the request headers and the \r character can be included as a character on the header values and this will be rejected