Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Requests using chunked transfer encoding generated a "NullPointerException" in the parseHeader() function of ChunkedInputFilter.java when the last chunk was processed. Consequently, HTTP connection was aborted by tomcat. The underlying code has been amended, and HTTP connection is no longer lost in this situation.
Description of problem:
Requests using chunked transfer encoding will generate a NullPointerException in parseHeader() of ChunkedInputFilter.java when the zero-length last-chunk is processed.
Sample log entry from catalina.out:
Aug 01, 2014 12:34:56 AM org.apache.coyote.http11.Http11Processor process
SEVERE: Error finishing request
java.lang.NullPointerException
at org.apache.coyote.http11.filters.ChunkedInputFilter.parseHeader(ChunkedInputFilter.java:420)
at org.apache.coyote.http11.filters.ChunkedInputFilter.parseEndChunk(ChunkedInputFilter.java:409)
at org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:155)
at org.apache.coyote.http11.filters.ChunkedInputFilter.end(ChunkedInputFilter.java:208)
at org.apache.coyote.http11.InternalInputBuffer.endRequest(InternalInputBuffer.java:336)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:886)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Patch file tomcat6-6.0.24-CVE-2013-4322.patch, which was introduced with 6.0.24.64, modified the doRead() function in ChunkedInputFilter.java by adding the following line at the start of doRead():
this.request = req;
However, this line does not appear in the upstream tomcat6 source for ChunkedInputFilter.java. Is it a typo?
By overwriting 'request' at this point in doRead(), the NullPointerException occurs when the following line at the start of parseHeader() is executed when processing the last chunk (other chunks are processed without error):
MimeHeaders headers = request.getMimeHeaders();
The fix is to comment out (or remove) the "this.request = req;" line in the doRead() function in java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Version-Release number of selected component (if applicable):
tomcat6 6.0.24.64.el6
tomcat6 6.0.24.72.el6
How reproducible:
NullPointerException occurs every time
Steps to Reproduce:
1. Generate an HTTP request to tomcat using chunked Transfer Encoding, such as:
POST /application HTTP/1.1
Host: localhost:8080
Transfer-Encoding: chunked
2d
<html><body>TEST TEST TEST TEST</body></html>
0
Actual results:
java.lang.NullPointerException logged to catalina.out and HTTP connection is aborted by tomcat
Expected results:
No exceptions are logged and the HTTP connection is not aborted abnormally by tomcat
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-1461.html
Description of problem: Requests using chunked transfer encoding will generate a NullPointerException in parseHeader() of ChunkedInputFilter.java when the zero-length last-chunk is processed. Sample log entry from catalina.out: Aug 01, 2014 12:34:56 AM org.apache.coyote.http11.Http11Processor process SEVERE: Error finishing request java.lang.NullPointerException at org.apache.coyote.http11.filters.ChunkedInputFilter.parseHeader(ChunkedInputFilter.java:420) at org.apache.coyote.http11.filters.ChunkedInputFilter.parseEndChunk(ChunkedInputFilter.java:409) at org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:155) at org.apache.coyote.http11.filters.ChunkedInputFilter.end(ChunkedInputFilter.java:208) at org.apache.coyote.http11.InternalInputBuffer.endRequest(InternalInputBuffer.java:336) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:886) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:745) Patch file tomcat6-6.0.24-CVE-2013-4322.patch, which was introduced with 6.0.24.64, modified the doRead() function in ChunkedInputFilter.java by adding the following line at the start of doRead(): this.request = req; However, this line does not appear in the upstream tomcat6 source for ChunkedInputFilter.java. Is it a typo? By overwriting 'request' at this point in doRead(), the NullPointerException occurs when the following line at the start of parseHeader() is executed when processing the last chunk (other chunks are processed without error): MimeHeaders headers = request.getMimeHeaders(); The fix is to comment out (or remove) the "this.request = req;" line in the doRead() function in java/org/apache/coyote/http11/filters/ChunkedInputFilter.java Version-Release number of selected component (if applicable): tomcat6 6.0.24.64.el6 tomcat6 6.0.24.72.el6 How reproducible: NullPointerException occurs every time Steps to Reproduce: 1. Generate an HTTP request to tomcat using chunked Transfer Encoding, such as: POST /application HTTP/1.1 Host: localhost:8080 Transfer-Encoding: chunked 2d <html><body>TEST TEST TEST TEST</body></html> 0 Actual results: java.lang.NullPointerException logged to catalina.out and HTTP connection is aborted by tomcat Expected results: No exceptions are logged and the HTTP connection is not aborted abnormally by tomcat