Skip to content

fix(desktop): restrict renderer-selected applications in FilesOpenPath #78

Closed

Description

@trmosala

Description

FilesOpenPath accepts an arbitrary application string from the renderer and passes it to execFile as the executable on Linux/Windows (or open -a on macOS). A compromised trusted renderer can cross into native application execution. V2's port binding already authenticates the renderer connection, so CM's older claim of no transport sender validation needs narrowing.

Priority: high. Reviewed CookieMonster CM-Split-v2 at dafdcd4171466050c984d524ca0d1a09d31f100e; links use the identical remote V2 source on Ubuntu 26.04.1 x64, Bun 1.4.2.

Steps to reproduce and evidence

Traced the public RPC payload -> file handler -> DesktopFiles.openPath. There is no application allowlist or main-owned application identifier; executable and its single argument come from the request. No exploit or native process execution was attempted.

Acceptance criteria and verification

  • Define the allowed open-with applications in main, or accept validated main-issued application identifiers rather than arbitrary executable strings.
  • Validate the target and option-like arguments while preserving legitimate user-selected open-with behavior.
  • Test the raw RPC payload and reject unapproved executable selections; retain the current authenticated renderer port boundary.

Source and related work

packages/desktop/src/shared/ipc-rpc/files.ts, packages/desktop/src/main/ipc-handlers/files.ts, packages/desktop/src/main/files/index.ts.

CM identified this in inherited upstream code. Track the current V2 path here; any upstream report must verify the matching upstream revision.

Activity

  1. trmosala commented on Oct 21, 2026

    @trmosala
    OwnerAuthor

    Merged into CM-Split-v2 as 290d7d6353c0c7a4a356af780b5687f2dcfe5cfc through PR #96. Its tree exactly matches reviewed source 68ab9205709350385471eb2d383b3cff3c18e678.

    Implemented in PR #96, reviewed source 68ab9205709350385471eb2d383b3cff3c18e678.

    Open-with requests now select from the native application allowlist and validate absolute/UNC targets before execution. Raw renderer RPC tests preserve legitimate selections and reject arbitrary executables and option-like targets. Authenticated renderer-port ownership remains enforced.

    Final verification is deferred at the user's explicit request to finish and close the implementation issues before one final test pass. This closure records implementation completion, not a claim that the final combined/platform checks have passed. Any failure in that pass will be recorded against the relevant issue.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions