-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Recovery middleware leaks sensitive cookies, tokens, and headers into logs #1331
Comments
@dustin-decker sorry, how do you define "leadked". This error is just logged in server, why leadked? |
It can make sensitive headers readable in plaintext logs. No production HTTP server I know of does this by default, though some can be configured to do this. Twitter and Github recently publicly disclosed that they've accidentally logged passwords and advised people to change them: https://arstechnica.com/information-technology/2018/05/twitter-advises-users-to-reset-passwords-after-bug-posts-passwords-to-internal-log/ I will open a PR in a few minutes to address this issue in gin. (Edited posts because I noticed that it does not log the body, but does log the other parts of the request) |
@dustin-decker In my opinion, This is just a log middleware.
I think it depend on developer,but not web framework. |
Generally, we set username/password in body, as you say, we not log request body. If user set username/password in query param, user should encrypt self-user. As @dustin-decker pull request, remove log dump, I think it's ok, because we have had panic stack. This's my option. |
Fixes #1331 HTTP logging leaks sensitive request information. This PR removes HTTP request logging during panics.
Fixes gin-gonic#1331 HTTP logging leaks sensitive request information. This PR removes HTTP request logging during panics.
Session cookies, API tokens, and authorization headers are all being leaked. The request is dumped if a handler hits a panic when using the recovery middleware:
gin/recovery.go
Line 41 in 65a65c2
This is very insecure default behavior, and there appears to be no way to opt out other than not using the middleware.
The text was updated successfully, but these errors were encountered: