Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How easy is it to steal something left out for garbage collection? [closed]

Why getText() in JPasswordField was deprecated?

According to this answer for the above question, what I understood was that creating a String object containing the password is a security threat because it may remain in the memory for a while and it is immutable.

So I was wondering,

  • How easy is it to retrieve something which has been hanging around in the memory, without a reference or left out for garbage collection?

  • And how do you do it?


EDIT

As the question has been closed, be kind to share your knowledge by adding a comment, and consider reopening the question if you believe it may get interesting answers in the future. :)

like image 378
Roshana Pitigala Avatar asked Jun 28 '17 14:06

Roshana Pitigala


1 Answers

https://en.wikipedia.org/wiki/Heartbleed

This is a good real-world example of things hanging in memory being used for exploitation. There's different ways to do it, so it's good to just make sure things that are valuable aren't being left hanging. Usually these attacks are just guess-and-check. You just keep sending information and piecing together the bits of extra memory you get in return.

like image 137
J0hn Avatar answered Oct 20 '22 16:10

J0hn