Hacker News new | ask | show | jobs
by sebiw 109 days ago
Which brings us to the old saying: Do not deserialize untrusted data.

In the context of Rubygems and their specs this obviously is harder to manage but dependencies such as Rubygems are and will always be part of your app's Trusted Computing Base.

3 comments

> Do not deserialize untrusted data.

I think the better lesson is "use safe codecs"

> dependencies such as Rubygems are and will always be part of your app's Trusted Computing Base

This mindset is changing, in the npm ecosystem, managing and updating dependencies have become somewhat of a gamble. It is no longer if, its when you are compromised.

Gems/packages should explicitly declare what kind of features they need/want (file, net, deserialization, execute)

And when the sig. changes, you should get a warning

Very similar to the iOS entitlements

Checksumming the dependencies in the Gemfile may help. https://blog.rubygems.org/2024/12/19/bundler-v2-6.html
I have to use several gems that download and compile C sources from github at install time.
Accounts get compromised, no checksumming in the world can help with that.
Gemfile.lock checksums by default on bundler 4+
LLMs: hold my beer