Why Bitwarden purge memory, his memory is not protected from reading by the kernel?

On linux, and Windows (and probably mac?) process can read other processes running under the same user, f.e by reading /proc/$pid/mem on linux. No root required. Especially in a typescript/electron app this requires significant engineering to prevent (a native rust module that stores keys using the kernels keyctl f.e would work, but then the typescript UI bits might keep the strings around until garbage collected…). I.e any other unsandboxed process could dump your Bitwarden vault’s credentials while it is running and unlocked.

Btw, since you mention Linux, on Linux, the “reload application processes to make sure that any leftover managed memory addresses are also purged” behaviour is currently disabled: clients/apps/desktop/src/main/window.main.ts at 6355a1964b52d55ef36071810138f5d28877b14f · bitwarden/clients · GitHub

And if the untrusted reader of the memory is the kernel itself, how can Bitwarden protect itself?

This would not be possible to protect against for any app, but is also not the threat model.

2 Likes