-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Constant time password comparison #81152
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
Conversation
needs bazel update. also should mark the --basic-auth-file parameter deprecated before the referenced issue is completely closed |
add something like this to where the flag is registered: fs.MarkDeprecated("basic-auth-file", "Basic authentication mode is deprecated and will be removed in a future release. It is not recommended for production environments.") |
@liggitt |
/test pull-kubernetes-integration |
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-e2e-gce-100-performance |
cc @kubernetes/sig-api-machinery-api-reviews @kubernetes/sig-auth-api-reviews for marking the |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, tedyu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
@@ -85,7 +86,7 @@ func (a *PasswordAuthenticator) AuthenticatePassword(ctx context.Context, userna | |||
if !ok { | |||
return nil, false, nil | |||
} | |||
if user.password != password { | |||
if subtle.ConstantTimeCompare([]byte(user.password), []byte(password)) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arghghghgh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translation: incoherent despair that we could possibly have had such a bug in 2019
We also don't salt+hash the plain text passwords in the csv file, sigh...
/hold |
great :) |
We should be more specific about the deprecation timeline. I think the standard for flags is 2 releases, which puts removal at 1.18? |
@tallclair @liggitt the deprecation notice doesn't make it clear what we're replacing --basic-auth with for development/troubleshooting purposes, nor when we're replacing it. Shouldn't actual removal be dependent on having a replacement first? |
We have the static token authenticator to replace this with. |
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
Basic authentication is deprecated as of Kubernetes 1.16 and will be removed in the future. Consequently, let's not enable it by default for new 1.16 shoots anymore. We will completely remove it in the future as well. We have to inform end-users that they have to migrate. See kubernetes/kubernetes#81152
A third-party security audit of Kubernetes found this issue in the way they validated basic auth credentials. This change implements the same check for the basic-auth plugin. kubernetes/kubernetes#81152 Other plugins are also available such as OAuth2 / OIDC for the OpenFaaS gateway. The WWW-Authenticate realm was being set even when auth passed, this was unnecessary and has been configured to only be set when auth is required or the header is missing. Tested with additional unit tests. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@mikedanese do you have a link to the static token authenticator for reference? |
A third-party security audit of Kubernetes found this issue in the way they validated basic auth credentials. This change implements the same check for the basic-auth plugin. kubernetes/kubernetes#81152 Other plugins are also available such as OAuth2 / OIDC for the OpenFaaS gateway. The WWW-Authenticate realm was being set even when auth passed, this was unnecessary and has been configured to only be set when auth is required or the header is missing. Tested with additional unit tests. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR uses constant time password comparison to fix issue #81126
Which issue(s) this PR fixes:
fixes #81126
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: