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:
committed by
Hitoshi Mitake
parent
291cb7172a
commit
e6c2e380a9
@@ -454,6 +454,13 @@ func (s *EtcdServer) Authenticate(ctx context.Context, r *pb.AuthenticateRequest
|
|||||||
|
|
||||||
lg := s.Logger()
|
lg := s.Logger()
|
||||||
|
|
||||||
|
// fix https://nvd.nist.gov/vuln/detail/CVE-2021-28235
|
||||||
|
defer func() {
|
||||||
|
if r != nil {
|
||||||
|
r.Password = ""
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
var resp proto.Message
|
var resp proto.Message
|
||||||
for {
|
for {
|
||||||
checkedRevision, err := s.AuthStore().CheckPassword(r.Name, r.Password)
|
checkedRevision, err := s.AuthStore().CheckPassword(r.Name, r.Password)
|
||||||
|
|||||||
Reference in New Issue
Block a user