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.
Bug 1128396 - NullPointerException in chunked transfer encoding input filter when processing last-chunk
Summary: NullPointerException in chunked transfer encoding input filter when processin...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tomcat6
Version: 6.5
Hardware: noarch
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: David Knox
QA Contact: tomcat-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-10 02:30 UTC by stein
Modified: 2023-09-14 02:45 UTC (History)
9 users (show)

Fixed In Version: tomcat6-6.0.24-87.el6
Doc Type: Bug Fix
Doc Text:
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.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:27:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1461 0 normal SHIPPED_LIVE tomcat6 bug fix and enhancement update 2015-07-21 14:14:55 UTC

Description stein 2014-08-10 02:30:22 UTC
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

Comment 2 stein 2014-08-13 20:55:06 UTC
error still occurs with tomcat6 6.0.24.78.el6

Comment 8 errata-xmlrpc 2015-07-22 07:27:52 UTC
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

Comment 9 Red Hat Bugzilla 2023-09-14 02:45:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.