• 0 Posts
  • 383 Comments
Joined 3 years ago
cake
Cake day: September 2nd, 2023

help-circle

  • At some point you have to assume some kind of knowledge though. If you have to explain everything from the basics, the moment a concept is slightly complicated, the blog gets thousands of pages long.

    You don’t need to explain how an integer is represented in binary in memory in a blog post about atomic integers. Most people that read about atomic integers already know how integers are represented in memory.



  • I once found a full pack of cigarettes on the ground at age ~10. I quickly figured out that lighting it on fire and using the cigarette to set off fireworks was so much easier than using a lighter. I didn’t even think of smoking it, I just left it lit on the ground and used it as a lighter.

    I didn’t understand why my parents were so worried when they found out lol.




  • Good practice != Something that ensures security. As I said, it’s an even better practice to just host your own fork if what you want is security. The reason to use git hashes is mostly so you don’t have to trust the author following semver in there version number. It’s a matter of ensuring that your code will always compile, not a security feature.

    Have you read the article? Your arguments derive from an assumption of “sha1 is mutable, sha256 is immutable”. First of all, every hashing algorithm is going to have collisions, that’s an unavoidable “feature” of hashes. And sha1 is in no way “mutable”, it takes a great amount of effort (and money) to generate a collision. Furthermore, those collisions are not arbitrary. You have to calculate them beforehand. As the article says: what is more likely? Paying 40k€ in compute time to generate a single collision? Or just paying an open source maintainer 40k€ to let you do 1 new commit that most people are going to download anyway?



  • If someone has access to write to a repo you are downloading code from, and you don’t trust that someone, you shouldn’t be running the code in that repo.

    The only “security” vulnerability is: I have audited and verified that the code in commit 05682ab36ca. And I will use only that version.

    What you do then is: download that commit and store it in a local repo, and package it so you can distribute it to your clients.

    Auditing external software is tremendous effort, even if it is open source. Using your local repo instead of downloading that commit from GitHub every time is very little extra effort in comparison.

    And if you really need it. You can always hash with sha256 yourself and verify that the commit with that sha1 still produces the same sh256. So you can keep downloading it each time, just need to store the sha256.



  • I tried to implement my own git from scratch. And when I got to choose a hashing algorithm, I reached the exact same conclusion as the author pretty fast.

    The hashing algorithm doesn’t really matter as long as it’s good enough to prevent accidental collisions. And if there is a collision, it is extremely easy to check.

    If you are about to create a new object and an object with that hash already exists, you compare the 2 objects. If they are the same, nothing happened. If they are different, you just found a collision. Throw some obscure error that will only be witnessed once in the lifetime of the universe and be done with it. Tell the user to change a single bit of the input and be done with it.

    The purpose of object hashes in git was never to provide security. Security is achieved through other means.







  • Easy.

    Replace “manager” with “prompter” and “employee” with “LLM”.

    The manager told the employee to do something.

    Afterwards, something bad happened.

    Did the employee do what the manager told it to do. And the bad situation is a consequence of following those instructions? Yes -> manager’s fault. No -> employee’s fault.

    Did the employee do something illegal (or against some other rule)? Yes -> employees fault

    The thing requested was illegal to request (or against some other rule)? Yes -> Manager’s fault

    Note that more than one thing can be true at the same time. So even if the employee does whatever the manager told it to do. If that thing was illegal to do, both of them are at fault.

    If it’s the “manager”'s fault -> the prompter is liable

    If it’s the “employee”'s fault -> the LLM company is liable.

    Easy as that. It works like any other situation.

    If any machine has been properly maintained and malfunctions, the maker of that machine is liable. If the operator was using a chainsaw to cut through concrete and the chainsaw malfunctions the operator (and whoever (if anyone) ordered the operator to do that) is liable.