Commit 37e7fb1f authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Mike Gabriel

unchecked malloc may allow unauthed client to crash Xserver [CVE-2014-8091]

authdes_ezdecode() calls malloc() using a length provided by the connection handshake sent by a newly connected client in order to authenticate to the server, so should be treated as untrusted. It didn't check if malloc() failed before writing to the newly allocated buffer, so could lead to a server crash if the server fails to allocate memory (up to UINT16_MAX bytes, since the len field is a CARD16 in the X protocol). Reported-by: 's avatarIlja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net> Conflicts: os/rpcauth.c
parent b65259bf
...@@ -78,6 +78,10 @@ authdes_ezdecode(char *inmsg, int len) ...@@ -78,6 +78,10 @@ authdes_ezdecode(char *inmsg, int len)
SVCXPRT xprt; SVCXPRT xprt;
temp_inmsg = (char *) xalloc(len); temp_inmsg = (char *) xalloc(len);
if (temp_inmsg == NULL) {
why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */
return NULL;
}
memmove(temp_inmsg, inmsg, len); memmove(temp_inmsg, inmsg, len);
memset((char *)&msg, 0, sizeof(msg)); memset((char *)&msg, 0, sizeof(msg));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment