this post was submitted on 14 Sep 2022
21 points (100.0% liked)

Security

5010 readers
1 users here now

Confidentiality Integrity Availability

founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] yogthos@lemmy.ml 1 points 2 years ago (1 children)

But the malicious npm package can just read whatever key the app reads then decrypt the values. They are running with the same permission.

No, it cannot because apps cannot just reach into memory of other apps and keychain access has permissions per application.

[–] kevincox@lemmy.ml 1 points 2 years ago (1 children)

How does the keychain know what "application" is calling it?

[–] yogthos@lemmy.ml 2 points 2 years ago (1 children)

If set up properly then each application has its own private store that it registers with the keychain. This isn't exactly rocket science.

[–] kevincox@lemmy.ml 1 points 2 years ago (1 children)

Do you have links to "set up properly". The problem is that for most systems other than maybe some of the "app store" type setups the OS has not concept of "application". The credentials are just the user and that is the same for all unsandboxed apps.

[–] yogthos@lemmy.ml 2 points 2 years ago (1 children)

Here's an example of controlling access on per application basis with macOS keychain. The basic concept here is that the OS controls access to sensitive data, and applications can have individual stores associated with them. This allows control over what application can access a particular piece of data in the store.

[–] kevincox@lemmy.ml 1 points 2 years ago (1 children)

That just seems to be about granting an app access to all keys, which is not quite the same as per-app keys.

I know that macOS has this for sandboxed apps from the app store, maybe they have it for "sideloaded" apps as well but at least most OSes don't have that. At least for Windows and Linux there isn't a good way to identify an "app" to separate it from any other. My macOS knowledge is rusty but IIRC you install apps in a system-owned directory and apps only have permission to update themselves so maybe you could use the application path as a key, but the other listed affected OSes don't have that.

[–] yogthos@lemmy.ml 2 points 2 years ago

I'm not familiar with windows, but here's an example of how secrets management works on Linux.