Skip to content

fix(attachments): ask before sending a file whose metadata BitDM cannot remove - #44

Merged
Henner4746 merged 1 commit into
mainfrom
fix/metadaten-hinweis
Nov 30, 2026
Merged

Henner4746 merged 1 commit into
mainfrom
fix/metadaten-hinweis

Conversation

@Henner4746

Copy link
Copy Markdown
Owner

Addresses SEC-M3 from the external security assessment of 16–23 Nov 2026: "GIF, TIFF (incl. GPS), MKV, WebM, PDF, Office, MP3 keep all metadata and original filename with no warning".

Confirmed

bereinige handles JPEG, PNG, WebP and ISO-BMFF (HEIC/AVIF, MP4/MOV/3GP/M4V). Everything else returns NichtUnterstuetzt, and AppState._ohneMetadaten then sends the file unchanged, under its original name, without a question. The metadata header comment calls this a "known limit, not a promise", but the user was never told.

Fix

  • traegtUnentfernteMetadaten() recognises, by the first bytes (not the extension): PDF, ZIP (docx/xlsx/pptx/odt…), GIF, TIFF (II/MM), MP3 (ID3 and frame sync), Matroska/WebM, Ogg, FLAC, RIFF (WAV/AVI; WebP stays cleaned) and ISO files with a brand bereinige does not know (e.g. M4A).
  • For these, sending asks the existing "Send it anyway?" question with its own text (metaKept): author, software, times, sometimes location, and the file name go along. Without a UI to ask, the file is not sent, the same rule as for images that cannot be cleaned.
  • The file name is kept (for a document it is usually wanted); voice messages are excluded as before; files without a known signature are not asked about.

Tests

  • test/anhang/metadaten_test.dart: each format above is recognised; JPEG/WebP (cleaned) and plain text are not.
  • test/oberflaeche/sperre_zustand_test.dart: a PDF triggers the question; No sends nothing, Yes sends it under its name; without a question it is not sent; raw data without a signature goes out without a question.

Run in CT 107: flutter analyze shows only the 29 existing hints; test/anhang, test/oberflaeche, test/core: 528 green.

Open (decision)

This asks for every such file, which is real friction for people who send many PDFs. Alternatives: ask once per format, or a setting. Actually stripping more formats (TIFF/GIF/PDF info dictionaries) would be a separate piece of work.

🤖 Generated with Claude Code

…ot remove

Only JPEG, PNG, WebP, HEIC/AVIF and MP4/MOV are cleaned. PDF, Office/ODF
and other ZIP files, GIF, TIFF (with GPS), MP3, Matroska/WebM, Ogg, FLAC,
WAV/AVI and unknown ISO brands such as M4A went out with all metadata and
their original name, without a word (security assessment 2026-11-23,
SEC-M3).

traegtUnentfernteMetadaten() recognises these by their first bytes. Sending
one now asks the same "Send it anyway?" question as an image that could
not be cleaned, with its own text naming what goes along (author, software,
times, sometimes location, file name). The file name is kept: for a document
it is usually wanted. Voice messages are excluded as before; files without a
known signature are not asked about.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Henner4746
Henner4746 merged commit d1cf07c into main Nov 30, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant