Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does sensitive ASP.NET Session data need to be encrypted?

Do ASP.NET Session[string key] data need to be encrypted to be secure?

If such data always stays on the server, doesn't that make it safe to store credit card information, passwords, etc. there, as long as the data were sent via SSL from the client?

like image 280
ChessWhiz Avatar asked Jul 19 '26 16:07

ChessWhiz


2 Answers

With all the downvotes being thrown around here, I'll add my own two cents:

I think that anything that stays in server memory, including ASP.NET Session data, is safe in unencrypted form. An attacker would have to be able to execute code on the server in order to read the memory.

On a side note, once it's stored in a database, data should be encrypted. If it's sent to the client, it should also be encrypted, but that's outside the scope of this question. Lastly, of course, the data must be encrypted on its way from the client to the server.

like image 74
ChessWhiz Avatar answered Jul 22 '26 07:07

ChessWhiz


Anything sensitive should go straight to the database, and not hang around in memory longer than needed. I don't understand why you'd need to store passwords or credit card data in session variables anyway, are you passing them between pages?

like image 35
m.edmondson Avatar answered Jul 22 '26 07:07

m.edmondson