In an ideal world, the private key should be stored in an HSM, preventing exfiltration. However, even assuming an HSM, the current scheme doesn't protect against malicious actors pre-signing requests on the client and exfiltrating those requests.
This library adds more defense-in-depth, making it harder to attack sessions, but not impossible.
Comments
If the user has malware can't that steal the private key as well? Why is it hard to exfil if the attacker has full access?
In an ideal world, the private key should be stored in an HSM, preventing exfiltration. However, even assuming an HSM, the current scheme doesn't protect against malicious actors pre-signing requests on the client and exfiltrating those requests.
This library adds more defense-in-depth, making it harder to attack sessions, but not impossible.