Skip to content

security(android): apply the attachment open gate on Android and clean up the temp root #289

Closed

Description

@DeepDiver1975

Follow-up to #285 (fix(files): sanitise attachment names and gate what the OS launcher may open) and the Android FileProvider PR from the same review.

#285 introduced AttachmentTempPaths.IsOpenableAttachment and made the desktop StorageProviderFileDialogService.OpenFileAsync refuse anything that is not an existing regular file with an allow-listed extension under the private temp root. The Android head does not apply that gate: AndroidFileDialogService.OpenFileAsync hands whatever path it receives to FileProvider.GetUriForFile with a MIME guessed from the extension and */* as fallback.

To do

  • Apply AttachmentTempPaths.IsOpenableAttachment(path) in AndroidFileDialogService.OpenFileAsync (and ShareFileAsync for attachment shares) and return without launching when it is false.
  • The temp root on Android is <cache>/lagebuch/, which the FileProvider exposes via the attachments cache-path entry; keep that in sync if the root moves.
  • Add a startup janitor that removes per-open directories under AttachmentTempPaths.Root older than, say, one day. Today every ÖFFNEN leaves a <guid>/ directory behind on every platform (noted in the fix(files): sanitise attachment names and gate what the OS launcher may open #285 review).
  • Consider setting UnixFileMode 0700 on the temp root on Unix so attachment bytes are not readable by other local users.

Activity

  1. added a commit that references this issue on Oct 16, 2026
    ff4152b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions