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

Add TRANSFER_ENCODING violation for MultiPart RFC7578 parser. #7976

Merged

Conversation

lachlan-roberts
Copy link
Contributor

Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question about the scope of the violation, to eliminate harmless conditions leaving harmful ones to only trigger.

@@ -610,7 +637,8 @@ else if (key.equalsIgnoreCase("content-type"))

// Transfer encoding is not longer considers as it is deprecated as per
// https://tools.ietf.org/html/rfc7578#section-4.7

if (key.equalsIgnoreCase("content-transfer-encoding"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be more subtle about this?

There are 3 Content-Transfer-Encoding scenarios that are not a violation (as they basically mean nothing more than "identity" or "no encoding")

  • Content-Transfer-Encoding: 8bit (common enough in older httpclients)
  • Content-Transfer-Encoding: binary (also common enough, Apache HttpClient will use this for example)
  • Content-Transfer-Encoding: 7bit (this one is iffy)

So that any other value is a violation

@lachlan-roberts lachlan-roberts merged commit 9438e50 into jetty-9.4.x May 12, 2022
@lachlan-roberts lachlan-roberts deleted the jetty-9.4.x-MultiPartNonComplianceViolations branch May 12, 2022 04:31
lachlan-roberts added a commit that referenced this pull request May 12, 2022
* Add TRANSFER_ENCODING violation for MultiPart RFC7578 parser.
* Ignore TRANSFER_ENCODING violation for 8bit and binary.

Signed-off-by: Lachlan Roberts <[email protected]>
lachlan-roberts added a commit that referenced this pull request May 16, 2022
Add TRANSFER_ENCODING violation for MultiPart RFC7578 parser. (#7976)
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