Alien Arena ‘M_AddToServerList()’ UDP报文缓冲区溢出漏洞

漏洞起因
边界条件错误
 
影响系统
Red Planet Arena Alien Arena 7.30
 
不受影响系统
Red Planet Arena Alien Arena 7.31
 
危害
远程攻击者可以利用漏洞以应用程序权限执行任意指令。
 
攻击所需条件
攻击者必须访问Alien Arena。
 
漏洞信息
Alien Arena一款开源科幻FPS游戏。
当游戏客户端请求要加入的网络游戏列表时,会对master.corservers.com发送一个UDP请求,服务器通过UDP应答已知游戏服务器列表给客户端。然后客户端对每个列表游戏服务器发送一个UDP查询,请求它们的描述。其中解析服务器应答时存在一个缓冲区溢出攻击。
当客户端在27901端口上接收UDP报文指定服务器的描述(the server-to-client "print" message)时,会调用\client\menu.c中的M_AddToServerList(…)函数来标记UDP报文(status_string)的其它数据:
| void M_AddToServerList (netadr_t adr, char *status_string)
| {
| char *rLine;
| char *token;
| char lasttoken[256];
| char seps[] = "\\";
| …
| //parse it
|
| result = strlen(status_string);
|
| //server info – we may revisit this
| rLine = GetLine (&status_string, &result);
| …
| /* Establish string and get the first token: */
| token = strtok( rLine, seps );
| while( token != NULL ) {
| /* While there are tokens in "string" */
| if (!_stricmp (lasttoken, "admin"))
| …
| else if (!_stricmp (lasttoken, "website"))
| …
| else if (!_stricmp (lasttoken, "fraglimit"))
| …
| else if (!_stricmp (lasttoken, "timelimit"))
| …
| else if (!_stricmp (lasttoken, "version"))
| …
| else if (!_stricmp (lasttoken, "mapname"))
| …
| else if (!_stricmp (lasttoken, "hostname"))
| …
| else if (!_stricmp (lasttoken, "maxclients"))
| …
| /* Get next token: */
| strcpy (lasttoken, token);
| …
注意lasttoken缓冲区只有256字节,如果攻击者提供的token超过256字节,那么strcpy(…)函数会覆盖M_AddToServerList(…)函数的返回地址。
 
测试方法
 
厂商解决方案
Alien Arena 7.31已经修复此漏洞,建议用户下载使用:
http://icculus.org/alienarena/rpa/aquire.html
 
漏洞提供者
Jason Geffner

发表评论?

0 条评论。

发表评论