Opera Software Opera Web Browser URL Parsing Heap Overflow
18 Oct. 2006
Summary
Opera is a "cross-platform web browser". Remote exploitation of a heap overflow vulnerability within version 9 of Opera Software's Opera Web browser could allow an attacker to execute arbitrary code on the affected host.
A flaw exists within Opera when parsing a tag that contains a URL. A heap buffer with a constant size of 256 bytes is allocated to store the URL, and the tag's URL is copied into this buffer without sufficient bounds checking of its length. The vulnerable code would look something like this in C/C++:
char *local_url = malloc(256);
strcpy(local_url, tag_url);
This URL can be inserted into any tag, such as an iframe. The range of characters that can be used to overflow the buffer is limited.