mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
security: fix for vulnerability CVE-2014-0017
When accepting a new connection, a forking server based on libssh forks and the child process handles the request. The RAND_bytes() function of openssl doesn't reset its state after the fork, but simply adds the current process id (getpid) to the PRNG state, which is not guaranteed to be unique. This can cause several children to end up with same PRNG state which is a security issue.
This commit is contained in:
@@ -458,6 +458,8 @@ int ssh_bind_accept_fd(ssh_bind sshbind, ssh_session session, socket_t fd){
|
||||
return SSH_ERROR;
|
||||
}
|
||||
}
|
||||
/* force PRNG to change state in case we fork after ssh_bind_accept */
|
||||
ssh_reseed();
|
||||
return SSH_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user