An git-annex repository with an autoenable=yes special remote can be used to exfiltrate data from another git-annex repository.

Advisory: cross repository data exfiltration via special remote

For example, suppose that ~/annex on my laptop is a git-annex repository that contains some annexed files whose content I only provide to some people. But I am not trying to hide that I have those files in that repository. So I push the git repository, without the annexed files, to a public server.

All an attacker needs to do is make a git-annex repository that contains an autoenabled special remote of type git:

git-annex initremote foo type=git location=/home/joey/annex autoenable=true

(They will first need to dummy up their own /home/joey/annex repository, with the same uuid as mine; that uuid is discoverable in what I pushed.)

In their repository, they can make some annexed files, with innocuous names, that use the keys of the annexed files I am keeping private. And make the git-annex branch record that those keys are located in the uuid of my repository.

Then they only need to coax me into cloning their repository and running git-annex sync. The foo remote is autoenabled and sync will get my private files from ~/annex. And, if the attacker's repository has preferred content configured, will send them on to origin.

This security hole is not limited to autoenabled git remotes. It could be an autoenabled S3 bucket, if I habitually keep S3 environment variables set. Or it could be an autoenabled rsync special remote with an rsyncurl that points into my server via ssh. Unlike the git special remote, some of those don't need the UUID to match either.

A harder to exploit variant of this security hole is when I have not published my ~/annex git repository. The attacker guesses that I am in possession of a file with a known hash, and guesses where I might be keeping it. They can try many locations with many autoenabled special remotes.

(It's almost possible to use this to exfiltrate arbitrary non-annexed files. The attacker could make a directory or rsync special remote with importtree=yes that autoenables. The only reason this doesn't work is that remote.name.annex-tracking-branch needs to be set in order to make git-annex sync use it. They could try to social engineer me into running git-annex import, but that seems considerably harder. Still, while this seems too hard to be a viable attack, it seems likely that any fix to the main attack will also close off this one.)

--Joey

[fixed|done]]