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

Gunicorn dependency request smuggling vulnerability #15570

Closed
CoburnJoe opened this issue Apr 28, 2021 · 11 comments
Closed

Gunicorn dependency request smuggling vulnerability #15570

CoburnJoe opened this issue Apr 28, 2021 · 11 comments
Labels
invalid kind:bug This is a clearly a bug

Comments

@CoburnJoe
Copy link

Hi team!

My organisation is using Airflow, and right now we are unable to comply with our security policies or use our standard build pipeline due to an insecure dependency version (Gunicorn) specified by Airflow. I've messaged the security@ email address, but as this is already a public vulnerability in Gunicorn, and not a proven exploit in Airflow, I was directed over here.

Gunicorn request smuggling vulnerability.
CVSS: https://snyk.io/vuln/SNYK-PYTHON-GUNICORN-541164

Steps to replicate

  • Install Airflow
  • Use Pipenv or Safety Python packages to run a dependency check (pipenv check or safety check) - Airflow fails because Gunicorn is running an older version with a known vulnerability:

40104: gunicorn <20.0.1 resolved (19.10.0 installed)!
Gunicorn 20.0.1 fixes chunked encoding support to prevent any request smuggling for security purposes.

This issue is patched in Gunicorn 20.0.1 or higher. Your setup file specifies gunicorn>=19.5.0, <20.0

gunicorn>=19.5.0, <20.0

@CoburnJoe CoburnJoe added the kind:bug This is a clearly a bug label Apr 28, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 28, 2021

Thanks for opening your first issue here! Be sure to follow the issue template!

@uranusjr
Copy link
Member

The ticket states the vulnerability is also fixed in 19.10.0 or higher.

@CoburnJoe
Copy link
Author

The ticket states the vulnerability is also fixed in 19.10.0 or higher.

That is an inaccuracy in the CVE - 20.0.1 is when the fix arrived: https://github.com/benoitc/gunicorn/releases/tag/20.0.2

@potiuk
Copy link
Member

potiuk commented Apr 28, 2021

That is an inaccuracy in the CVE - 20.0.1 is when the fix arrived: https://github.com/benoitc/gunicorn/releases/tag/20.0.2

Not reallly. The CVE is correct. The fix has been backported to 19.10.0 : benoitc/gunicorn@9322089

You can see it when you take a look at differences between 19.9.0 and 19.10.0

benoitc/gunicorn@19.9.0...19.10.0

@potiuk potiuk added the invalid label Apr 28, 2021
@potiuk
Copy link
Member

potiuk commented Apr 28, 2021

Closing as invalid.

@potiuk potiuk closed this as completed Apr 28, 2021
@CoburnJoe
Copy link
Author

@potiuk 19.9.10 has a failing build:
https://pypi.org/project/gunicorn/19.10.0/
https://travis-ci.org/github/benoitc/gunicorn/jobs/768410265

And is not listed under the GitHub releases - which go from 19.9.0 to 20.0 https://github.com/benoitc/gunicorn/releases

If I have to dig through other projects I'm happy to do so, but from my view, there are only a few possible options:

  • 19.9.10 wasn't a proper release/was released breaking then immediately fixed
  • The pipenv/safety database is out of date (which seems unlikely, as pipenv check maintains its own database updated once a month, and these releases range from July 2018 to November 2019)
  • This isn't a problem at all

I'm happy to commit the upgrade myself if required, but I'm not too versed in the Airflow projects specifics and lockfiles.

@potiuk
Copy link
Member

potiuk commented Apr 28, 2021

Gunicorn 19.10.0 (not 19.9.10) was properly released to PyPI: https://pypi.org/project/gunicorn/19.10.0/

I see no reason to disbelive Gunicorn maintainers when they are releasing to PyPI. If you have any doubts, please open an issue in Gunicorn repo (with reference to this issue). I am happy to reopen the issue if your doubts are verified, but we will not actively pursue it.

@CoburnJoe
Copy link
Author

Thanks for the quick reply - I'll do some more digging :)

@potiuk
Copy link
Member

potiuk commented Apr 28, 2021

As explained in the thread you started, i will look into reasoning why we are using gunicorn < 20. It is strange to find that 1.10 uses > 20 already :)

potiuk added a commit to potiuk/airflow that referenced this issue Apr 30, 2021
It seems that the < 20.0 limit for gunicorn was added at some point
in time without actual reason. We are already using gunicorn in
1.10 line of Airflow, so it should not be a problem to bump the
version of gunicorn, especially that the 19. line is somewhat
deprecated already.

This change came after the discussion n apache#15570
potiuk added a commit that referenced this issue Apr 30, 2021
It seems that the < 20.0 limit for gunicorn was added at some point
in time without actual reason. We are already using gunicorn in
1.10 line of Airflow, so it should not be a problem to bump the
version of gunicorn, especially that the 19. line is somewhat
deprecated already.

This change came after the discussion n #15570
@potiuk
Copy link
Member

potiuk commented Apr 30, 2021

@CoburnJoe -> Airflow master is at Gunicorn 20.1 now (#15611). Next release should use it.

@CoburnJoe
Copy link
Author

@CoburnJoe -> Airflow master is at Gunicorn 20.1 now (#15611). Next release should use it.

Fantastic - thank you! 🎉

potiuk added a commit to potiuk/airflow that referenced this issue May 6, 2021
It seems that the < 20.0 limit for gunicorn was added at some point
in time without actual reason. We are already using gunicorn in
1.10 line of Airflow, so it should not be a problem to bump the
version of gunicorn, especially that the 19. line is somewhat
deprecated already.

This change came after the discussion n apache#15570

(cherry picked from commit d7a14a8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

3 participants