Mozilla Foundation Security Advisory 2006-57

JavaScript Regular Expression Heap Corruption

September 14, 2006
Priit Laes, CanadianGuy, Girts Folkmanis, Catalin Patulea
Firefox, SeaMonkey, Thunderbird
Fixed in
  • Firefox
  • SeaMonkey 1.0.5
  • Thunderbird


Priit Laes reported a crash due to a heap buffer overflow triggered by a JavaScript regular expression containing a minimal quantifier. We presume this could be exploited to run arbitrary code.

CanadianGuy, Girts Folkmanis and Catalin Patulea report that a regular expression that ends with a backslash inside an unterminated character set (e.g. "[\\") will cause the regular epression engine to read beyond the end of the buffer, possibly leading to a crash.

Thunderbird shares the browser engine with Firefox and could be vulnerable if JavaScript were to be enabled in mail. This is not the default setting and we strongly discourage users from enabling JavaScript in mail.


Disable JavaScript until you can upgrade to a fixed version. Do not enable JavaScript in mail clients such as Thunderbird.