mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
security: remove password after authenticating the user
fix https://nvd.nist.gov/vuln/detail/CVE-2021-28235 Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
parent
801bb4c6df
commit
8b1cd036ff
@ -445,6 +445,13 @@ func (s *EtcdServer) Authenticate(ctx context.Context, r *pb.AuthenticateRequest
|
||||
|
||||
lg := s.Logger()
|
||||
|
||||
// fix https://nvd.nist.gov/vuln/detail/CVE-2021-28235
|
||||
defer func() {
|
||||
if r != nil {
|
||||
r.Password = ""
|
||||
}
|
||||
}()
|
||||
|
||||
var resp proto.Message
|
||||
for {
|
||||
checkedRevision, err := s.AuthStore().CheckPassword(r.Name, r.Password)
|
||||
|
@ -21,6 +21,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"go.etcd.io/etcd/tests/v3/framework/e2e"
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user