Skip to content

fix(platform): small robustness gaps in openDirectoryInFileManager and the Mongo TLS temp key #1768

Closed

Description

@ZhuchkaTriplesix
  • `openDirectoryInFileManager` (lib/core/platform/open_directory.dart): `dir.create(recursive: true)` is outside the `try`, while the contract says it returns `false` on failure. An unwritable or invalid path throws instead.
  • `resolveMongoTlsCertificateKeyFile` (lib/core/security/ssl_certificate_support.dart): the merged PEM is written with the default mode and only then `chmod 600`. The directory is `700`, so the window is narrow, but the file should be created with restrictive permissions from the start. If `writeAsString` throws, the temp directory is left behind.
  • `cleanupStaleMongoTlsTempFiles` deletes every `querya_mongo_tls_*` directory in the system temp at start-up, including those of another running Querya instance; its next Mongo reconnect then loses the certificate file.

Found in the system-functions review (see #1764).

Activity

  1. added
    bugSomething isn't working
    coreCore library logic and services
    P3Low priority / Polish & Enhancements
    securitySecurity related
    on Oct 25, 2026
  2. added a commit that references this issue on Oct 25, 2026
  3. ZhuchkaTriplesix commented on Oct 25, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Fixed on dev in #1789 (merged). Closing by hand: the PRs target dev, so GitHub would only close this when dev is merged into main.

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

    P3Low priority / Polish & EnhancementsbugSomething isn't workingcoreCore library logic and servicessecuritySecurity related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions