I am currently evaluating the security risks for an electron app I am working on, with regards to whether it is possible to copy a file, or bunch of files stored on the user’s hard drive by electron, and just paste them into another installation on another machine and thus automatically be logged into the application using the session of the user who was logged in on the first machine. We use token auth in our app.
I noticed that electron stores its cache in a particular folder as mentioned here How to clear the cache data in Electron(atom shell)?.
Among those files I noticed a 'Cookies' file which seems to be an sqliteDB. When you open this with an sqlite db reader you can view the cookie data as plain text. However this doesn’t seem to contain the auth cookie of the currently logged in user.
Hence some of the questions I’m hoping to get answers to are:
- When we log a user in the user’s auth token is stored in a cookie. Is this cookie stored in a particular file on the hard drive by electron which can be copied into another machine to spoof/hijack a user’s session?
- If the answer to question 1 is yes is there a way to prevent this?
I am not a pro on security, so forgive me if I've gotten some security terminology wrong.