jefrailey / lastpass-demo

A Vue application that demonstrates a possible memory leak in the LastPass browser extension version 4.35.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lastpass-demo

This is a demo of a potential memory leak in the LastPass browser extension for Chrome version 4.35.0 when navigating a Vue application that uses VueRouter and contains <form> elements. The apparent cause is the retention of <form>s in the FormDetection formMap.

The following instructions assume you have yarn, serve, and the LastPass browser extension installed.

  1. Clone this repository.
  2. yarn install
  3. yarn build
  4. serve -s dist/
  5. Open Chrome.
  6. Navigate to http://localhost:5000/#/
  7. Open dev tools.
  8. Click on the Memory tab.
  9. Expand the drawer[1]
  10. Set the JavaScript context[2] to LastPass: Free Password Manager
  11. Create a live expression[3] for the FormDetection service's form map: window.LPModule.getService('FormDetection').formMap
  12. Click Go To Form.
  13. Press Submit.
  14. Observe the formMap contains 1 element and the memory usage is ~80MB.
  15. Click Go To Form.
  16. Press Submit.
  17. Observe formMap contains 2 element and the memory usage is ~160MB.
  18. Repeat as many times as desired.
  19. Observe that both the formMap contains one element for each visit to /form.
  20. Collect garbage and wait.
  21. Observe that the memory usage does not decrease by a meaningful amount.
  22. Navigate to chrome://extensions
  23. Disable LastPass by clicking the toggle on its card.
  24. Navigate to http://localhost:5000/#/
  25. Open dev tools.
  26. Click on the Memory tab.
  27. Click Go To Form.
  28. Press Submit.
  29. Click Go To Form.
  30. Press Submit.
  31. Repeat as many times as desired.
  32. Collect garbage and wait.
  33. Observe that the memory usage drops to ~6MB.

[1] https://developers.google.com/web/tools/chrome-devtools/customize#drawer [2] https://developers.google.com/web/tools/chrome-devtools/console/reference#context [3] https://developers.google.com/web/tools/chrome-devtools/console/live-expressions

About

A Vue application that demonstrates a possible memory leak in the LastPass browser extension version 4.35.0


Languages

Language:Vue 44.5%Language:HTML 31.8%Language:JavaScript 23.7%