Skip to content
Memory corruption Disclosed report CVE-2015-4489

Self-assignment in nsTArray_Impl causes memory-safety bug

q1 Follow

Originally disclosed on Mozilla

  • Fixed in 12 days
  • Paid in 17 days
  • Disclosed after 12 days
Text
Assigning an array object based upon nsTArray_Impl to itself causes the destruction of the array's elements, followed by the construction of new elements from the memory that contained the destroyed elements. If the element type has a nontrivial destructor, this almost certainly results in the construction of invalid new elements, such as those containing pointers to unowned memory.

The bug is that the copy-assignment operator does not check for self-assignment.

I do not know whether any code actually does such a self-assignment.

There is also a similar bug in the move-assignment operator, which is less serious because it clears the object, then assigns it to itself.

The original report as published on Mozilla's Bugzilla, by q1. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in XPCOM. Mozilla made it public on 22 July 2015 as CVE-2015-4489.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by q1

View all

71 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.