News for hackers. Stuff that matters.
Re:Anyone can access deleted and private repository data on ... by londons_explore on Wednesday July 24, 2024 @03:19PM (#41060796)
This isn't a bug IMO.

If you know the hash of some data, then you either already have the data yourself, or you learned the hash from someone who had the data.

If you already have the data, there is no vulnerability - since you cannot learn anything you don't already have.

If you got the hash from someone, you could likewise have gotten the data from them.

People do need to be aware that 'some random hex string' in fact is the irrevocable key to all the data behind that hash - but that's kinda inherent to gits design. Just like I don't tell everyone here on HN my login password - the password itself isn't sensitive, but both of us know it accesses other things that are.

If github itself was leaking the hash of deleted data, or my plaintext password, then that would be a vulnerability.

Re:Anyone can access deleted and private repository data on ... by qual on Wednesday July 24, 2024 @03:24PM (#41060858)
>If you know the hash of some data, then you either already have the data yourself, or you learned the hash from someone who had the data.

From the article, you do not need to have the data nor learn the hash from someone who had the data.

>Commit hashes can be brute forced through GitHub’s UI, particularly because the git protocol permits the use of short SHA-1 values when referencing a commit. A short SHA-1 value is the minimum number of characters required to avoid a collision with another commit hash, with an absolute minimum of 4. The keyspace of all 4 character SHA-1 values is 65,536

Re:Anyone can access deleted and private repository data on ... by londons_explore on Wednesday July 24, 2024 @03:27PM (#41060890)
In which case, yeah, thats a vulnerability. They shouldn't allow a short hash to match up against anything but public data.
Re:Anyone can access deleted and private repository data on ... by gus_massa on Wednesday July 24, 2024 @04:16PM (#41061541)
It's common to use short hash in pull request, and then modify or rebase the commits.

The solutions are:

* Force people to use the full hash.

* Get use to a lot of dead links.

* Claim that it's a feature, not a bug.

Re:Anyone can access deleted and private repository data on ... by guipsp on Wednesday July 24, 2024 @05:47PM (#41062526)
* Force people to use the full hash for commits pushed now on?
Re:Anyone can access deleted and private repository data on ... by Dylan16807 on Thursday July 25, 2024 @02:06AM (#41065203)
* Check visibility at the time of posting.
Re:Anyone can access deleted and private repository data on ... by haneul on Wednesday July 24, 2024 @03:24PM (#41060857)
> If you know the hash of some data, then you either already have the data yourself, or you learned the hash from someone who had the data.

Don’t think so - the article mentions you can use the short prefix on GitHub, so you have a search space of 65536.

Re:Anyone can access deleted and private repository data on ... by Aurornis on Wednesday July 24, 2024 @03:26PM (#41060872)
> If you know the hash of some data, then you either already have the data yourself, or you learned the hash from someone who had the data.

You need to read to the end of the article where they show the brute-force way of getting the hashes.

Re:Anyone can access deleted and private repository data on ... by jkaptur on Wednesday July 24, 2024 @03:23PM (#41060839)
That's counterintuitive, though - often, the whole point of a hash is that it's one-way.
Re:Anyone can access deleted and private repository data on ... by refulgentis on Wednesday July 24, 2024 @03:27PM (#41060892)
Read TFA.