Skip to content

Desktop renderer CSP: restrict cleartext transport to loopback #2117

Closed as not planned

Description

@integry

Problem

Final review of transport epic PR #2035 at exact head d4226b2 found a renderer security regression (review finding F1, comment 5545248706). apps/desktop/renderer.html broadens connect-src to scheme-wide http: and ws:, which permits arbitrary cleartext remote/LAN destinations. The runtime endpoint validator permits cleartext only for normalized loopback endpoints, while remote instances and ProPR Connect tunnel endpoints use HTTPS/WSS.

Required correction

Tighten the packaged renderer CSP so:

  • remote API/tunnel instances remain supported over https: and wss:;
  • cleartext http: and ws: are allowed only for the supported loopback authorities (localhost, IPv4 loopback, and IPv6 loopback as accepted by the endpoint normalizer), including required development/local ports;
  • arbitrary cleartext remote and LAN hosts are rejected;
  • production renderer, IPC, session permission, credential injection, pairing approval, and navigation boundaries remain fail-closed;
  • no unsafe inline/eval or broad default/connect source is introduced.

Use a static narrowly scoped allowlist if it accurately covers the normalizer; otherwise implement a validated per-profile policy without creating a startup race. Add focused CSP policy coverage proving supported loopback HTTP/WS forms and remote HTTPS/WSS forms pass, while non-loopback cleartext and deceptive hostname forms fail. Preserve Linux/macOS packaging and ProPR Connect tunnel behavior. Windows is out of scope.

Acceptance

Final review F1 is resolved; focused security tests, full suite, CodeQL, Validate Changes, packaged Connect Darwin/Linux x64+ARM64, and unsigned Darwin/Linux x64+ARM64 all pass on the combined transport head.

Activity

  1. propr-dev commented on Sep 4, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-5.6-sol
    • Branch: 2117/gpt-5.6-sol-desktop-renderer-csp-rest-20260904-1907-yeh
    • Base Branch: 1953-epic-desktop-transport-api
    • Worktree: issue-2117-20260904-1907-gpt-5.6-sol-yeh

    🔍 Track Task Execution

  2. added a commit that references this issue on Sep 4, 2026
  3. propr-dev commented on Sep 4, 2026

    @propr-dev
    Contributor

    ⚠️ Post-processing encountered an error, but ProPR analysis was completed.

    Post-processing Error:
    Execution aborted by user request

    AI Processing Completed

    Execution Details:

    Summary:
    Implemented the renderer CSP correction for issue #2117.

    • Restricted cleartext connections to canonical loopback hosts.
    • Preserved remote HTTPS/WSS and ProPR Connect tunnel support.
    • Added exact per-profile CSP sources for non-default 127/8 addresses.
    • Added a fail-closed renderer reload handoff before newly admitted endpoints can be published.
    • Added coverage for HTTP/WS loopback forms, HTTPS/WSS remotes, LAN hosts, hostname lookalikes, encoded hosts, and alternate IP spellings.

    Validation:

    • Desktop suite: 477 passed, 25 platform skips, 0 failures.
    • UI suite: 627 passed, 0 failures.
    • Desktop and UI typechecks passed.
    • Linux x64 packaging and artifact inspection passed.
    • Interactive packaged smoke was blocked because the environment lacks an X display/Xvfb.
    • No visual preview was created because the change is not user-visible.

    Detailed Logs:

    • Conversation: 48 messages
    • Session: null

    Log files stored at:

    • conversation: /tmp/claude-logs/issue-2117-2026-09-04T19-22-46-007Z-conversation.json
    • output: /tmp/claude-logs/issue-2117-2026-09-04T19-22-46-007Z-output.txt
    Latest Conversation Messages

    This processing report was generated automatically by ProPR for issue #2117.

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

    AIAI-donebugllm-codex-gpt56-sol

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions