Particular DOM event manipulations can cause Opera to crash. In some cases, this crash might occur in a way that allows execution of arbitrary code. To inject code, additional techniques would have to be employed.
Opera Software has released Opera 12.13, where this issue has been fixed.
Thanks to Arthur Gerkis for reporting this issue to Opera Software.