-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Scrub Passwords with URL Encoded Characters #4433
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
Scrub Passwords with URL Encoded Characters #4433
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4433 +/- ##
=========================================
+ Coverage 92.69% 92.79% +0.1%
=========================================
Files 118 118
Lines 8353 8358 +5
=========================================
+ Hits 7743 7756 +13
+ Misses 610 602 -8
Continue to review full report at Codecov.
|
Looks good, I'm wondering if we should not do something about the logging, perhaps use only the path part of the URL, and rebuild the query string based on the decoded query string? |
The matching is a bit iffy as is honestly. Reconstructing via the params and if one is password redacting the value without having to pattern match would be equally effective, if not also less error prone. |
Yep that's what I'm thinking as well. |
* scrub passwords with url encoded characters from logs * compose query string from parsed params, redacting based on key if needed
* scrub passwords with url encoded characters from logs * compose query string from parsed params, redacting based on key if needed
Noticed that since login is performed over GET passwords can be urlencoded when trying to screen them from the logs. This can problematic as we check against a decoded version of the same password, which will not match a password with url encoded characters in the url/query.
This fixes it by running
encodeURIComponent
on our decoded password value, and uses that encoded value to screen against the password in the url/query. Additionally this adds some tests to LogsRouter.spec.js for enforcing that passwords (encoded or not) are properly screened in logs from here on out.