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

Fish 9690 filtering incorrect characters from header rfc 9110 #41

Conversation

breakponchito
Copy link

@breakponchito breakponchito commented Nov 13, 2024

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: 2.3.31.payara-p5 build and run
deploy the following reproducer:
MinimalTest.zip

By default grizzly is setting two new properties that enable the validation of the headers by default. You can customize this behavior by seeting the following properties from UI or by cli command o directly on the domain.xml file

  • -Dorg.glassfish.grizzly.http.STRICT_HEADER_NAME_VALIDATION_RFC_9110=true
  • -Dorg.glassfish.grizzly.http.STRICT_HEADER_VALUE_VALIDATION_RFC_9110=true

image

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 true

deploy the reproducer and make curl calls

Header Name Validation tests:

the result of any of those test should be error 400:

image

The following request will return 200 but the \0 will be removed and not accepted :

image

Header Value Validations tests:

image

The \0 is immediately not processed from curl because by default we can't consider that character on the request headers and the the \r and \n characters are not permitted alone on the header value content

…alidation against invalid characters RFC-9110
@breakponchito breakponchito changed the title FISH-9690: adding properties to enable Header Name and Header Value v… Fish 9690 filtering incorrect characters from header rfc 9110 Nov 13, 2024
@breakponchito breakponchito merged commit f9a6956 into payara:2.3.31.payara-maintenance Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants