Festalon is "a player (stand-alone and plugin) for the Nintendo .nsf music files". A heap corruption vulnerability in Festalon allows attackers to cause the program to fail and possibly execute arbitrary code.
Vulnerable Systems:
* Festalon version 0.5.5 and prior
* Festalon version 0.5.0 and above
HES is a file format for ripped TG16/PC Engine music which has been added from version 0.5.0. FESTALON_HES is a structure of 1501888 bytes used to contain the file in memory. The program uses an anti-overflow check for avoiding input data major than the rom size of 0x100000 bytes. Anyway the check is made on the sum of LoadAddr (used as an offset of the destination rom buffer) and LoadSize (amount of data to copy) so an attacker can use a negative LoadAddr value for overwriting the memory antecedent the one allocated.
The exploitation (Luigi is not sure if code execution is really possible although the effects seem similar to a heap overflow) occurs when the program terminates and free() is called.
From pce/hes.c: FESTALON_HES *FESTAHES_Load(FESTALON *fe, uint8 *buf, uint32 size)
{
FESTALON_HES *hes;
uint32 LoadAddr,LoadSize;
uint16 InitAddr;
uint8 *tmp;
int x;