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

The check on LimitRequestFields on headers of HTTP/2 fails to recognize LimitRequestFields = "0" condition - infinite number of fields as outlined in the documentation #200

Closed
DmitryFrolovTri opened this issue Jul 7, 2020 · 2 comments

Comments

@DmitryFrolovTri
Copy link

Following condition:

if (stream->request_headers_added > session->s->limit_req_fields + 4) {

should not be executed at all in case LimitRequestFields == 0. (I suppose it should skip if "session->s->limit_req_fields == 0", but not 100% sure may be there is another place where LimitRequestFields read from config is stored)
In the documentation:
http://httpd.apache.org/docs/2.4/mod/core.html#LimitRequestFields

So seems that HTTP/2 behaviour is different vs the documentation

@icing
Copy link
Owner

icing commented Jul 8, 2020

Well, just saw this after the release. Let's see if the changes regarding #201 work for you. Then I can add the fix for this one. ;)

@DmitryFrolovTri
Copy link
Author

DmitryFrolovTri commented Jul 9, 2020

yes the changes of #201 are fine, thank you.

@icing icing closed this as completed in 005dc46 Jul 13, 2020
asfgit pushed a commit to apache/httpd that referenced this issue Jul 13, 2020
     Fixes <icing/mod_h2#200>: 
     "LimitRequestFields 0" now disables the limit, as documented.
     Fixes <icing/mod_h2#201>: 
     Do not count repeated headers with same name against the field
     count limit. The are merged internally, as if sent in a single HTTP/1 line.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879832 13f79535-47bb-0310-9956-ffa450edef68
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 9, 2020
Update apache24 to 2.4.46 (Apache HTTPD 2.4.46).  It fixes several
security problems:

CVE-2020-9490: Push Diary Crash on Specifically Crafted HTTP/2 Header
CVE-2020-11984: mod_uwsgi buffer overlow
CVE-2020-11985: CWE-345: Insufficient verification of data authenticity
CVE-2020-11993: Push Diary Crash on Specifically Crafted HTTP/2 Header

pkgsrc changes: reduce warnings by SUBST_* processing.


Changes with Apache 2.4.46
  *) mod_proxy_fcgi: Fix build warnings for Windows platform
     [Eric Covener, Christophe Jaillet]

Changes with Apache 2.4.45

  *) mod_http2: remove support for abandoned http-wg draft
     <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>.
     [Stefan Eissing]

Changes with Apache 2.4.44

  *) mod_proxy_uwsgi: Error out on HTTP header larger than 16K (hard
     protocol limit).  [Yann Ylavic]

  *) mod_http2:
     Fixes <icing/mod_h2#200>:
     "LimitRequestFields 0" now disables the limit, as documented.
     Fixes <icing/mod_h2#201>:
     Do not count repeated headers with same name against the field
     count limit. The are merged internally, as if sent in a single HTTP/1 line.
     [Stefan Eissing]

  *) mod_http2: Avoid segfaults in case of handling certain responses for
     already aborted connections.  [Stefan Eissing, Ruediger Pluem]

  *) mod_http2: The module now handles master/secondary connections and has marked
     methods according to use. [Stefan Eissing]

  *) core: Drop an invalid Last-Modified header value coming
     from a FCGI/CGI script instead of replacing it with Unix epoch.
     [Yann Ylavic, Luca Toscano]

  *) Add support for strict content-length parsing through addition of
     ap_parse_strict_length() [Yann Ylavic]

  *) mod_proxy_fcgi: ProxyFCGISetEnvIf unsets variables when expression
     evaluates to false.  PR64365. [Michael König <mail ikoenig.net>]

  *) mod_proxy_http: flush spooled request body in one go to avoid
     leaking (or long lived) temporary file. PR 64452. [Yann Ylavic]

  *) mod_ssl: Fix a race condition and possible crash when using a proxy client
     certificate (SSLProxyMachineCertificateFile).
     [Armin Abfalterer <a.abfalterer gmail.com>]

  *) mod_ssl: Fix memory leak in stapling code. PR63687. [Stefan Eissing]

  *) mod_http2: Fixed regression that no longer set H2_STREAM_ID and H2_STREAM_TAG.
     PR64330 [Stefan Eissing]

  *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
     was configured with a handshake timeout. Fixes gitub issue #196.
     [Stefan Eissing]

  *) mod_proxy_http2: the "ping" proxy parameter
     (see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
     when checking the liveliness of a new or reused h2 connection to the backend.
     With short durations, this makes load-balancing more responsive. The module
     will hold back requests until ping conditions are met, using features of the
     HTTP/2 protocol alone. [Ruediger Pluem, Stefan Eissing]

  *) core: httpd is no longer linked against -lsystemd if mod_systemd
     is enabled (and built as a DSO).  [Rainer Jung]

  *) mod_proxy_http2: respect ProxyTimeout settings on backend connections
     while waiting on incoming data. [Ruediger Pluem, Stefan Eissing]
clrpackages pushed a commit to clearlinux-pkgs/httpd that referenced this issue Aug 12, 2020
Changes with Apache 2.4.46
  *) SECURITY: CVE-2020-11984 (cve.mitre.org)
     mod_proxy_uwsgi: Malicious request may result in information disclosure
     or RCE of existing file on the server running under a malicious process
     environment. [Yann Ylavic]

  *) SECURITY: CVE-2020-11993 (cve.mitre.org)
     mod_http2: when throttling connection requests, log statements
     where possibly made that result in concurrent, unsafe use of
     a memory pool. [Stefan Eissing]

  *) SECURITY:
     mod_http2: a specially crafted value for the 'Cache-Digest' header
     request would result in a crash when the server actually tries
     to HTTP/2 PUSH a resource afterwards.
     [Stefan Eissing, Eric Covener, Christophe Jaillet]

  *) mod_proxy_fcgi: Fix build warnings for Windows platform

Changes with Apache 2.4.45

  *) mod_http2: remove support for abandoned http-wg draft
     <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>.
     [Stefan Eissing]

Changes with Apache 2.4.44

  *) mod_proxy_uwsgi: Error out on HTTP header larger than 16K (hard
     protocol limit).  [Yann Ylavic]

  *) mod_http2:
     Fixes <icing/mod_h2#200>:
     "LimitRequestFields 0" now disables the limit, as documented.
     Fixes <icing/mod_h2#201>:
     Do not count repeated headers with same name against the field
     count limit. The are merged internally, as if sent in a single HTTP/1 line.
     [Stefan Eissing]

  *) mod_http2: Avoid segfaults in case of handling certain responses for
     already aborted connections.  [Stefan Eissing, Ruediger Pluem]

  *) mod_http2: The module now handles master/secondary connections and has marked
     methods according to use. [Stefan Eissing]

  *) core: Drop an invalid Last-Modified header value coming
     from a FCGI/CGI script instead of replacing it with Unix epoch.
     [Yann Ylavic, Luca Toscano]

  *) Add support for strict content-length parsing through addition of
     ap_parse_strict_length() [Yann Ylavic]

  *) mod_proxy_fcgi: ProxyFCGISetEnvIf unsets variables when expression
     evaluates to false.  PR64365. [Michael König <mail ikoenig.net>]

  *) mod_proxy_http: flush spooled request body in one go to avoid
     leaking (or long lived) temporary file. PR 64452. [Yann Ylavic]

  *) mod_ssl: Fix a race condition and possible crash when using a proxy client
     certificate (SSLProxyMachineCertificateFile).
     [Armin Abfalterer <a.abfalterer gmail.com>]

  *) mod_ssl: Fix memory leak in stapling code. PR63687. [Stefan Eissing]

  *) mod_http2: Fixed regression that no longer set H2_STREAM_ID and H2_STREAM_TAG.
     PR64330 [Stefan Eissing]

  *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
     was configured with a handshake timeout. Fixes gitub issue #196.
     [Stefan Eissing]

  *) mod_proxy_http2: the "ping" proxy parameter
     (see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
     when checking the liveliness of a new or reused h2 connection to the backend.
     With short durations, this makes load-balancing more responsive. The module
     will hold back requests until ping conditions are met, using features of the
     HTTP/2 protocol alone. [Ruediger Pluem, Stefan Eissing]

  *) core: httpd is no longer linked against -lsystemd if mod_systemd
     is enabled (and built as a DSO).  [Rainer Jung]

  *) mod_proxy_http2: respect ProxyTimeout settings on backend connections
     while waiting on incoming data. [Ruediger Pluem, Stefan Eissing]

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
laffer1 added a commit to MidnightBSD/mports that referenced this issue Aug 16, 2020
Changes with Apache 2.4.46
  *) SECURITY: CVE-2020-11984 (cve.mitre.org)
     mod_proxy_uwsgi: Malicious request may result in information disclosure
     or RCE of existing file on the server running under a malicious process
     environment. [Yann Ylavic]

  *) SECURITY: CVE-2020-11993 (cve.mitre.org)
     mod_http2: when throttling connection requests, log statements
     where possibly made that result in concurrent, unsafe use of
     a memory pool. [Stefan Eissing]

  *) SECURITY:
     mod_http2: a specially crafted value for the 'Cache-Digest' header
     request would result in a crash when the server actually tries
     to HTTP/2 PUSH a resource afterwards.
     [Stefen Eissing, Eric Covener, Christophe Jaillet]

  *) mod_proxy_fcgi: Fix build warnings for Windows platform

Changes with Apache 2.4.45

  *) mod_http2: remove support for abandoned http-wg draft
     <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>.
     [Stefan Eissing]

Changes with Apache 2.4.44

  *) mod_proxy_uwsgi: Error out on HTTP header larger than 16K (hard
     protocol limit).  [Yann Ylavic]

  *) mod_http2:
     Fixes <icing/mod_h2#200>:
     "LimitRequestFields 0" now disables the limit, as documented.
     Fixes <icing/mod_h2#201>:
     Do not count repeated headers with same name against the field
     count limit. The are merged internally, as if sent in a single HTTP/1 line.
     [Stefan Eissing]

  *) mod_http2: Avoid segfaults in case of handling certain responses for
     already aborted connections.  [Stefan Eissing, Ruediger Pluem]

  *) mod_http2: The module now handles master/secondary connections and has marked
     methods according to use. [Stefan Eissing]

  *) core: Drop an invalid Last-Modified header value coming
     from a FCGI/CGI script instead of replacing it with Unix epoch.
     [Yann Ylavic, Luca Toscano]

  *) Add support for strict content-length parsing through addition of
     ap_parse_strict_length() [Yann Ylavic]

  *) mod_proxy_fcgi: ProxyFCGISetEnvIf unsets variables when expression
     evaluates to false.  PR64365. [Michael König <mail ikoenig.net>]

  *) mod_proxy_http: flush spooled request body in one go to avoid
     leaking (or long lived) temporary file. PR 64452. [Yann Ylavic]

  *) mod_ssl: Fix a race condition and possible crash when using a proxy client
     certificate (SSLProxyMachineCertificateFile).
     [Armin Abfalterer <a.abfalterer gmail.com>]

  *) mod_ssl: Fix memory leak in stapling code. PR63687. [Stefan Eissing]

  *) mod_http2: Fixed regression that no longer set H2_STREAM_ID and H2_STREAM_TAG.
     PR64330 [Stefan Eissing]

  *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
     was configured with a handshake timeout. Fixes gitub issue #196.
     [Stefan Eissing]

  *) mod_proxy_http2: the "ping" proxy parameter
     (see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
     when checking the liveliness of a new or reused h2 connection to the backend.
     With short durations, this makes load-balancing more responsive. The module
     will hold back requests until ping conditions are met, using features of the
     HTTP/2 protocol alone. [Ruediger Pluem, Stefan Eissing]

  *) core: httpd is no longer linked against -lsystemd if mod_systemd
     is enabled (and built as a DSO).  [Rainer Jung]

  *) mod_proxy_http2: respect ProxyTimeout settings on backend connections
     while waiting on incoming data. [Ruediger Pluem, Stefan Eissing]
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 23, 2020
www/apache24: security fix

Revisions pulled up:
- www/apache24/Makefile                                         1.94
- www/apache24/distinfo                                         1.44

---
   Module Name:    pkgsrc
   Committed By:   taca
   Date:           Sun Aug  9 15:01:55 UTC 2020

   Modified Files:
           pkgsrc/www/apache24: Makefile distinfo

   Log Message:
   www/apache24: update to 2.4.46

   Update apache24 to 2.4.46 (Apache HTTPD 2.4.46).  It fixes several
   security problems:

   CVE-2020-9490: Push Diary Crash on Specifically Crafted HTTP/2 Header
   CVE-2020-11984: mod_uwsgi buffer overlow
   CVE-2020-11985: CWE-345: Insufficient verification of data authenticity
   CVE-2020-11993: Push Diary Crash on Specifically Crafted HTTP/2 Header

   pkgsrc changes: reduce warnings by SUBST_* processing.

   Changes with Apache 2.4.46
     *) mod_proxy_fcgi: Fix build warnings for Windows platform
        [Eric Covener, Christophe Jaillet]

   Changes with Apache 2.4.45

     *) mod_http2: remove support for abandoned http-wg draft
        <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>.
        [Stefan Eissing]

   Changes with Apache 2.4.44

     *) mod_proxy_uwsgi: Error out on HTTP header larger than 16K (hard
        protocol limit).  [Yann Ylavic]

     *) mod_http2:
        Fixes <icing/mod_h2#200>:
        "LimitRequestFields 0" now disables the limit, as documented.
        Fixes <icing/mod_h2#201>:
        Do not count repeated headers with same name against the field
        count limit. The are merged internally, as if sent in a single HTTP/1 line.
        [Stefan Eissing]

     *) mod_http2: Avoid segfaults in case of handling certain responses for
        already aborted connections.  [Stefan Eissing, Ruediger Pluem]

     *) mod_http2: The module now handles master/secondary connections and has marked
        methods according to use. [Stefan Eissing]

     *) core: Drop an invalid Last-Modified header value coming
        from a FCGI/CGI script instead of replacing it with Unix epoch.
        [Yann Ylavic, Luca Toscano]

     *) Add support for strict content-length parsing through addition of
        ap_parse_strict_length() [Yann Ylavic]

     *) mod_proxy_fcgi: ProxyFCGISetEnvIf unsets variables when expression
        evaluates to false.  PR64365. [Michael König <mail ikoenig.net>]

     *) mod_proxy_http: flush spooled request body in one go to avoid
        leaking (or long lived) temporary file. PR 64452. [Yann Ylavic]

     *) mod_ssl: Fix a race condition and possible crash when using a proxy client
        certificate (SSLProxyMachineCertificateFile).
        [Armin Abfalterer <a.abfalterer gmail.com>]

     *) mod_ssl: Fix memory leak in stapling code. PR63687. [Stefan Eissing]

     *) mod_http2: Fixed regression that no longer set H2_STREAM_ID and H2_STREAM_TAG.
        PR64330 [Stefan Eissing]

     *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
        was configured with a handshake timeout. Fixes gitub issue #196.
        [Stefan Eissing]

     *) mod_proxy_http2: the "ping" proxy parameter
        (see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
        when checking the liveliness of a new or reused h2 connection to the backend.
        With short durations, this makes load-balancing more responsive. The module
        will hold back requests until ping conditions are met, using features of the
        HTTP/2 protocol alone. [Ruediger Pluem, Stefan Eissing]

     *) core: httpd is no longer linked against -lsystemd if mod_systemd
        is enabled (and built as a DSO).  [Rainer Jung]

     *) mod_proxy_http2: respect ProxyTimeout settings on backend connections
        while waiting on incoming data. [Ruediger Pluem, Stefan Eissing]
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 14, 2021
www/apache24: security fix

Revisions pulled up:
- www/apache24/Makefile                                         1.94
- www/apache24/distinfo                                         1.44

---
   Module Name:    pkgsrc
   Committed By:   taca
   Date:           Sun Aug  9 15:01:55 UTC 2020

   Modified Files:
           pkgsrc/www/apache24: Makefile distinfo

   Log Message:
   www/apache24: update to 2.4.46

   Update apache24 to 2.4.46 (Apache HTTPD 2.4.46).  It fixes several
   security problems:

   CVE-2020-9490: Push Diary Crash on Specifically Crafted HTTP/2 Header
   CVE-2020-11984: mod_uwsgi buffer overlow
   CVE-2020-11985: CWE-345: Insufficient verification of data authenticity
   CVE-2020-11993: Push Diary Crash on Specifically Crafted HTTP/2 Header

   pkgsrc changes: reduce warnings by SUBST_* processing.

   Changes with Apache 2.4.46
     *) mod_proxy_fcgi: Fix build warnings for Windows platform
        [Eric Covener, Christophe Jaillet]

   Changes with Apache 2.4.45

     *) mod_http2: remove support for abandoned http-wg draft
        <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>.
        [Stefan Eissing]

   Changes with Apache 2.4.44

     *) mod_proxy_uwsgi: Error out on HTTP header larger than 16K (hard
        protocol limit).  [Yann Ylavic]

     *) mod_http2:
        Fixes <icing/mod_h2#200>:
        "LimitRequestFields 0" now disables the limit, as documented.
        Fixes <icing/mod_h2#201>:
        Do not count repeated headers with same name against the field
        count limit. The are merged internally, as if sent in a single HTTP/1 line.
        [Stefan Eissing]

     *) mod_http2: Avoid segfaults in case of handling certain responses for
        already aborted connections.  [Stefan Eissing, Ruediger Pluem]

     *) mod_http2: The module now handles master/secondary connections and has marked
        methods according to use. [Stefan Eissing]

     *) core: Drop an invalid Last-Modified header value coming
        from a FCGI/CGI script instead of replacing it with Unix epoch.
        [Yann Ylavic, Luca Toscano]

     *) Add support for strict content-length parsing through addition of
        ap_parse_strict_length() [Yann Ylavic]

     *) mod_proxy_fcgi: ProxyFCGISetEnvIf unsets variables when expression
        evaluates to false.  PR64365. [Michael König <mail ikoenig.net>]

     *) mod_proxy_http: flush spooled request body in one go to avoid
        leaking (or long lived) temporary file. PR 64452. [Yann Ylavic]

     *) mod_ssl: Fix a race condition and possible crash when using a proxy client
        certificate (SSLProxyMachineCertificateFile).
        [Armin Abfalterer <a.abfalterer gmail.com>]

     *) mod_ssl: Fix memory leak in stapling code. PR63687. [Stefan Eissing]

     *) mod_http2: Fixed regression that no longer set H2_STREAM_ID and H2_STREAM_TAG.
        PR64330 [Stefan Eissing]

     *) mod_http2: Fixed regression that caused connections to close when mod_reqtimeout
        was configured with a handshake timeout. Fixes gitub issue #196.
        [Stefan Eissing]

     *) mod_proxy_http2: the "ping" proxy parameter
        (see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
        when checking the liveliness of a new or reused h2 connection to the backend.
        With short durations, this makes load-balancing more responsive. The module
        will hold back requests until ping conditions are met, using features of the
        HTTP/2 protocol alone. [Ruediger Pluem, Stefan Eissing]

     *) core: httpd is no longer linked against -lsystemd if mod_systemd
        is enabled (and built as a DSO).  [Rainer Jung]

     *) mod_proxy_http2: respect ProxyTimeout settings on backend connections
        while waiting on incoming data. [Ruediger Pluem, Stefan Eissing]
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

No branches or pull requests

2 participants