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

Filtering is case sensitive which makes it insecure at filtering sensitive data #154

Open
nkavian opened this issue Jun 16, 2020 · 3 comments
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug

Comments

@nkavian
Copy link

nkavian commented Jun 16, 2020

Observation
I'm setting bugsnag.setFilters("Authorization"); so that I can filter out a sensitive header.
When using cURL -u username:password, I noticed the 'authorization' header was still present in the BugSnag dashboard. HTTP headers are case insensitive and a server has no control over how a client will case the header names. I could filter both but that would be plain silly bugsnag.setFilters("authorization", "Authorization").

Expected Result
Update the Java SDK at the mentioned line below to compare the strings in a case insensitive way.

Side note: This same line below has an undocumented and undesired behaviour since it's written as if(key.contains(filter)). If I filter on name, it will filter as well name1 and username. This is not desirable, especially since it's undocumented, but also because it forces developers to rename variables to avoid filter clashes..

Source of the Issue

@nkavian nkavian changed the title Filtering is ineffective since it's not case insensitive Filtering is case sensitive which makes it insecure at filtering sensitive data Jun 16, 2020
@nkavian
Copy link
Author

nkavian commented Jun 16, 2020

Just noticed #152 from back in January.

@johnkiely1
Copy link
Member

Hi @nkavian.
Thanks for the report.
As you will have seen from #152 this is something we are aware of and have plans to update. As of now this would be expected to be addressed in the next major release of the bugsnag-java. As this is part of a much larger set of changes we don't have a definite timeframe for when this will be ready for release yet.
For now, although not ideal, I would suggest you work around it as best you can.

@johnkiely1 johnkiely1 added backlog We hope to fix this feature/bug in the future bug Confirmed bug labels Jun 22, 2020
@wheleph
Copy link

wheleph commented Sep 7, 2021

Although I played around with com.bugsnag:bugsnag-spring:3.6.2 and not with pure bugsnag-java, the following discovery may become handy.

Apparently, before applying filters, Bugsnag converts HTTP headers to lowercase.

So the following filter setup works for me:

bugsnag.setFilters("authorization", "cookie");

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants