I was just sent a 5MB PDF file from Messenger.
On the Matrix side, it arrived as a 944B file. The file name is correct, but the payload is not.
<html><head><meta charset="utf-8" /><meta name="referrer" content="origin" /></head><body><script type="text/javascript">document.location.replace("https:\/\/cdn.fbsbx.com\/v\/more-stuff-here");</script><script type="text/javascript">setTimeout("(new Image()).src=\"\\\/laudit.php?r=ORIGIN_REFERRER_POLICY&u=https\\u00253A\\u00252F\\u00252Fcdn.fbsbx.com\\u00252Fv\\u00252Fmore-stuff-here\";",5000);</script></body></html>
Bridge logs are like this (URLs, tokens, etc. have been mangled):
Jun 25 09:54:00 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:00,680] [[email protected].@user:example.com] {'t': 'fullReload', 'seq': 3}
Jun 25 09:54:00 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:00,680] [[email protected].@user:example.com] GET https://0-edge-chat.facebook.com/pull?__rev=2000213456&_
_user=123456789&__a=1&ttstamp=658169781191208484107102895358658169975710510011675113541222&fb_dtsg=BZFNcyFFkfY5:BZFb4idtKq6z&msgs_recv=0&sticky_token=1328&sticky_pool=ratn0c01_chatproxy-regional&
clientid=8c682b5&state=offline&__req=2y1&seq=3
Jun 25 09:54:27 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:27,674] [[email protected].@user:example.com] {'t': 'msg', 'seq': 4, 'u': 123456789, 'ms': [{'type': 'deltafl
ow', 'sequencer': '1496430', 'fbid': '123456789'}]}
Jun 25 09:54:27 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:27,675] [[email protected].@user:example.com] GET https://0-edge-chat.facebook.com/pull?__rev=2000213456&_
_user=123456789&__a=1&ttstamp=658169781191208484107102895358658169975710510011675113541222&fb_dtsg=BZFNcyFFkfY5:BZFb4idtKq6z&msgs_recv=0&sticky_token=1328&sticky_pool=ratn0c01_chatproxy-regional&
clientid=8c682b5&state=offline&__req=2y2&seq=4
Jun 25 09:54:27 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:27,790] [[email protected].@user:example.com] {'t': 'msg', 'seq': 5, 'u': 123456789, 'ms': [{'ofd_ts': 156144
9267615, 'delta': {'attachments': [{'fbid': '1111119692921331', 'fileSize': '5089362', 'filename': 'file.pdf', 'hash': '1111119692921331', 'id': '1111119692921331', 'mercury': {'
blob_attachment': {'__typename': 'MessageFile', 'attribution_app': None, 'attribution_metadata': None, 'filename': 'file.pdf', 'url': 'https://l.facebook.com/l.php?u=https%3A%
2F%2Fcdn.fbsbx.com%2Fv%2Ft23.4932-29608576_n.pdf%2Ffile.pdf%3F_nc_cat%3D105%26_nc_oc%3DAQkzegW_kkk1iJ3k-
9xSd8xS3No%26_nc_ht%3Dcdn.fbsbx.com%26oh%3D0cc1300NVwN4jteV_zNMMWitCtUnKmeyMcwBuTMRvaZvHdLGQW
XVMDOd3yZg7E2cHorag3Mv6CoTk1jvXMz2QDqX0IbeXjmGIsiM5uHjM4Clr9VU0SAA&s=1', 'content_type': 'attach:unknown', 'is_malicious': False, 'message_file_fbid': '1111119692921331', 'url_shimhash': 'AT09TG1V
g12RGMg4Q-_Gp_7RXjw0sW0NSVLaGoOB1jHuesuQ-NH8UO12iqws4Ho1XzEd5nYixMDqxwh2TZ4IsqmQQSC7E8Cuj8O_HtOjmnnpWmpMfcGaMVR1Ls3k5iGJL-sssM-NP0UFTckoQQ_QcQ', 'url_skipshim': True}}, 'mimeType': 'application/p
df', 'otherUserFbIds': ['123456789'], 'titanType': 7, 'useRefCounting': True}], 'irisSeqId': '1496430', 'irisTags': [], 'messageMetadata': {'actorFbId': '123452182', 'folderId': {'systemFolderId'
: 'INBOX'}, 'messageId': 'mid.$cBBBBBBFrv13bxuZITlrjaFaSri_d', 'offlineThreadingId': '6549192867798986717', 'skipBumpThread': False, 'skipSnippetUpdate': False, 'tags': ['source:chat:web'], 'thre
adKey': {'otherUserFbId': '123452182'}, 'threadReadStateEffect': 'MARK_UNREAD', 'timestamp': '1561449267278', 'unsendType': 'deny_for_non_sender'}, 'requestContext': {'apiArgs': {}}, 'class': 'Ne
wMessage'}, 'type': 'delta', 'iseq': 1496430, 'queue': 123456789}]}
Jun 25 09:54:27 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:27,791] [[email protected].@user:example.com] GET https://0-edge-chat.facebook.com/pull?__rev=2000213456&_
_user=123456789&__a=1&ttstamp=658169781191208484107102895358658169975710510011675113541222&fb_dtsg=BZFNcyFFkfY5:BZFb4idtKq6z&msgs_recv=0&sticky_token=1328&sticky_pool=ratn0c01_chatproxy-regional&
clientid=8c682b5&state=offline&__req=2y3&seq=5
Jun 25 09:54:27 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:27,793] [[email protected].@user:example.com] onMessage(Message(text=None, mentions=[], emoji_size=None, uid='mi
d.$cBBBBBBFrv13bxuZITlrjaFaSri_d', author='123452182', timestamp=1561449267278, is_read=None, read_by=[], reactions={}, sticker=None, attachments=[FileAttachment(url='https://l.facebook.com/l.php
?u=https%3A%2F%2Fcdn.fbsbx.com%2Fv%2Ft13.2708-21%2F65205994_3222219696254664_3113314178499608576_n.pdf%2Ffile.pdf%3F_nc_cat%3D105%26_nc_oc%3DAQkzegW_ggk1iJ3K5ceeMxxUxEA9yzGBjcepl
7sPAnLgGj7k-9xCt63VA0DSd8xS3No%26_nc_ht%3Dcdn.fbsbx.com%26oh%3D0cc1300c266d19502cf18c92e977cbd5%26oe%3D5D144664%26dl%3D1&h=AT0OLfmGIsiM5uHjM4Clr9VU0SAA&s=1', size=5089362, name='file.pdf', is_malicious=False, uid='1111119692921331')], quick_replies=
[], unsent=False, reply_to_id=None, replied_to=None, forwarded=False), 123452182, ThreadType.USER)
Jun 25 09:54:28 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:28,023] [[email protected]] POST /_matrix/media/r0/upload <944 bytes> as user @facebook_123452182:example.com
Jun 25 09:54:28 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:28,062] [[email protected]] PUT /_matrix/client/r0/rooms/%21eBijGUKrRwIUPIOfKm%3Aexample.com/send/m.room.messag
e/11561449268062 {"msgtype": "m.file", "body": "file.pdf", "url": "mxc://example.com/kqBoMavpFFvzHfjzFPfMmuRk", "info": {"mimetype": "text/html", "size": 944}} as user @facebo
ok_123452182:example.com
Jun 25 09:54:28 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:28,155] [[email protected]<->123456789] Unhandled Messenger message: Message(text=None, mentions=[], emoji_size=None, uid='mid.$cBBBBBBFrv13bxuZITlrjaFaSri_d', author='123452182', timestamp=1561449267278, is_read=None, read_by=[], reactions={}, sticker=None, attachments=[FileAttachment(url='https://l.facebook.com/l.php?u=https%3A%2F%2Fcdn.fbsbx.com%2Fv%2Ft13.2708-21%2F608576_n.pdf%2Ffile.pdf%3F_nc_cat%3D105%26_nc_oc%3DAQkzxCtNo%26_nc_ht%3Dcdn.fbsbx.com%26od195977cbd5%26oe%3D5D144664%26dl%3D1&h=AT0OLeV_zMNMrag3Mv6Co0SAA&s=1', size=5089362, name='file.pdf', is_malicious=False, uid='1111119692921331')], quick_replies=[], unsent=False, reply_to_id=None, replied_to=None, forwarded=False)
Jun 25 09:54:28 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:28,208] [[email protected].@user:example.com] POST https://www.facebook.com/ajax/mercury/delivery_receipts.php {'__rev': 2000213456, '__user': '123456789', '__a': '1', 'ttstamp': '658169781191208484107102895358658169975710510011675113541222', 'fb_dtsg': 'BZFNcyFFkfY5:BZFb4idtKq6z', 'message_ids[0]': 'mid.$cBBBBBBFrv13bxuZITlrjaFaSri_d', 'thread_ids[123452182][0]': 'mid.$cBBBBBBFrv13bxuZITlrjaFaSri_d', '__req': '2y4', 'seq': 5}
Jun 25 09:54:28 matrix-mautrix-facebook[10524]: [2019-06-25 07:54:28,220] [[email protected]] 172.18.0.7 [25/Jun/2019:07:54:28 +0000] "PUT /transactions/611?access_token=TOKEN HTTP/1.1" 200 158 "-" "Synapse/1.0.0"