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

Destroy socket on failure to CONNECT (avoids TLS risk) #76

Closed
wants to merge 3 commits into from

Conversation

kadler15
Copy link

@kadler15 kadler15 commented Sep 25, 2019

Vulnerability reference: https://hackerone.com/reports/541502

Unfortunately, this results in the loss of proxy error playback for client-side error handling added in ae03c68

Other parts of the proxy error playback machinery can be removed in the future.

Signed-off-by: Kris Adler <spurfan15@gmail.com>
@kadler15 kadler15 changed the title Destroy socket on failure to TLS-upgrade (#1) Destroy socket on failure to TLS-upgrade Sep 25, 2019
@kadler15 kadler15 changed the title Destroy socket on failure to TLS-upgrade Destroy socket on failure to CONNECT (avoids TLS risk) Sep 25, 2019
@astormnewrelic
Copy link

@TooTallNate Nate, hello there! Nice to GitHub meet you.

Do you think you'll be accepting or considering this PR for acceptance?

If not, do you think you'll be taking any steps to address the security bulletin that indicated there's a potential security bug in this repo? https://hackerone.com/reports/541502

Asking because a lot of the downstream security products have picked up this report, which in turn is flagging our package (which uses http-proxy-agent as a dependency) as potentially unsafe.

No worries if not -- I know how unpaid open source work can go -- but knowing what the plans are would help us decide what we need to do for our own package(s).

TooTallNate added a commit that referenced this pull request Oct 4, 2019
This is a fix for https://hackerone.com/reports/541502.

Aborts the upstream proxy connection and instead uses a vanilla
`EventEmitter` instance to replay the "data" events on to. This way,
the node core `http` Client doesn't attempt to write the HTTP request
that is intended to go to the destination server to the proxy server.

Closes #76.
@TooTallNate
Copy link
Owner

Hey @kadler15 @astormnewrelic. Thanks for reaching out. I have proposed an alternative solution in #77, which doesn't end up altering the API (the replay still happens, but it's "synthetic" now). Please take a look and let me know if that adequately fixes the vulnerability. Cheers!

@astormnewrelic
Copy link

Nice! Thank you @TooTallNate -- as to whether #77 is an appropriate fix or not, I don't know. I'm just a programmer at the whim of security products.

@kadler15 is seems like you're familiar with the hackerone organization who made the original report. Do you know how/why/if they have "yo this is patched in the core product now" reports and/or how all that works?

TooTallNate added a commit that referenced this pull request Oct 4, 2019
This is a fix for https://hackerone.com/reports/541502.

Aborts the upstream proxy connection and instead uses a vanilla
`EventEmitter` instance to replay the "data" events on to. This way,
the node core `http` Client doesn't attempt to write the HTTP request
that is intended to go to the destination server to the proxy server.

Closes #76.
@kadler15
Copy link
Author

kadler15 commented Oct 7, 2019

@astormnewrelic I'll double check these changes today. @TooTallNate Your changes seem like a great way to preserve the current API while closing the vulnerability. Nice work!

@kadler15
Copy link
Author

kadler15 commented Oct 7, 2019

Closing in favor of #77

@kadler15 kadler15 closed this Oct 7, 2019
TooTallNate added a commit that referenced this pull request Oct 7, 2019
* Use an `EventEmitter` to replay failed proxy connect HTTP requests

This is a fix for https://hackerone.com/reports/541502.

Aborts the upstream proxy connection and instead uses a vanilla
`EventEmitter` instance to replay the "data" events on to. This way,
the node core `http` Client doesn't attempt to write the HTTP request
that is intended to go to the destination server to the proxy server.

Closes #76.

* Adjust comment
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

Successfully merging this pull request may close these issues.

None yet

3 participants