Live data from Hacker News

Less is safer: Reducing the risk of supply chain attacks

obsidian.md

181–190 of 274 posts

Re: Less is safer: Reducing the risk of supply chain attacks

#181

Earlier quoted context omitted.

Don’t most plugin models work this way? Does VSCode, Vim, Emacs, and friends do anything to segregate content? Gaming is the only area where I expect plugins have limited permissions.

vim and emacs are over 30 years old and therefore living with an architecture created when most code was trusted. Encrypting network protocols was extremely rare, much less disks or secrets. I don't think anything about the security posture of vim and emacs should be emulated by modern software. I would say VSCode has no excuse. It's based on a browser which does have capabilities to limit extensions. Huge miss on th…

You have to get out the beaten path to get plugins into Vim/Emacs. It's not difficult, but you don't have access to a marketplace open to the world from the get go. I think Emacs have ELPA, but I would put that at the level of OS repos like Debian/Alpine.

Re: Less is safer: Reducing the risk of supply chain attacks

#182

Yes, you are responsible for all the code you ship to your users. Not pinning dependencies is asking for trouble. It is literally, "download random code from the Internet and hope for the best."

Pinning dependencies also means you're missing any security fixes that come in after your pinned versions. That's asking for trouble too, so you need a mechanism by which you become aware of these fixes and either backport them or upgrade to versions containing them.

> so you need a mechanism by which you become aware of these fixes and either backport them or upgrade to versions containing them

RSS Feeds?

Re: Less is safer: Reducing the risk of supply chain attacks

#183

> We do not run postinstall scripts. This prevents packages from executing arbitrary code during installation. I get the intent, but I’m not sure this really buys much. If a package is compromised, the whole thing is already untrustworthy and skipping postinstall doesn’t suddenly make the rest of the code safe. If it isn’t compromised, then you risk breaking legitimate installation steps. From a security perspective,…

It does protect the build machine though. Seems like quality, low-hanging security fruit to me. If I want to casually hack on some random web app, I don’t have to worry about giving arbitrary scripts running from the ~4 gazillion dependencies.

Re: Less is safer: Reducing the risk of supply chain attacks

#184
post #78

Earlier quoted context omitted.

> Thank god for tauri I’d love to try it, but speaking of security, this was the first thing I saw: sh https://create.tauri.app/sh )

Right. But you know how to fetch and inspect (yea?) so, I with you that piping random crap to sh is bad. Maybe these snips encourage that behavior. Tauri is trustable (for some loose definition) and the pipe to shell is just a well known happy-path. All that to say it's a low value smell test. Also, I'm in the camp that would rather git clone and then docker up. My understanding is it gives me a littl more sandbox.

I think I would prefer to see official supports for major package managers, even with unofficial repos (Debian, Macports,...). We went from a time where software were usually tarballed to one where devs are encouraging piping to shell.

Re: Less is safer: Reducing the risk of supply chain attacks

#185

Earlier quoted context omitted.

Sell it to us! Why do you use specifically firejail? There are so many options, from so many different security perspectives, that analysis paralysis is a real issue.

I feel like I should keep track of all my comments on HN because I remember writing a lengthy comment on firejail more than once. I cannot keep doing this. :D For user-space, there is usually bubblewrap vs. firejail. I have not personally used bubblewrap, so I cannot comment on that, but firejail is great at what it does. The last comment was about restricting clipboard access to either X11 or Wayland which is possib…

So do you configure firejail to give each app their own separate, permanent home directories? Like "firejail --private=/home/user/firejails/discord discord", "firejail --private=/home/user/firejails/chromium chromium", and so on?

Re: Less is safer: Reducing the risk of supply chain attacks

#186

There’s some advice that’s been going around lately that I’ve been having trouble understanding: the idea that you should not be updating your dependencies when new patches are released (e.g., X.X.PATCH). I understand that not updating your dependencies when new patches are released reduces the chance of accidentally installing malware, but aren’t patches regularly released in order to improve security? Wouldn’t it g…

The tension between improvement or regression when updating is real and ubiquitous but it is worse for apps in the npm ecosystem (like Obsidian).

Not only is npm a prominent target but it also does not allow packages to be removed or blocked for usage without a human on their side in the loop.

The result is that they are slow to remove malicious packages and slowing down your own updates helps to mitigate this a little.

Re: Less is safer: Reducing the risk of supply chain attacks

#187
> Obsidian has a low number of dependencies compared to other apps in our category

Whataboutism. Relative comparisons don't address absolute risk. I checked three random packages: prism pulls 22, remark pulls 51, pixijs 179! So that's 250+ transitive dependencies just from those.

> Features like Bases and Canvas were implemented from scratch instead of importing off-the-shelf libraries. This gives us full control over what runs in Obsidian.

Full control? There are still hundreds of dependencies.

> This approach keeps our dependency graph shallow with few sub-dependencies. A smaller surface area lowers the chance of a malicious update slipping through.

Really? Again, this is just one package: https://npmgraph.js.org/?q=pixijs

> The other packages help us build the app and never ship to users, e.g. esbuild or eslint.

Build tools like esbuild don't ship to users, but a compromised build tool can still inject malicious code during compilation. This is supply chain security 101.

> All dependencies are strictly version-pinned and committed with a lockfile

Version pinning is, I would hope, standard practice in any professional development team years and years ago. It prevents accidental updates but doesn't stop compromised existing versions.

> When we do dependency updates, we: > [snip]

While these practices are better than nothing, they don't fundamentally address the core issue.

> That gap acts as an early-warning window: the community and security researchers often detect malicious versions quickly

According to whom? Heartbleed, a vulnerability in a package with far more scrutiny than a typical npm module took what, 2 years to be found? The "community detection" assumption is flawed.

I'm not trying to put Obsidian down here - I sympathize, aside from implementing everything themselves, what can they do! I'm trying to point out that while their intent is good, this is a serious problem and their solution is not a solution.

Of course, it's the same in any project with dependencies. It's the same in other languages as well - if they have a convenient package manager. Like Rust and Cargo.

This problem came with the convenience of package managers and it should be fixed there, not by every application like Obsidian. I'm not sure how but maybe once a package is starting to become popular, additional security measures must be put in place for the author to be able to continue to commit to it. Signing requirements, reproducible builds, 2fa, community reputation systems, who knows.

Individual applications can't solve supply chain security through wishful thinking and version pinning.

Package managers need to solve this at the infrastructure level through measures like mandatory code signing, automated security auditing, dependency isolation, or similar system level approaches.

Obsidian's practices are reasonable given the current tooling limitations, but they don't eliminate the fundamental risks that the package managers bring to modern dependency ecosystems.

Re: Less is safer: Reducing the risk of supply chain attacks

#188
post #170

Earlier quoted context omitted.

I believe they're saying it can open, it just can't send the data anywhere. Seems a little excessive, but here we are.

If it can open and write any file on the OS, it's pretty much game over. Too many ways to exfiltrate data even without network/socket access.

Worse, what keeps this from editing the config files for Little Snitch (or similar blockers)?
Post reply on HN