Skip to content

fix(apps): harden the app UI bridge, call results and response headers #664

Backlog

Description

@RentnerKev

Defense-in-depth items from the app platform audit. None of them crosses a server-side permission check today.

Bridge (client)

  • session.ts:213-221 takes the batch budget and runs appUiMessage.safeParse (a 4 MiB isWireJson walk, JSON.stringify, TextEncoder) before checking connected (:230) and rendering (:278). Invalid messages are dropped silently but still count against the budget.
    • Check connection and rendering mode first; retire a frame after a few invalid messages.
  • appFrameKey (web/src/features/AppUi/appFramePool.ts:82-91) has no permission keys, and the pool is only closed on unmount or disable (AppUiProvider.tsx:104-107). For up to 20 s a prewarmed view can show data fetched under permissions the user just lost (calls are re-authorized).
    • Add permission keys to the frame key and prune the pool when the inventory changes.
  • One hover on a host's action menu prewarms every action (ProxyHostTableActions.tsx:32-34). Above three actions the oldest prewarmed frame is closed (appFramePool.ts:187-189), so the first action opens cold.
    • Prewarm only the hovered or focused menu item.

Call path (server)

  • The iframe's idempotency key is forwarded to the app unchanged and without a user scope (web/src/server/AppRuntime/ui/transport.server.ts:127, :283, core/src/app_ipc/gateway.rs:329-350).
    • Derive the forwarded key per user, installation, generation and operation (for example HMAC).
  • filterAppUiResult passes nextCursor through unchecked (ui/access.server.ts:216-219), and the UI package schema does not bound it (core/src/app_manager/ui/package.rs:408-414). A filtered result can therefore carry up to 1 MiB of unfiltered text.
    • Bound nextCursor to the app cursor format (short, URL-safe) or null.
  • The asset token lives in the URL path and expires with the session (ui/assets.server.ts:52-65).
    • Shorten its lifetime and renew it with the frame.
  • No document or /__app-ui/call response sends Cross-Origin-Resource-Policy or Cross-Origin-Opener-Policy.
    • Add them where they do not break opaque-origin subresources.

Acceptance

  • Tests for each item.

Found in the app platform audit of 2026-11-30.

Activity

  1. added
    enhancement
    security
    area: ui
    on Nov 30, 2026
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

    area: uienhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions