superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.57k stars 300 forks source link

[feature/privacy] Streaming removal of Exif data from mp4 files #2577

Open tsmethurst opened 5 months ago

tsmethurst commented 5 months ago

Currently we remove Exif data tags (except rotation and alpha-channel data) from images using exif-terminator. However, we don't have a good way of removing exif data from mp4 videos yet. This has privacy implications, since Exif data can contain location information if that setting is enabled on the device which took the video, and the video has not been reencoded or scrubbed by the user already.

To make it easier for users to avoid leaking location metadata, we should look at updating exif-terminator to also allow removal of Exif metadata from mp4 file types, and update GoToSocial to pass mp4s through exif-terminator when media processing is performed.

Relevant terminator issue: https://codeberg.org/superseriousbusiness/exif-terminator/issues/9

daenney commented 4 months ago

It turns out this apparently uses QuickTime or XMP tags, and there's multiple of the fuckers that can contain location info

There's a bajillion location related tags.

daenney commented 4 months ago

Matroska spatial information tags only do country-level tags it seems: https://www.matroska.org/technical/tagging.html. Haven't found any official docs on encoding coordinates in it.

tsmethurst commented 4 months ago

Starting to understand why people just reencode the whole video file :')