News for hackers. Stuff that matters.
Re:Hash collision in Apple NeuralHash model by lifthrasiir on Wednesday August 18, 2021 @06:14AM (#28219354)
But you can essentially perform DoS attack to human checkers, effectively rendering the entire system grind to a halt. The entire system is too reliant on the performance of NeuralHash which can be defaced in many ways. [1]

(Added later:) I should note that the DoS attack is only possible with the preimage attack and not the second preimage attack as the issue seemingly suggests, because you need the original CSAM to perform the second preimage attack. But given the second preimage attack is this easy, I don't have any hope for the preimage resistance anyway.

(Added much later:) And I realized that Apple did think of this possibility and only stores blinded hashes in the device, so the preimage attack doesn't really work as is. But it seems that the hash output is only 96 bits long according to the repository, so this attack might still be possible albeit with much higher computational cost.

[1] To be fair, I don't think that Apple's claim of 1/1,000,000,000,000 false positive rate refers to that of the algorithm. Apple probably tweaked the threshold for manual checking to match that target rate, knowing NeuralHash's false positive rate under the normal circumstances. Of course we know that there is no such thing like the normal circumstances.

Re:Hash collision in Apple NeuralHash model by shapefrog on Wednesday August 18, 2021 @08:00AM (#28220005)
I have seen it suggested that everyone should flood the system with flagged images to overwhelm it in protest to this move by apple.

Sounds pretty stupid to me to fill your phone with kiddie porn in protest, but you do you internet people.

Re:Hash collision in Apple NeuralHash model by mannerheim on Wednesday August 18, 2021 @08:58AM (#28220418)
You don't need to do that, just use images that collide with the hashes.
Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @10:43AM (#28221642)
How will you know something collides?
Re:Hash collision in Apple NeuralHash model by mannerheim on Wednesday August 18, 2021 @11:17AM (#28222317)
> Apple’s method of detecting known CSAM is designed with user privacy in mind. Instead of scanning images in the cloud, the system performs on-device matching using a database of known CSAM image hashes provided by NCMEC and other child-safety organizations. Apple further transforms this database into an unreadable set of hashes, which is securely stored on users’ devices.

https://www.apple.com/child-safety/pdf/CSAM_Detection_Techni...

Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @12:11PM (#28223306)
Yeah, so how would you know something would collide with the hash?
Re:Hash collision in Apple NeuralHash model by mannerheim on Wednesday August 18, 2021 @12:17PM (#28223413)
Because the hashes are stored on the user's device?
Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @12:18PM (#28223426)
No, encrypted and blinded hashes are stored. You can’t extract them.
Re:Hash collision in Apple NeuralHash model by fastball on Thursday August 19, 2021 @12:19AM (#28230272)
Right, but your device is checking against the hashes, no?

So at some point you generate an image which triggers a subroutine and you know that image collides.

Re:Hash collision in Apple NeuralHash model by cyanite on Wednesday August 18, 2021 @04:11PM (#28226447)
This also means that the device doesn’t know if a given image is a match.
Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @04:39PM (#28226799)
Correct, only the server does.
Re:Hash collision in Apple NeuralHash model by HALtheWise on Wednesday August 18, 2021 @03:53PM (#28226283)
Presumably, someone on the internet will download a dump _actual_ CP and run it through NeuralHash, then post the resulting hashes to GitHub. Doing so will be illegal for them because they are downloading CP, but it should be perfectly legal for you to then download the hashes they posted, randomly select one, and generate an innocuous image that matches it. The fact that Apple isn't posting hashes doesn't actually make it all that hard to get your hands on them.
Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @10:52AM (#28221823)
Because the algorithm and list will be on your phone, and can (has, per TFA) be extracted.
Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @10:54AM (#28221858)
You cannot extract or reverse the CSAM hashes. They've been encrypted and blinded using server-side-only keys. If TFA said that, it's lying.
Re:Hash collision in Apple NeuralHash model by lifthrasiir on Wednesday August 18, 2021 @12:00PM (#28223141)
After more reading of the whitepaper I think you are right. As I understand it, given the image hash H0 and CSAM hashes H[1]...H[n] (some might be duplicates in disguise) the algorithm proceeds like this:

- The device generates a secret X and divides it into X[1]...X[m] with the secret sharing algorithm. m is some large number and any k (but no less) copies out of X[i] are enough to reconstruct X.

- The device stores blinded hashes f(H[1])...f(H[n]). The function f itself is not known to the client.

- The image hash H0 is compressed with another function g to the range between 1 and n.

- The downscaled image data (for the human check) is encrypted with X and appended with (probably) random X[i].

- The result is then encrypted again with a key derived from f(H0) and sent to the server with an associated data g(H0).

- The server tries to decrypt it with a key derived from f(H[g(H0)]). This is only possible when H[g(H0)] = H0, i.e. H0 represents some known CSAM.

- You can only decrypt the second layer with at least k copies of X[i] then.

At this stage Apple can still learn the number of CSAM images less than k. The fix is described in an overly technical document and I can't exactly follow, but supposedly the client can inject an appropriate amount of synthetic data where only the first layer can be always decrypted and the second layer is bogus (including the presumed X[i]).

---

Assuming this scheme is correctly implemented, the only attack I can imagine is the timing attack. As I understand a malicious client can choose not to send false data. This will affect the number of items that pass the first layer of encryption, so the client can possibly learn the number of actual matches by adjusting the number of synthetic data since the server can only proceed to the next step with at least k such items.

This attack seems technically possible, but is probably infeasible to perform (remember that we already need 2^95 oracle operations, which is only vaguely possible even in the local device). Maybe the technical report actually has a solution for this, but for now I can only guess.

Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @12:41PM (#28223742)
That synopsis disagrees with Apple's own descriptions - or rather it goes into the secondary checks, which confuses the issue that the initial hash checks are indeed performed on-device:

> Apple’s method of detecting known CSAM is designed with user privacy in mind. Instead of scanning images in the cloud, the system performs on-device matching using a database of known CSAM image hashes provided by NCMEC and other child-safety organizations. Apple further transforms this database into an unreadable set of hashes, which is securely stored on users’ devices.

https://www.apple.com/child-safety/pdf/CSAM_Detection_Techni...

Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @10:58AM (#28221931)
One does not need to reverse the CSAM hashes to find a collision with a hash. If the evaluation is being done on the phone, including identifying a hash match, the hashes must also be on the phone.
Re:Hash collision in Apple NeuralHash model by robertoandred on Wednesday August 18, 2021 @11:17AM (#28222304)
No, matches are not verified on the phone. On the phone, your image hash is used to look up an encrypted/blinded (via the server's secret key) CSAM hash. Then your image data (the hash and visual derivative) is encrypted with that encrypted/blinded hash. This encrypted payload, along with a part of your image's hash, is sent to Apple. Then on the server, Apple uses that part of your image's hash and their secret key to create a decryption key for the payload. If your image hash matches the CSAM hash, the decryption key would unlock the payload.

In addition, they payload is protected at another layer by your user key. Only with enough mash matches can Apple put together the user decryption key and open the very innards of your image's payload containing the full hash and visual derivative.

Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @11:27AM (#28222520)
To quote a sibling comment, who looked into the horses' mouth:

> Apple’s method of detecting known CSAM is designed with user privacy in mind. Instead of scanning images in the cloud, the system performs on-device matching using a database of known CSAM image hashes provided by NCMEC and other child-safety organizations. Apple further transforms this database into an unreadable set of hashes, which is securely stored on users’ devices.

https://www.apple.com/child-safety/pdf/CSAM_Detection_Techni...

Re:Hash collision in Apple NeuralHash model by mannerheim on Wednesday August 18, 2021 @11:02AM (#28222014)
I believe the hash comparisons are made on Apple's end. Then the only way to get hashes will be a data breach on Apple's end (unlikely but not impossible) or generating it from known CSAM material.
Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @11:04AM (#28222062)
That's not what Apple's plans state. The comparisons are done on phone, and are only escalated to Apple if there are more than N hash matches, at which point they are supposedly reviewed by Apple employees/contractors.

Otherwise, they'd just keep doing it on the material that's actually uploaded.

Re:Hash collision in Apple NeuralHash model by mannerheim on Wednesday August 18, 2021 @11:16AM (#28222288)
Ah, never mind, you're right:

> Apple’s method of detecting known CSAM is designed with user privacy in mind. Instead of scanning images in the cloud, the system performs on-device matching using a database of known CSAM image hashes provided by NCMEC and other child-safety organizations. Apple further transforms this database into an unreadable set of hashes, which is securely stored on users’ devices.

https://www.apple.com/child-safety/pdf/CSAM_Detection_Techni...

Re:Hash collision in Apple NeuralHash model by cyanite on Wednesday August 18, 2021 @04:14PM (#28226477)
He is not right, though. The system used will not reveal matches to the device, only to the server and only if the threshold is reached.
Re:Hash collision in Apple NeuralHash model by cyanite on Wednesday August 18, 2021 @04:13PM (#28226470)
> That's not what Apple's plans state. The comparisons are done on phone

Yes but as stated in the technical description, this match is against a blinded table, so the device doesn’t learn if it’s a match or not.

Re:Hash collision in Apple NeuralHash model by floatingatoll on Wednesday August 18, 2021 @10:16AM (#28221221)
It’s incredibly stupid because your Apple ID will get terminated for abusing Apple services.
Re:Hash collision in Apple NeuralHash model by falcolas on Wednesday August 18, 2021 @10:53AM (#28221848)
There are applications which automatically save images sent to you to your camera roll (such as Whatsapp, IIRC). How can Apple prove you put them there intentionally?

Granted, they most likely won't care, but it's a legitimate attack vector.

Re:Hash collision in Apple NeuralHash model by floatingatoll on Wednesday August 18, 2021 @11:11AM (#28222182)
You’re right that it’s a valid attack upon the people Apple pays to review matched images before invoking law enforcement, but no harm comes to the recipient in that model, unless they receive real legitimate CSAM and don’t report it to the authorities themselves.

Attempted entrapment and abuse of computing systems, which is an uncomfortable way to phrase the WhatsApp scenario, would be quite sufficient cause for a discovery warrant to have WhatsApp reveal the sender’s identity to Apple. Doesn’t mean they’d be found guilty, but WhatsApp will fold a lot sooner than Apple, especially if the warrant is sealed by the court to prevent the sender from deleting any CSAM in their possession.

A hacker would say that’s all contrived nonsense and anyways it’s just SWATting, that’s no big deal. A judge would say that’s a reasonable balance of protecting the sender from being dragged through the mud in the press before being indicted and permitting the abused party (Apple) to pursue a conviction and damages.

I am not your lawyer, this is not legal advice, etc.