question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-proper handling of Content-Length and Transfer-Encoding: chunked headers

See original GitHub issue

Expected behavior

1.Only accept one Content-Length.RFC 7230 says duplicate Content-Length header fields have been generated or combined by an upstream message processor, then the recipient MUST either reject the message as invalid or replace the duplicated field-values with a single valid Content-Length. 2.Only accept identity and chunked Transport-Encoding In this implementation, the order does not matter (it probably should). The Go implementation only uses the first value of the header.Seems to be in sync with the behaviour of AWS ALB. All other valid (gzip, compress, etc.) and invalid TE will return a 501, since we don’t have readers for them I figured this was the right move, but feel free to correct me

Actual behavior

  1. But netty accept all. 2.Netty accpet random TE.

Steps to reproduce

Use two CL to reproduce the first. Use a chunked TE header and a random TE header. Smiliar with 9571. It also cause http smuggling. Or see the other issue benoitc/gunicorn#2176 and the PR benoitc/gunicorn#2181

Minimal yet complete reproducer code (or URL to code)

Netty version

all

JVM version (e.g. java -version)

OS version (e.g. uname -a)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
artem-smotrakovcommented, Feb 5, 2020

@normanmaurer No problem, I’ll open a pull request.

0reactions
normanmaurercommented, Feb 24, 2020

@JLLeitschuh sorry but no backport will be done … netty 3.x is EOL for many years and if projects did not update yet they may have a reason to do now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transfer-Encoding - HTTP - MDN Web Docs
The Transfer-Encoding header specifies the form of encoding used to safely transfer the payload body to the user.
Read more >
Chunked encoding and content-length header - Stack Overflow
the scenario I'm thinking about is when you have a large file to transfer and there's no problem in determining its size, but...
Read more >
Incorrect Handling Of Transfer-Encoding Header • Akka HTTP
HTTP /1.1 defines rules which Transfer-Encoding headers are valid and how they should be interpreted. In particular, a Transfer-Encoding: chunked ...
Read more >
Clients receive responses with no Content-Length header and ...
Clients receive responses with no Content-Length header and a chunked encoded body after upgrading Tanzu Application Service for VMs ...
Read more >
Search Results - CVE
When presented with a content-length and a chunked encoding header, the content-length was ignored (as per RFC 2616). If an intermediary decided on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found