Repository navigation
Prevent Telegram short media IDs from aborting message parsing - #2564
Conversation
All three decoders now require at least 12 bytes before unpacking an ID. Missing or short IDs use (None, None), and nonempty short IDs produce a log entry with the media type and byte length. Message text and independently decoded media metadata are retained. A regression test constructs a referenced file with a one-byte ID and checks that the message survives and the expected warning is logged. Fixes abrignoni#1145
|
Thanks for the contribution! The changed artifact modules cite public research images in their
|
|
Thanks for digging into this one, and for the test. #2566 landed today. A media entry that can't be read is now logged and noted on its row instead of stopping the whole artifact. Your change still adds something on top of that: an embedded file with a damaged ID keeps its name, MIME type and thumbnail instead of showing as unreadable. So I'd like to merge it. Two small changes first:
When you push, please merge main in first so CI runs against #2566 and #2568. #2568 changes one of the #2566 tests so it no longer depends on a short ID failing, which your change would otherwise break. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test made an embedded media entry unreadable with a 1-byte ID. Once short IDs decode to an unknown ID (abrignoni#2564) that entry reads fine and the test fails for the wrong reason. A media entry that ends inside a field's length prefix fails in the reader itself, whatever the ID handling does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
I went ahead and made both changes so this doesn't wait on you. The PR now says Refs #1145, the notes say the handling was only exercised on constructed test data, and main is merged in. Nothing more needed from you. Thanks again for the fix. |
What this changes
Telegram message parsing can stop with a buffer-unpacking error when a referenced media item contains a short ID, preventing messages from being reported. The file, image and webpage decoders attempted to unpack any nonempty ID as a 32-bit integer followed by a 64-bit integer. IDs shorter than the required 12 bytes therefore raised an exception.
All three decoders now require at least 12 bytes before unpacking an ID. Missing or short IDs use (None, None), and nonempty short IDs produce a log entry with the media type and byte length. Message text and independently decoded media metadata are retained. A regression test constructs a referenced file with a one-byte ID and checks that the message survives and the expected warning is logged.
python_testsreported no discovered tests; the transcript does not show the new regression test running.repo_lintwas invoked three times, but no output or exit status is recorded.python admin/test/scripts/test_no_pypi_blackboxprotobuf.pywas invoked, but no result is recorded.python admin/scripts/check_claim_language.pywas invoked, but no result is recorded.python admin/scripts/check_artifact_descriptions.pywas invoked, but no result is recorded.python admin/scripts/check_conversation_column_order.pywas invoked, but no result is recorded.python admin/scripts/check_artifact_paths.pywas invoked, but no result is recorded.python admin/scripts/check_container_markers.pywas invoked, but no result is recorded.python admin/scripts/check_html_safety.pywas invoked, but no result is recorded.python admin/scripts/check_report_local_paths.pywas invoked, but no result is recorded.python admin/scripts/check_source_path.pywas invoked, but no result is recorded.python admin/scripts/check_source_file_column.pywas invoked, but no result is recorded.python admin/scripts/check_vendored.pywas invoked, but no result is recorded.python admin/scripts/lint_changed.py --base-ref "$BASE" ${{ steps.changed-files-py.outputs.all_changed_files }}appears in the transcript, but no resolved arguments or result are recorded.Ran
python3 -m pytest -q admin/test/scripts/test_telegram_message_media_ids.pyin a Linux container (python:3.12) for the iLEAPP telegramMessages change; 2 tests passed.Refs #1145
For a new or changed artifact
The "Ran the tool against a real extraction and confirmed the row counts, not just that it imports" step needs a person and was not done for the iLEAPP telegramMessages change.
python admin/scripts/check_artifact_output.py <report folder>on that report and fixed or documented every finding. An empty or constant column is often a real result (no group chats, coarse location denied); the fix for those is a sentence in the artifact'snotesnaming the column and saying it was empty or uniform, which is also what stops the checker reporting it.The "Ran python admin/scripts/checkartifactoutput.py on that report and fixed or documented every finding. An empty or constant column is often a real result ; the fix for those is a sentence in the artifact's notes naming the column and saying it was empty or uniform, which is also what stops the checker reporting it" step needs a person and was not done for the iLEAPP telegramMessages change.
--compare <multi-container report>reads the scaling for you: it should be exactly double.No local test run is recorded for the iLEAPP telegramMessages change to
scripts/artifacts/telegramMesssages.py.notes,descriptionandsample_datasay only what the data shows, and the numbers were re-derived from the finished run.Anything reviewers should know
Nothing beyond what is described above.