DMCA, Easylist, Git, and functionalclam: A Solution

Recently there was a post on /r/programming entitled Ad blockers under attack: DRM through the DMCA.

The gist is that a DMCA claim, usually reserved for copyright infringement, was used to take a domain name ( out of a blacklist that adblockers use to know which domain names to block. The maintainers of the git repo were forced to remove the domain name from the list.

The thing is that instead of removing the domain from the git history, the repo maintainers created another commit to remove the domain name from the list. The commit had the commit message “M: Removed due to DMCA takedown request”. Any commit in git can be reverted. Unless the repo owners are forced to remove the commit from the git history, users can always revert the commits that remove domain names because of DMCA claims and they will have the complete list of blocked domain names. If all DMCA takedown requests have the same commit message then it will be trivial to find and revert all the commits whose purpose is to remove entries based on DMCA takedown requests.

I went ahead and created a general-purpose shell script that searches for all commits with a particular commit message and revert those commits.

#! /bin/sh
git log –pretty=oneline –grep="$1" | awk '{print $1}' | xargs git revert

Change the permissions for the shell script by running

chmod a+x

You can run the script like so: "M: Removed due to DMCA takedown request"

Let’s break the command down:

git log --pretty=online --grep"$1"

This part gives us a list of all the commits whose commit messages match a particular string. In this case, that string is the first argument to the command. In the example above, that string is “M: Removed due to DMCA takedown request”.

awk '{print $1}'

Each line contains both the commit hash and the commit message but we only want the commit hash. This command gives us only the hash.

xargs git revert

Finally, we pass the hashes as parameters to git revert which reverts each commit.

I don’t expect this to be used practically by anyone since most ad blockers download their lists automatically and overriding that list manually, if possible at all, is inconvenient to say the least.

PS: This is a general-purpose shell script. I do not condone piracy.






Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.