The vulnerable system is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers). An example of a network attack is an attacker causing a denial of service by sending a specially crafted TCP packet across a wide area network (e.g., CVE-2004-0230).
Attack Complexity
Low
AC
The attacker must take no measurable action to exploit the vulnerability. The attack requires no target-specific circumvention to exploit the vulnerability. An attacker can expect repeatable success against the vulnerable system.
Privileges Required
None
PR
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
Scope
S
An exploited vulnerability can affect resources beyond the security scope managed by the security authority that is managing the vulnerable component. This is often referred to as a 'privilege escalation,' where the attacker can use the exploited vulnerability to gain control of resources that were not intended or authorized.
Confidentiality
High
C
There is total information disclosure, resulting in all data on the system being revealed to the attacker, or there is a possibility of the attacker gaining control over confidential data.
Integrity
High
I
There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the attacker being able to modify any file on the target system.
Availability
High
A
There is a total shutdown of the affected resource. The attacker can deny access to the system or data, potentially causing significant loss to the organization.
#######################################################################
Luigi Auriemma
Application: Outgun
http://koti.mbnet.fi/outgun/
Versions: <= 1.0.3 bot 2
Platforms: Windows, *nix, *BSD and more
Bugs: A] data_file_request buffer-overflow
B] exception with big data
C] invalid memory access in messages handling
D] harmless buffer-overflow on a global variable in
changeRegistration
Exploitation: remote, versus server
Date: 12 May 2006
Author: Luigi Auriemma
e-mail: aluigi (at) autistici (dot) org [email concealed]
web: aluigi.org
#######################################################################
1) Introduction
2) Bugs
3) The Code
4) Fix
#######################################################################
===============
1) Introduction
===============
Outgun is an open source 2D capture-the-flag game with multiplayer
support for LAN and Internet through a centralized master server.
#######################################################################
=======
2) Bugs
=======
--------------------------------------------
A] data_file_request command buffer-overflow
--------------------------------------------
The game supports the downloading of map files directly from the server
in which the clients want to play.
The request for the downloading of the map is composed by the command
data_file_request and two text strings for the type and name of the
requested file.
The buffers in which the server stores these two strings have a size of
64 and 256 bytes and the function readString doesn't check the length
of the destination buffer during the copying.
From src/servnet.cpp:
void ServerNetworking::incoming_client_data(int id, char *data, int length) {
...
else if (code == data_file_request) {
char ftype[64];
char fname[256];
readString(msg, count, ftype);
readString(msg, count, fname);
...
--------------------------
B] exception with big data
--------------------------
The leetnet functions used in the game for handling the packets
automatically raise an exception (throw) if a data bigger than 512
(DATA_BUF_SIZE) bytes is received.
The effect is the immediate interruption of the game.
From src/leetnet/rudp.cpp:
class data_ci : public data_c {
public:
//allocated length, used length
int alen, ulen;
//data buffer
char buf[DATA_BUF_SIZE];
//extend buffer to fit additional len
void extend(int len) {
if (len + ulen > DATA_BUF_SIZE) {
throw 66677;
}
...
---------------------------------------------
C] invalid memory access in messages handling
---------------------------------------------
The leetnet functions support a maximum amount of 64 messages in each
incoming packet but no checks are made for avoiding the reading of the
unallocated memory after the packet if an attacker uses wrong message
sizes.
From src/leetnet/rudp.cpp:
virtual char* process_incoming_packet(int *size, bool *special) {
...
NLulong msgid;
NLshort msgsize;
for (i=0; i<nreliable; i++) { // read all reliable msgs
readLong(udp_data, count, msgid); //id
readShort(udp_data, count, msgsize); //size
//if (debug) printf("(%i,%i)", msgid, msgsize);
// station will process the incoming reliable message
process_incoming_message(msgid, (udp_data + count), msgsize);
//advance count since we didn't "readBlock"
count += msgsize;
//p->add_reliable(msgid, (udp_data + count), msgsize); //data
}
...
----------------------------------------------------------------------
D] harmless buffer-overflow on a global variable in changeRegistration
----------------------------------------------------------------------
changeRegistration is the function for handling the changing of the
registration informations of the clients.
This function uses strcpy for copying the client's token in a buffer of
64 bytes located in the global array of the clients informations.
During my tests (limited by the problem described in bug B) was not
possible to exploit this bug for crashing the server but I was only
able to modify some of the informations of the other players in the
server.
From src/servernet.cpp:
bool Server::changeRegistration(int id, const string& token) {
const int intoken = atoi(token.c_str());
if (intoken == client[id].intoken)
return false;
// v0.4.9 FIX : IF HAD previous token have/valid, then FLUSH his stats
network.client_report_status(id);
strcpy(client[id].token, token.c_str());
...
#######################################################################
===========
3) The Code
===========
http://aluigi.org/poc/outgunx.zip
#######################################################################
======
4) Fix
======
Some of the bugs will be fixed in the next "bot" release.
#######################################################################
---
Luigi Auriemma
http://aluigi.org
http://mirror.aluigi.org