Rapid7 Vulnerability & Exploit Database

JavaScript Memory Leaks - Forgotten timer or callback

Free InsightVM Trial No Credit Card Necessary
2024 Attack Intel Report Latest research by Rapid7 Labs
Back to Search

JavaScript Memory Leaks - Forgotten timer or callback

Severity
4
CVSS
(AV:N/AC:L/Au:M/C:P/I:N/A:N)
Published
01/01/2017
Created
07/25/2018
Added
06/27/2018
Modified
06/27/2018

Description

The use of setInterval is quite common in JavaScript. You may consider the following javascript code that creates a dangling timer:

          setInterval(function() {          var Password = document.getElementById('Password');          if(node) {            // Do stuff with password.          } }, 1000);        
]]> This timer makes a reference to nodes or data that is no longer required. The object represented by the element may be removed in the future. However, the handler, as the interval is still active, cannot be collected. If the interval handler cannot be collected, its dependencies, which presumably store sizable data, cannot be collected either.

Solution(s)

  • javascriptcheck-javascriptleaks-r03

With Rapid7 live dashboards, I have a clear view of all the assets on my network, which ones can be exploited, and what I need to do in order to reduce the risk in my environment in real-time. No other tool gives us that kind of value and insight.

– Scott Cheney, Manager of Information Security, Sierra View Medical Center

;