Headline
CVE-2022-24950: red fixes (#468) · MisterTea/EternalTerminal@900348b
A race condition exists in Eternal Terminal prior to version 6.2.0 that allows an authenticated attacker to hijack other users’ SSH authorization socket, enabling the attacker to login to other systems as the targeted users. The bug is in UserTerminalRouter::getInfoForId().
@@ -13,7 +13,7 @@ int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
FATAL_FAIL(sockFd);
initSocket(sockFd);
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, pipePath.c_str());
strncpy(remote.sun_path, pipePath.c_str(), sizeof(remote.sun_path));
VLOG(3) << "Connecting to " << endpoint << " with fd " << sockFd;
int result =
@@ -104,7 +104,7 @@ set<int> PipeSocketHandler::listen(const SocketEndpoint& endpoint) {
FATAL_FAIL(fd);
initServerSocket(fd);
local.sun_family = AF_UNIX; /* local is declared before socket() ^ */
strcpy(local.sun_path, pipePath.c_str());
strncpy(local.sun_path, pipePath.c_str(), sizeof(local.sun_path));
unlink(local.sun_path);
FATAL_FAIL(::bind(fd, (struct sockaddr*)&local, sizeof(sockaddr_un)));