I am somewhat confused by how web security works in general so I hope someone can clear things up for me.
Can I rely on HTTPS on the integrity (because the attacker cannot just encrypt an arbitrary message and choose to send that along instead) and confidentially of the in-between network traffic? Even if the initial request is sniffed by some man-in-middle?
Why is it bad to store sensitive information (that I don’t mind my client has access to) client side (in a cookie)? Isn’t it true that other domains cannot gain access to the cookie from my domain?
Say my browser got hacked, all JWTs, and certificates are exposed and can be tampered with any way. Does that mean there is no way to guard against that?
I kept seeing HMAC but not sure what its purpose is. It is a symmetrical encryption method so if an attacker gets hold of the secret key then it is doomed. So it just prevents man-in-middle? But do we already have HTTPS for that? Is it because TLS/SSL is a stream cipher method so HMAC is to add an extra layer of security?
Any comments and help are appreciated. Thank you very much.