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

[Security] Bump waitress from 0.8.10 to 1.4.0 #54

Closed
wants to merge 1 commit into from

Conversation

dependabot-preview[bot]
Copy link

Bumps waitress from 0.8.10 to 1.4.0. This update includes security fixes.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

Critical severity vulnerability that affects waitress

Impact

Waitress would header fold a double Content-Length header and due to being unable to cast the now comma separated value to an integer would set the Content-Length to 0 internally.

So a request with:

Content-Length: 10
Content-Length: 10

would get transformed to:

Content-Length: 10, 10

Which would Waitress would then internally set to Content-Lenght: 0.

Waitress would then treat the request as having no body, thereby treating the body of the request as a new request in HTTP pipelining.

... (truncated)

Affected versions: < 1.3.1

Sourced from The GitHub Security Advisory Database.

Critical severity vulnerability that affects waitress

Impact

Waitress implemented a "MAY" part of the RFC7230 (https://tools.ietf.org/html/rfc7230#section-3.5) which states:

  Although the line terminator for the start-line and header fields is
  the sequence CRLF, a recipient MAY recognize a single LF as a line
  terminator and ignore any preceding CR.

Unfortunately if a front-end server does not parse header fields with an LF the same way as it does those with a CRLF it can lead to the front-end and the back-end server parsing the same HTTP message in two different ways. This can lead to a potential for HTTP request smuggling/splitting whereby Waitress may see two requests while the front-end server only sees a single HTTP message.

Example:

Content-Length: 100[CRLF]
X-Header: x[LF]Content-Length: 0[CRLF]

Would get treated by Waitress as if it were:

</tr></table> ... (truncated)

Affected versions: <= 1.3.1

Sourced from The GitHub Security Advisory Database.

Critical severity vulnerability that affects waitress

Impact

Waitress would parse the Transfer-Encoding header and only look for a single string value, if that value was not chunked it would fall through and use the Content-Length header instead.

According to the HTTP standard Transfer-Encoding should be a comma separated list, with the inner-most encoding first, followed by any further transfer codings, ending with chunked.

Requests sent with:

Transfer-Encoding: gzip, chunked

Would incorrectly get ignored, and the request would use a Content-Length header instead to determine the body size of the HTTP message.

This could allow for Waitress to treat a single request as multiple requests in the case of HTTP pipelining.

Patches

This issue is fixed in Waitress 1.4.0. This brings a range of changes to harden Waitress against potential HTTP request confusions, and may change the behaviour of Waitress behind non-conformist proxies.

... (truncated)

Affected versions: <= 1.3.1

Release notes

Sourced from waitress's releases.

v1.4.0

No release notes provided.

v1.3.1

No release notes provided.

v1.3.0

No release notes provided.

v1.3.0b0

No release notes provided.

v1.2.1

No release notes provided.

v1.2.0

No release notes provided.

v1.1.0

https://pypi.org/project/waitress/1.1.0/

v1.0.2

No release notes provided.

v1.0.1

No release notes provided.

v1.0.0

No release notes provided.

v1.0a2

No release notes provided.

v1.0a1

No release notes provided.

v0.9.0

No release notes provided.

v0.9.0b1

No release notes provided.

0.9.0b0

No release notes provided.

0.8.11b0

No release notes provided.

Changelog

Sourced from waitress's changelog.

1.4.0 (2019-12-20)

Bugfixes


- Waitress used to slam the door shut on HTTP pipelined requests without
  setting the ``Connection: close`` header as appropriate in the response. This
  is of course not very friendly. Waitress now explicitly sets the header when
  responding with an internally generated error such as 400 Bad Request or 500
  Internal Server Error to notify the remote client that it will be closing the
  connection after the response is sent.
  • Waitress no longer allows any spaces to exist between the header field-name and the colon. While waitress did not strip the space and thereby was not vulnerable to any potential header field-name confusion, it should have sent back a 400 Bad Request. See Pylons/waitress#273

Security Fixes

  • Waitress implemented a "MAY" part of the RFC7230 (https://tools.ietf.org/html/rfc7230#section-3.5) which states:

    Although the line terminator for the start-line and header fields is
    the sequence CRLF, a recipient MAY recognize a single LF as a line
    terminator and ignore any preceding CR.
    

    Unfortunately if a front-end server does not parse header fields with an LF the same way as it does those with a CRLF it can lead to the front-end and the back-end server parsing the same HTTP message in two different ways. This can lead to a potential for HTTP request smuggling/splitting whereby Waitress may see two requests while the front-end server only sees a single HTTP message.

    For more information I can highly recommend the blog post by ZeddYu Lu https://blog.zeddyu.info/2019/12/08/HTTP-Smuggling-en/

  • Waitress used to treat LF the same as CRLF in Transfer-Encoding: chunked requests, while the maintainer doesn't believe this could lead to a security issue, this is no longer supported and all chunks are now validated to be properly framed with CRLF as required by RFC7230.

  • Waitress now validates that the Transfer-Encoding header contains only transfer codes that it is able to decode. At the moment that includes the only valid header value being chunked.

    That means that if the following header is sent:

    Transfer-Encoding: gzip, chunked

... (truncated)
Commits
  • f11093a Merge pull request from GHSA-g2xc-35jw-c63p
  • e586be8 Version 1.4.0
  • d1f283b Update CHANGES.txt and HISTORY.txt as appropriate
  • 60f92b8 Allow end of chunk parser to be resumeable
  • 8ecd8dc Improve validation of Transfer-Encoding
  • 575994c Upon receiving invalid Content-Length bail
  • 804e313 Disallow BWS in header field-names
  • fb08ecf Properly enforce max_request_header_size
  • 8eba394 Remove support for non CRLF line endings
  • 7ff1e6b Make sure all errors have a code/reason
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Bumps [waitress](https://github.com/Pylons/waitress) from 0.8.10 to 1.4.0. **This update includes security fixes.**
- [Release notes](https://github.com/Pylons/waitress/releases)
- [Changelog](https://github.com/Pylons/waitress/blob/master/CHANGES.txt)
- [Commits](Pylons/waitress@0.8.10...v1.4.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
@dependabot-preview dependabot-preview bot added dependencies security Pull requests that address a security vulnerability labels Dec 20, 2019
@dependabot-preview
Copy link
Author

Superseded by #55.

@dependabot-preview dependabot-preview bot deleted the dependabot/pip/waitress-1.4.0 branch December 26, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants