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

Wrap authentication calls in try catch to avoid leaking error #3903

Merged
merged 1 commit into from Dec 22, 2021

Conversation

luos
Copy link
Contributor

@luos luos commented Dec 16, 2021

Proposed Changes

Hi,

During a review we checked what could happen if the authentication fails with an exception. It is possible that because of a bug or some other issue (backend unavailable), authentication fails with an exception. This info is not displayed back to the user, however it can leak credentials into logs.

We'd like to propose to either wrap the authentication calls with a try catch to throw away the Stacktrace, or to turn on the sensitive process flag.

Here, we prepared the Stacktrace pruning version.

Let us know what you think. I am happy to add a test as well, though it was unclear to me where it should go.

In my manual tests, before the connection would fail with a TCP disconnect, now it fails with an authentication failure.

I do not think this is a breaking change.

This PR was created as part of a security audit made on behalf of LKAB.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.

@michaelklishin
Copy link
Member

@luos please rebase this on top of master.

Copy link
Member

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is 38 commits behind master now and I think that's why it runs into Bazel failures on CI.

@luos luos force-pushed the wrap_auth_calls_in_try_catch branch from 4e1b3be to ebc2b56 Compare December 20, 2021 08:44
@luos
Copy link
Contributor Author

luos commented Dec 20, 2021

Thank you for checking it, I just rebased it on top of master.

@lukebakken
Copy link
Collaborator

Hopefully CI will pass 🤞

@michaelklishin michaelklishin merged commit 3fe9112 into rabbitmq:master Dec 22, 2021
@michaelklishin
Copy link
Member

Backported to v3.9.x manually.

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