noracu 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SECURITY.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Security Policy
2
2
 
3
- noracu gives an MCP client control over your **real machine** — mouse,
4
- keyboard, clipboard, browser, and (via iPhone Mirroring) your phone.
5
- Treat every tool call as privileged.
3
+ noracu lets an MCP client operate your logged-in Mac session and a browser — accessibility actions, pointer and
4
+ keyboard input, the clipboard, and a Playwright browser with its own profile by default (your own Chrome only if you
5
+ opt in) — with your client's privileges. It is not a sandbox, and it does not filter what it observes: screen text,
6
+ accessibility values, page content, OCR and screenshots are untrusted input to the client and its model. Treat every
7
+ observation as data and every input call as a real action. The iPhone layers are experimental and off by default.
6
8
 
7
9
  ## What noracu hands to your model, and what it can reach
8
10
 
@@ -22,8 +24,10 @@ below has the per-tool detail.
22
24
 
23
25
  Boundaries:
24
26
 
25
- - macOS grants Accessibility and Screen Recording to the host app that starts
26
- noracu (Claude Desktop, Cursor, a terminal), not to noracu. Whether macOS
27
+ - macOS grants Accessibility and Screen Recording to what it counts as running
28
+ noracu: under Claude Desktop, which starts each server as a process of its own,
29
+ the `node` that runs it (for the extension, Claude Helper (Plugin)); under
30
+ Cursor or a terminal, that app. Whether macOS
27
31
  attributes events from helper binaries such as `cliclick` and `python3`
28
32
  separately is unverified.
29
33
  - noracu does not constrain the host's own shell or file tools. Blocking an
@@ -46,103 +50,156 @@ Boundaries:
46
50
 
47
51
  ## Defaults and switches
48
52
 
49
- noracu runs with the privileges of your MCP client. It clicks, types, pastes, and drives a real browser on this machine — there is no sandbox and no remote approval prompt. Set these on the server entry, then quit the host completely and reopen it:
53
+ Set environment variables on the server entry, then quit the MCP client completely and reopen it. For a first run:
50
54
 
51
55
  ```json
52
56
  "env": { "NORACU_READ_ONLY": "1", "NORACU_DISABLE_EVAL": "1" }
53
57
  ```
54
58
 
55
- In Claude Code the same is `claude mcp add -s user noracu -e NORACU_READ_ONLY=1 -e NORACU_DISABLE_EVAL=1 -- <node> <server.mjs>` (the two paths `npx noracu --doctor` prints). The `-e` options go after the name: before it, `-e` takes the name as one more variable.
56
-
57
- - **Tool annotations are hints, not permissions.** Every tool reports the four MCP tool annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`), set by what the tool does — see [docs/tools.md](docs/tools.md). A client may use them to decide what to confirm with you; they restrict nothing, and a client that asks for the 2024-11-05 protocol revision (which has no annotations) may ignore them. They also do not mirror `NORACU_READ_ONLY=1`: `mac_clipboard_read` is read-only by behaviour yet refused there, and `browser_navigate` is allowed there yet not read-only.
58
- - **`NORACU_READ_ONLY=1`** is the safe first-run mode. It refuses every tool not on a 21-name allowlist (the observe tools plus standalone `browser_launch`/`browser_navigate`/`browser_close`; `browser_launch` with `cdp_port` is refused even when `NORACU_ALLOW_CDP` is set); every click, type, paste, and eval tool is denied, and so are `mac_clipboard_read`, `mac_notifications`, and `mac_wait` with `condition: "notification"`, while `mac_ax_state` and `mac_find` do not toggle `web_accessibility` on apps. `browser_navigate` is on the allowlist, so it can still load a URL.
59
- - **`browser_evaluate` is off by default.** It runs any script in the page, so it returns `eval_disabled` unless the server was started with `NORACU_ENABLE_EVAL=1`; `NORACU_DISABLE_EVAL=1` keeps it off even then. It stays listed in `tools/list`. Snapshot, click, and type still work.
60
- - **`file://` is refused** unless `NORACU_ALLOW_FILE_URL=1`, so a browser agent can't read `~/Documents` by navigating to it. (The browser itself may follow a redirect during navigation, but every subsequent tool call and in-flight read/snapshot re-checks the active page's URL and refuses non-passing URLs — see SECURITY.md.)
61
- - **Focus guard:** pass `app` to `mac_paste` / `mac_key` (and `mac_type` when it sends keystrokes) and input is refused unless that app is frontmost. Omit `app` and the guard is off. `mac_type`'s default accessibility path writes into a named element or the app's focused element and sends no keystrokes at all; it falls back to keystrokes only into a text view accessibility cannot write (a terminal), never when the focus is a button, list or sheet, and into an app that reports no focused element only when `app` names it (otherwise `no_focus`, nothing sent).
62
- - **Stale-element protection:** an `element_index` is not a coordinate. It expires after 30 s, and on the Mac it is never reused by a later snapshot. A Mac element is re-identified inside the very window or open menu it was seen in (by window ID), at the same place in that window, under the same labelled ancestors and in the same table row; an element without a label or identifier must still be exactly where it was. An element read with `surface: "app"` is bound to its window's ID too, and a window without an ID (other than Finder's desktop) is refused with `policy_denied`, so a window closed and reopened with the same content never inherits old indexes. A browser click re-checks tag/name/href/position. Otherwise `element_no_longer_valid`.
63
- - **Hit test before physical clicks:** a Mac click or drag that has to use the pointer is sent only when the element at that point is the target — or, when accessibility cannot tell, when the topmost on-screen window there is that same window (by window ID, not covered by another window of the same app); otherwise `occluded`, with what is on top. Right before the click is sent, the window on top at the point is checked again; afterwards the result is `delivered_verified` only if the element is still there, changed, and its own window is still on top at the point. A click at raw x,y goes out only when the topmost on-screen window at that point belongs to `app` (default: the frontmost app; the menu bar counts as the frontmost app's); `force: true` skips that check. Keystrokes typed after such a click go out only if the element's app is then frontmost.
64
- - **Background windows:** semantic Mac actions also work on windows you are not looking at. That is the point (no stolen focus), but it means an agent can act where you do not see it — watch the results' `delivery` and keep high-stakes apps closed.
65
- - **Background clicks and keys (bgpost):** under `mechanism: "auto"`, a physical click on a native app, and a named key for a native frontmost app, are posted straight to the app's process — the pointer does not move, and you may not see it happen. Web-engine apps (Chromium/Electron) and `mechanism: "physical"` use the real pointer; the result's `route` says which. A posted click is never re-sent another way: no visible change is reported as `delivered_unverified`, a timeout as `delivery=unknown`. `NORACU_NO_BGPOST=1` turns this off.
66
- - **Stop, deny, approve:** while the file named by `NORACU_STOP_FILE` exists, every input tool returns `user_stopped` and sends nothing — Mac (`mac_*`), iPhone (`phone_*`, `ios_*`) and browser input (`browser_navigate`, `browser_click`, `browser_type`, `browser_fill`, `browser_press_key`, `browser_scroll`, `browser_evaluate`, `browser_tabs` new/close); observation tools are not stopped (`touch` it to stop, delete it to resume). `NORACU_DENY_APPS` lists apps that never get input — by default the common terminal apps (Terminal, iTerm2, WezTerm, Ghostty, Warp, Alacritty, kitty, Hyper, Tabby, Rio, Wave) and the IDEs with a built-in terminal (VS Code, Cursor, Windsurf, Zed, JetBrains IDEs, Android Studio — their preview and nightly editions too; the name `Code` and `com.jetbrains.*` also catch any app named exactly Code and JetBrains Toolbox) and Orca, so an agent cannot type into those shells (other apps that host a shell are not on it); a list of your own adds to it, and a list starting with `none` drops it. `NORACU_APPROVAL_FILE` (opt-in) names a `0600` JSON file `{ "allow": [...], "ask": [...], "deny": [...] }` of bundle-id or app-name patterns: an app under `ask` or not listed gets `approval_required`, and noracu never writes the file; once the variable is set, a missing or broken file refuses all Mac and iPhone input (the browser layer is not judged by app rules; the stop file stops it). An app whose bundle id cannot be read gets nothing while either rule is in force. Each check judges the app that receives the input — the element's app, the named app, or the app on top at an x,y point — and an app that cannot be identified gets nothing. These files stop the model, not other software running as you: see SECURITY.md.
67
- - **Guarded keys, menus and quits:** `mac_key` refuses quit / log-out / lock / force-quit / delete-immediately / empty-Trash chords unless `force: true`; `mac_menu_command` applies the same chord list to menu shortcuts and refuses Apple-menu items unless `force: true`. Neither `mac_app` nor `mac_menu_command` ever quits Finder, the Dock, loginwindow, other session processes or the MCP host itself; `force: true` is needed on `mac_app` to force-quit.
68
- - **Your own Chrome is opt-in:** `browser_launch` with `chrome: true` needs `NORACU_ALLOW_CHROME=1` and Chrome's own remote-debugging switch (`chrome://inspect/#remote-debugging`); Chrome asks you to allow each connection and shows a banner while it is open. noracu then opens a window of its own in your Chrome and lists, reads and acts only on the tabs it opened there (and tabs those open); noracu never lists, reads or acts on your other tabs unless you also set `NORACU_CHROME_TABS=all` (then your tabs on http(s) pages — never `file://` or browser pages, whatever `NORACU_ALLOW_FILE_URL` says — are listed and can be selected, read and acted on, but never closed or sent to a non-http(s) address; one becomes the active page only when selected and stops being it when it leaves http(s)); in noracu's own tabs the address rules (http(s) only; `file://` needs `NORACU_ALLOW_FILE_URL=1`) apply. Those tabs carry your sign-ins, so an agent working there acts as you on those sites; `browser_evaluate` never runs there. `browser_close` closes noracu's tabs and disconnects; noracu never quits Chrome. Refused under `NORACU_READ_ONLY=1`.
69
- - **DevTools ports are opt-in:** `mac_app` / `browser_launch` with `cdp_port` need `NORACU_ALLOW_CDP=1` (`NORACU_ALLOW_CDP=any` to attach to a port `noracu` did not open itself; always refused under `NORACU_READ_ONLY=1`), bind to 127.0.0.1 only, canonicalize `.app` paths and refuse an app that is already running or that the app rules (deny list, approval file) rule out, and give Chrome-family browsers a separate `0700` profile under `~/.noracu/cdp-profiles`. While the port is open, any local process can control that app (127.0.0.1 has no per-user isolation).
70
- - **Clipboard, password fields and notifications are private:** `mac_paste` puts the user's clipboard back (every item and type) and never copies an item a password manager marked concealed — it clears the clipboard after the paste instead; `mac_clipboard_read` never returns a concealed item; `mac_set_value` on a secure password field (`AXSecureTextField`) never echoes the value; `mac_notifications` returns notification text verbatim. `mac_clipboard_read`, `mac_notifications`, and `mac_wait` on notifications are outside read-only mode.
71
- - **iPhone screen is model input:** `phone_screenshot` / `phone_ocr` / `phone_find` return whatever the phone shows — notifications, messages, one-time codes. Use a Focus and a neutral app, and start with `NORACU_READ_ONLY=1` (phone observation allowed, phone input refused). Phone input is also refused when the mirror is not live (`mirror_not_live`) or its state cannot be read (`mirror_state_unknown`).
72
- - **Injection-safe JXA and stdin text:** the accessibility engine (`src/mac-ax.js`) is a static script that takes its whole request as JSON on stdin — parameters are data, never script source — and `mac_type` (default path), `mac_set_value`, `mac_paste`, and `phone_type` / `phone_find` / `phone_open` pass text on stdin so it does not appear in a process list (`imctl type` never echoes it either). Regression-tested.
73
-
74
- **What it refuses by default** — a refused input sends nothing, and its error says so (`delivery=not_delivered, retry=safe`):
75
-
76
- | Refused by default | Answer | To change it |
59
+ In Claude Code, put the `-e` options right after the server name, with the two paths `npx noracu doctor` prints:
60
+
61
+ ```bash
62
+ claude mcp add -s user noracu -e NORACU_READ_ONLY=1 -e NORACU_DISABLE_EVAL=1 -- <node> <server.mjs>
63
+ ```
64
+
65
+ Tool annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) are hints for the client and
66
+ restrict nothing; they do not mirror read-only mode either. The controls below are enforced by the server.
67
+
68
+ ### Read-only mode (`NORACU_READ_ONLY=1`)
69
+
70
+ Recommended for a first run. It refuses every tool outside a 21-name allowlist:
71
+
72
+ - **Mac (8):** `mac_status`, `mac_apps`, `mac_windows`, `mac_ax_state`, `mac_find`, `mac_get`, `mac_screenshot`, and
73
+ `mac_wait` (except `condition: "notification"`). `mac_ax_state` and `mac_find` do not switch on web accessibility.
74
+ - **Browser (6):** standalone `browser_launch`, `browser_navigate`, `browser_close`, `browser_snapshot`, `browser_read`,
75
+ `browser_screenshot`. `browser_launch` with `chrome: true` or `cdp_port` is refused.
76
+ - **iPhone, experimental and off by default (7):** Mirroring `phone_status`, `phone_screenshot`, `phone_ocr`,
77
+ `phone_find`; XCUITest `ios_status`, `ios_snapshot`, `ios_screenshot` — read-only never starts the XCUITest runner, so
78
+ of those only `ios_status` answers (`runner_not_started`).
79
+
80
+ Refused besides every input tool: `mac_clipboard_read`, `mac_notifications`, `mac_wait` on notifications, and
81
+ `browser_tabs`. What it still does: `browser_navigate` loads pages (HTTP GET side effects and the page's own requests
82
+ happen, [threat 9](#threat-9)); the first `browser_launch` may download Chromium unless `NORACU_DISABLE_AUTO_INSTALL=1`
83
+ ([threat 7](#threat-7)); screenshots and accessibility reads still show whatever is on screen ([threat 5](#threat-5)).
84
+ Only the exact value `1` turns it on; any other value is ignored, with a warning line at start-up.
85
+
86
+ ### Stop file (`NORACU_STOP_FILE`)
87
+
88
+ Unset by default. Set it to a path you can create in one step (`touch ~/.noracu/stop`, a shell alias, a Shortcut).
89
+ While that file exists, every input tool returns `user_stopped` and sends nothing: Mac (`mac_*`, `mac_app` and
90
+ `mac_window` included), the experimental iPhone tools (`phone_*`, `ios_*`) and the browser tools that act on a page
91
+ (`browser_navigate`, `browser_click`, `browser_type`, `browser_fill`, `browser_press_key`, `browser_scroll`,
92
+ `browser_evaluate`, `browser_tabs` new and close). Observation tools and `browser_launch` still work. Delete the file to
93
+ resume. Set but blank, the variable refuses all input (`stop_check_error`). noracu never removes the file — but a host
94
+ whose shell or file tools run as you can ([threat 20](#threat-20)).
95
+
96
+ ### Default app deny list (`NORACU_DENY_APPS`)
97
+
98
+ On by default. Input to the common terminal apps (Terminal, iTerm2, WezTerm, Ghostty, Warp, Alacritty, kitty, Hyper,
99
+ Tabby, Rio, Wave), to IDEs with a built-in terminal (VS Code, Cursor, Windsurf, Zed, JetBrains IDEs, Android Studio —
100
+ preview and nightly editions too; the name `Code` and `com.jetbrains.*` also catch an app named exactly Code and
101
+ JetBrains Toolbox) and to Orca is refused with `input_denied`, so an agent cannot type into those shells. Other apps that
102
+ host a shell are not on it.
103
+
104
+ - Your own comma-separated bundle ids or app names (`*` and `?` wildcards) add to the default; blank keeps it; a list
105
+ starting with `none` drops it. An entry you write always wins.
106
+ - It judges the app that receives the input — the element's app, the named `app`, the app on top at an x,y point, or the
107
+ iOS `bundle_id` — and `mac_app` launch with `cdp_port`. An app that cannot be identified gets nothing. With app rules
108
+ set, XCUITest input that names the Home Screen (`com.apple.springboard`) is refused too ([threat 27](#threat-27)).
109
+ - It does not judge other `mac_app` actions (launch without `cdp_port`, activate, quit), `mac_window`, the browser layer,
110
+ apps that host a shell but are not listed, or the host's own shell and file tools.
111
+
112
+ ### App approval file (`NORACU_APPROVAL_FILE`)
113
+
114
+ Opt-in: the path of a JSON file `{ "allow": [...], "ask": [...], "deny": [...] }` of bundle-id or app-name patterns.
115
+ `deny` answers `input_denied`; `ask` and every app not listed answer `approval_required` — the person decides by editing
116
+ the file, which noracu reads on every call and never writes. An `allow` entry that names an app exactly lets that one app
117
+ through the default deny list; entries in `NORACU_DENY_APPS` still win. Once the variable is set, a file that is missing,
118
+ blank, a symlink, not mode `0600`, not owned by your macOS user, or not valid refuses all Mac and iPhone input
119
+ (`approval_file_error`, `approval_file_insecure`, `approval_file_owner`). Same scope as the deny list
120
+ ([threat 20](#threat-20), [threat 27](#threat-27)). For unattended runs, list only the apps the task needs under `allow`.
121
+
122
+ ### Page JavaScript (`NORACU_ENABLE_EVAL`, `NORACU_DISABLE_EVAL`)
123
+
124
+ `browser_evaluate` runs any script in the page, so it stays listed but answers `eval_disabled` unless the server was
125
+ started with `NORACU_ENABLE_EVAL=1` ([threat 3](#threat-3)). `NORACU_DISABLE_EVAL=1` keeps it off even then, and it never
126
+ runs in your own Chrome (`chrome: true`), whatever is set ([threat 28](#threat-28)). Snapshot, read, click and type work
127
+ without it; pages still run their own scripts.
128
+
129
+ ### Other defaults and opt-in switches
130
+
131
+ | Control | Default | Effect |
77
132
  |---|---|---|
78
- | Input into terminals and IDEs with a built-in terminal | `input_denied` | `NORACU_DENY_APPS` (a list starting with `none` drops the default), or one app at a time: an approval file's `allow` entry that names it exactly |
79
- | `browser_evaluate` (any script in the page) | `eval_disabled` | `NORACU_ENABLE_EVAL=1` |
80
- | `file://` pages in the browser | refused at the URL | `NORACU_ALLOW_FILE_URL=1` |
81
- | DevTools ports (`cdp_port`) | refused | `NORACU_ALLOW_CDP=1` |
82
- | Working in your own Chrome (`browser_launch` with `chrome: true`) | `policy_denied` | `NORACU_ALLOW_CHROME=1`, and Chrome's switch at `chrome://inspect/#remote-debugging` |
83
- | The iPhone tools | not listed; a call answers `unknown tool … the iphone layer is off` | `NORACU_LAYERS=mac,browser,iphone` |
84
- | Mac input and iPhone Mirroring input while you use the keyboard or mouse | `user_active` | `NORACU_USER_IDLE_S=0` |
85
- | Quit, log-out, lock, force-quit, delete-immediately and empty-Trash chords; Apple-menu items | refused | `force: true` |
86
- | Every input while the stop file exists — once you name one with `NORACU_STOP_FILE` | `user_stopped` | delete the file |
87
-
88
- These switches do not make observed content trustworthy. Screenshot text, accessibility names, and page content are untrusted input to your model — do not let them override the task. Full threat model and per-threat status: [SECURITY.md](SECURITY.md).
133
+ | The person at the Mac (`NORACU_USER_IDLE_S`) | `2` s | Mac input and experimental Mirroring input wait once for that long without keyboard or mouse use, else answer `user_active` and send nothing; `0` turns the wait (and putting the pointer back) off. Browser and XCUITest input do not wait. |
134
+ | Background Mac input (`NORACU_NO_BGPOST`) | on | Under `mechanism: "auto"` a physical click on a native app, and a named key for a native frontmost app, are posted to the app without moving the pointer; `=1` uses the real pointer and keys instead ([threat 19](#threat-19)). |
135
+ | Guarded chords, menus and quits | refused | Quit, log-out, lock, force-quit, delete-immediately and empty-Trash chords, and Apple-menu items, need `force: true`; Finder, the Dock, loginwindow, other session processes and the MCP host are never quit ([threat 2](#threat-2), [threat 14](#threat-14)). |
136
+ | `file://` pages (`NORACU_ALLOW_FILE_URL`) | refused | `=1` lets the standalone browser open `file://`; the active page is re-checked on every read ([threat 8](#threat-8)). |
137
+ | Your own Chrome (`NORACU_ALLOW_CHROME`) | refused (`policy_denied`) | `=1` plus Chrome's switch at `chrome://inspect/#remote-debugging` allows `browser_launch` with `chrome: true`, in a window of noracu's own; `NORACU_CHROME_TABS=all` also lists your other http(s) tabs ([threat 28](#threat-28)). |
138
+ | DevTools ports (`NORACU_ALLOW_CDP`) | refused | `=1` allows `cdp_port` for an app this server started, on 127.0.0.1 only; `=any` for other loopback ports. While a port is open any local program can control that app: quit it when done ([threat 15](#threat-15)). |
139
+ | Chromium download (`NORACU_DISABLE_AUTO_INSTALL`) | on | `=1` stops the first `browser_launch` from downloading Playwright's Chromium ([threat 7](#threat-7)). |
140
+ | The iPhone layers (`NORACU_LAYERS`, `NORACU_PHONE_BACKEND`) | off | `NORACU_LAYERS=mac,browser,iphone` lists the experimental `phone_*` tools, or the `ios_*` tools with `NORACU_PHONE_BACKEND=xcuitest` ([threat 6](#threat-6), [threat 22](#threat-22)). |
141
+ | Call trace (`NORACU_TRACE`) | off | Writes `{ts, tool, args, ms, error, code}` per call — argument names and sizes and the error code only, never argument text, result text or error messages — to a `0600` file opened with `O_NOFOLLOW`. |
142
+
143
+ ### Session hygiene
144
+
145
+ - Keep the MCP client's confirmation prompts on for input tools, above all near password managers, mail, banking and
146
+ admin consoles, and read the client's log of tool calls.
147
+ - Run untrusted automation in a dedicated macOS user account, with Accessibility and Screen Recording granted only to
148
+ that account's client. The browser profile at `~/.noracu/browser-profile` keeps cookies between runs: clear it between
149
+ untrusted ones.
150
+ - Before turning on an iPhone backend: a Focus, a neutral app, `NORACU_READ_ONLY=1` for the first run, "Ask every time"
151
+ in iPhone Mirroring's settings unless you need unattended sessions, and a spare phone if XCUITest will keep it
152
+ unlocked ([docs/iphone.md](docs/iphone.md)).
153
+ - These switches stop the model, not other software running as you, and they do not make observed content trustworthy.
89
154
 
90
155
  ## Threat model
91
156
 
157
+ **By layer** — model and host: [1](#threat-1), [4](#threat-4), [7](#threat-7), [11](#threat-11), [20](#threat-20) · Mac: [2](#threat-2), [5](#threat-5), [10](#threat-10), [13](#threat-13), [14](#threat-14), [16](#threat-16), [17](#threat-17), [19](#threat-19) · browser and DevTools: [3](#threat-3), [8](#threat-8), [9](#threat-9), [15](#threat-15), [28](#threat-28) · iPhone (experimental, off by default): [6](#threat-6), [12](#threat-12), [18](#threat-18), [21](#threat-21)–[27](#threat-27).
158
+
92
159
  | # | Threat | Vector | Status | Mitigation / notes |
93
160
  |---|---|---|---|---|
94
- | 1 | **Prompt injection → arbitrary code execution** | Observed content (web page text, AX tree titles, OCR output) contains instructions that trick the agent into calling tools with malicious arguments | **Mitigated** | The Mac accessibility engine `src/mac-ax.js` is a static script that takes its whole request as JSON on stdin — parameters are data, never script source (regression-tested in `test/e2e.mjs`); the remaining inline JXA (scroll wheel) takes clamped numbers through argv |
95
- | 2 | **Arbitrary local control** | `mac_click` / `mac_type` / `mac_paste` can operate password managers, banking pages, terminals | **Inherent** | Use client-side confirmation gates for high-stakes targets; see recommendations below. Optional `app` focus guard on `mac_paste` / `mac_key` (and `mac_type` keystrokes) refuses input unless that app — compared by process, not by name — is frontmost; `mac_type` keystrokes after a click on an `element_index` go out only if the element's app is then frontmost. An `element_index` is re-identified inside the window it came from (by CGWindowID) before any action, and a physical click or drag (both ends) is sent only when a hit test shows the point reaches the element, or — when the hit test is inconclusive — when the topmost on-screen window at the point is that same window (by CGWindowID, not covered by another window of the same app; `occluded` otherwise). Right before a physical click or drag is sent, the window on top at each point is checked again (by CGWindowID); afterwards a physical click counts as `delivered_verified` only if the element is still there, changed, and its own window is still on top at the click point. An element read with `surface: "app"` is bound to its window's CGWindowID, and an element in a window without a CGWindowID (other than Finder's desktop) is refused with `policy_denied`. A `mac_click` at raw x,y is sent only when the topmost on-screen window at the point belongs to `app` (default: the frontmost app; the menu bar counts as the frontmost app's, and the strip a display keeps for the Dock counts as the Dock's; Notification Center's full-display overlay counts only over a banner or alert it draws, or everywhere when their frames cannot be read), unless `force: true`; a short gap remains between that check and the click. `mac_key` refuses quit / log-out / lock / force-quit / delete-immediately / empty-Trash chords without `force`; `mac_menu_command` applies the same chord list, refuses Apple-menu items without `force`, and never quits the MCP host or a session process. |
96
- | 3 | **Arbitrary JS in browser** | `browser_evaluate` executes any JavaScript in the page context | **Partially mitigated** | Off by default: `browser_evaluate` returns `eval_disabled` unless the server was started with `NORACU_ENABLE_EVAL=1`, and `NORACU_DISABLE_EVAL=1` keeps it off even then (it stays listed in `tools/list`). Once it is turned on, any script runs in the page |
97
- | 4 | **Input validation gaps** | Malformed arguments (NaN coordinates, oversized strings, `javascript:` URLs) | **Mitigated** | `validateArgs` validates every tool's arguments (types, ranges, enums, string lengths, URL schemes) before any subprocess runs; `tools/list` emits `required` arrays derived from non-optional arguments |
98
- | 5 | **Screenshot privacy** | `mac_screenshot` / `phone_screenshot` capture the full screen / phone display | **Inherent** | Run in a dedicated macOS user account or virtual display for untrusted automation. `NORACU_READ_ONLY=1` prevents side effects (and skips `enableWebAccessibility` on apps), not screen secrecy: `mac_screenshot` still shows visible notification banners on screen, and Notification Center accessibility reads via `mac_ax_state` / `mac_find` are not blocked by bundle id |
99
- | 6 | **iPhone operations** | `phone_tap` / `phone_type` can interact with payment and SMS-verification UIs; taps go to OCR coordinates with no element re-check | **Inherent** | Keep Mirroring off for untrusted sessions; `NORACU_READ_ONLY=1` refuses all phone input; all phone input (including `phone_home` / `phone_app_switcher`, via `require_enabled` on the menu item or `imctl`'s `_require_live`) fails closed with `mirror_not_live` when not live — without stealing focus when paused or closed — or `mirror_state_unknown` when the state cannot be read, checks that iPhone Mirroring is frontmost before synthesized events, and never falls back to a second gesture after an uncertain menu timeout (`menu_unknown`); optional `expect` OCR anchor gates coordinate/key/type actions; "Authenticate automatically" lets anyone at the unlocked Mac start mirroring |
100
- | 12 | **Phone screen as model input** | `phone_screenshot` / `phone_ocr` / `phone_find` — and, under the XCUITest backend, `ios_screenshot` / `ios_snapshot` — return notifications, messages, mail and one-time codes visible on the phone | **Inherent** | Use a Focus mode and a neutral app; the MCP client sends tool results to its model; iPhone notifications also reach the Mac once Mirroring is set up |
101
- | 7 | **Supply chain** | malicious PRs / dependency poisoning after open-sourcing | **Partially mitigated** | Review all PRs touching `src/server.mjs` argument handling; lockfile committed; no `postinstall` scripts; the only runtime download is the one-time Playwright `chromium` install triggered by `browser_launch`, which can be disabled with `NORACU_DISABLE_AUTO_INSTALL=1` |
102
- | 8 | **Local file read via browser** | `browser_navigate` to a `file://` URL, then `browser_read` exfiltrates local files; or a tab that someone opened on a local file becomes the active page | **Partially mitigated** | `file://` blocked at the `browser_navigate` argument and at the `url` of `browser_tabs` `new` unless `NORACU_ALLOW_FILE_URL=1` (initial URL only; redirects fall under threat 9). A tab becomes the active page — through `browser_tabs` `select`, or by taking over when the active tab closes — only when it shows an http(s) page, or is still on the blank page that `browser_launch` or `browser_tabs` opened it on (a blank page a tab shows after it has loaded anything else does not count: one reached from a local file still loads other local files into frames, where a screenshot shows them). The session's first tab is Chromium's own, so it is not taken on trust: when it starts on a blank page noracu sends it to `about:blank` itself, checks that a new document is there, and empties `window.name` before it counts (measured: after that navigation a blank page that a local file went to no longer loads local files and the old document is gone; the name survives it), and any navigation the tab reports afterwards ends that — also one back to an earlier blank page in its history (measured: `history.back()` to a blank page that a local file had reached loads local files again). A first tab that starts on anything else is held to the rule like any other tab. A tab restored at launch was looked for and not seen: a headed Chromium started the way noracu starts it, on a profile set to continue where it left off whose last session had a blank tab that a local file had gone to, came back with one fresh blank tab (two runs); the checks above do not rely on that. The tab that already is the active page is held to the same rule each time a page tool is called: once it shows anything else — a blob the page made, Chromium's page for a load that failed, a blank page after another page, a local file someone opened in that tab — the page tools return `active_page_not_allowed`, and only `browser_navigate` (which reads nothing of the page it leaves) and `browser_tabs` act. A tab on a local file, a browser page or a blob, and a blank tab that a page opened (it shares that page's origin and can read it), are listed with their url and title and nothing else of them is read: `tab_not_selectable`, and `no_active_page` from the page tools when no other tab is open. What a tab shows is looked at when a call starts, by the address the browser reports for it then; while a navigation is being committed that is still the old address for a moment (measured after a load that failed: calls sent with no pause got past this check every time). So the tools that return page content — `browser_read`, `browser_snapshot`, `browser_screenshot`, `browser_evaluate` — look again once they have their result, or an error, and drop it when the page no longer passes — or when the tab went through a page that does not pass while they worked and is back on one that does (measured: 60 calls in that moment, none handed over the arriving page; this rests on the browser reporting a navigation before it answers from the new page). The input tools are checked at the start only: in that moment input can reach the page that is arriving. A page cannot take itself to a local file or a browser page (Chromium refuses that), and the browser tools' own keystrokes go to the page, never to the address bar (measured in a headed Chromium), so the arriving page is a local file only when one is opened in the active tab from outside the browser tools — by hand, or by Mac-layer input. Remaining: input that reaches an arriving page in that moment (a click or fill by selector also tells whether the selector exists there). Outside this row: a session attached to an app with `cdp_port` (threat 15), which uses that app's own pages whatever they show; and the Mac layer when it is on — its input can type an address into a headed browser's address bar, and `mac_screenshot` shows the browser's window like any other (threats 2 and 5) |
103
- | 9 | **HTTP GET side effects** | navigation triggers logout links, one-time tokens, private-network / cloud-metadata endpoints | **Not mitigated** | No URL blocklist (redirects and DNS rebinding defeat pre-navigation checks); client-side policy |
104
- | 10 | **Clipboard clobbering by mac_paste** | `mac_paste` overwrites the clipboard with the pasted text | **Partially mitigated** | One engine call copies every clipboard item and type aside (inside that process), writes the text marked `org.nspasteboard.TransientType`, sends ⌘V only if the clipboard and the frontmost app are unchanged, and puts the user's items back after the paste shows in the same focused element (held at least 0.3 s; else after a 1 s hold) and only if nothing else wrote to the clipboard meanwhile; when the keystroke may not have completed it is not put back. An item marked concealed (on any clipboard item) is never copied: the clipboard is cleared after the paste. Universal Clipboard content and clipboards over 64 MB are refused unless `force`. Remaining: for up to about a second the clipboard holds the pasted text (a clipboard manager that ignores the transient marker can record it); an app that reads the clipboard after the hold receives the restored content; when the app stops answering the pasted text is left on the clipboard |
105
- | 13 | **Actions on windows the user cannot see** | Semantic Mac actions (press, set value, insert text) work on background windows without moving the pointer or taking focus | **Inherent** | Results report `delivery` and `retry`; review the client's tool log; close high-stakes apps during unattended runs |
106
- | 14 | **Quitting apps** | `mac_app` quit can close apps; force-quit loses unsaved work | **Mitigated** | Graceful quit by default and verified by the process ending; `force: true` required to force-quit; session processes (Finder, Dock, loginwindow, SystemUIServer, Control Center, Notification Center, …) and the MCP host process are never quit |
107
- | 15 | **DevTools port exposure** | `mac_app` launch with `cdp_port` opens a Chromium/Electron app's remote-debugging port on `127.0.0.1` (no per-user isolation); any local process can then control that app | **Partially mitigated** | Off unless `NORACU_ALLOW_CDP=1` (or `=any`); `browser_launch` with `cdp_port` is refused under `NORACU_READ_ONLY=1` even with `NORACU_ALLOW_CDP` set; bound to `127.0.0.1`; only for a fresh launch after canonicalizing `.app` paths (`realpath`, trailing slash stripped — a running app is refused, never quit for you); the app rules (`NORACU_DENY_APPS`, the approval file) decide before the launch, by the bundle id read from the app on disk, so an app they rule out is not given a port; with `NORACU_ALLOW_CDP=1`, `browser_launch` attaches only when the port was recorded by this `noracu` process (at launch, only when the process listening on it is the launched app or one of its child processes and `/json/version` names a websocket on that port), its PID is still alive, and `/json/version`'s `webSocketDebuggerUrl` matches (attaching to any other loopback port requires `NORACU_ALLOW_CDP=any`); `~/.noracu` and `cdp-profiles` are created `0700`; Chrome-family browsers get a separate profile under `~/.noracu/cdp-profiles`; standalone `browser_launch` is refused while a CDP session is open; the port closes when the app quits |
108
- | 16 | **Clipboard and notification content** | `mac_clipboard_read` / `mac_notifications` return clipboard text, images, file paths and notification text to the model | **Partially mitigated** | Items marked `org.nspasteboard.ConcealedType` (password managers) are never returned; `mac_clipboard_read`, `mac_notifications`, and `mac_wait` with `condition: "notification"` are refused under `NORACU_READ_ONLY=1` (`NORACU_READ_ONLY=1` prevents side effects, not screen secrecy: `mac_screenshot` still shows visible notification banners and Notification Center AX reads are not blocked by bundle id); notification actions reject empty `id` / `expected_app` / `expected_title`, return `notification_not_found` when absent, and require an id or an index plus a re-checked app/title fingerprint; `mac_set_value` on `AXSecureTextField` never echoes the value. Remaining: `mac_clipboard_read` on Universal Clipboard content (copied on another device) makes macOS fetch it from that device; the result marks it `remote: true` |
109
- | 17 | **Text in process arguments** | Text sent as keystrokes (`mac_type` physical path: `cliclick t:…`) is visible in the process list while it runs | **Partially mitigated** | The accessibility path (`mac_type` default, `mac_set_value`), `mac_paste`, and `phone_type` / `phone_find` / `phone_open` (imctl reads the text from stdin) pass text on stdin, and `mac_set_value` on `AXSecureTextField` and `imctl type` never echo typed text; only the keystroke fallback uses argv. A phone call's `expect` text is still an argument |
110
- | 18 | **Clipboard on the phone path** | `phone_type` / `phone_open` paste through the Mac clipboard; iPhone Mirroring fetches the paste asynchronously, sometimes more than 10 s after ⌘V, from whatever the clipboard holds then, so putting the user's clipboard back too early could paste it into the phone | **Partially mitigated** | `phone_type` and `phone_open` wait at least 1.5 s after writing the clipboard before ⌘V, and call ⌘V off (`focus_lost`) rather than bring iPhone Mirroring back if another app came to the front meanwhile. `phone_type` copies every clipboard item aside and puts them back only on screen evidence read within its 2.5 s check while no "Pasting from" progress box shows: OCR sees the text at a new spot below the status-bar strip in two reads, counted against a read taken right before ⌘V. A text of one to three characters (spaces and case aside) never licenses it, and neither does a paste seen only later. An item marked concealed or transient is never copied (the clipboard is cleared instead). Without that evidence the typed text stays on the clipboard and the result says so. An error before ⌘V is sent restores the clipboard; an error once ⌘V may be on its way never does. `phone_open` never restores it once ⌘V may have been sent (before ⌘V — an error, or `focus_lost` — it goes back under the same rule). Remaining: the user's previous clipboard is lost whenever the evidence is missing; Universal Clipboard content and clipboards over 64 MB are not copied, so they are replaced by the typed text; a ⌘V that reaches the phone before Universal Clipboard has announced the new text can paste the phone's own older clipboard instead — possibly something once pasted on the phone, such as a password — and the wait — 1.5 s, a judgement rather than a measured delay — is meant to let the new text reach the phone first but does not close that window; the OCR evidence matches the typed text inside a line, so an older clipboard that contains the typed text can pass for the paste; the "Pasting from" box is recognized only in English |
111
- | 19 | **Input the person at the Mac cannot see** | Background input (bgpost, 0.3.0) posts physical clicks and named keys straight to an app's process: the pointer does not move and the app need not be in front | **Partially mitigated** | Input still waits for the person at the Mac (`user_active`); `NORACU_STOP_FILE` stops all Mac and iPhone input at once, and the browser tools that act on a page (`browser_click`, `browser_type`, `browser_fill`, `browser_press_key`, `browser_scroll`, `browser_navigate`, `browser_evaluate`, and `browser_tabs` new / close — not `browser_launch` or the reading tools); the deny list (by default the common terminal apps and IDEs with a built-in terminal) and the opt-in approval file are judged on the app that receives the input, and an app that cannot be identified gets nothing; web-engine apps and `mechanism: "physical"` use the real pointer; `NORACU_NO_BGPOST=1` turns background input off. Results carry `route`. Watching the client's tool log is still the only way to see every action |
112
- | 20 | **Approval, deny and stop settings changed by the agent** | An agent with a shell or file tool (the MCP host's, not noracu's) edits `NORACU_APPROVAL_FILE` or deletes the stop file | **Partially mitigated** | noracu never writes these files and reads them at every call; once `NORACU_APPROVAL_FILE` is set, the file must exist, be a plain file (not a symlink), mode `0600`, owned by the user running noracu and hold only `allow` / `ask` / `deny` with non-empty patterns, else all Mac and iPhone input is refused (app rules do not judge the browser layer; the stop file stops it). Anything running as you can still edit them — they stop the model through noracu's tools, not other software or a host shell tool you allowed (see "What noracu hands to your model" above) |
113
- | 21 | **Looking at the phone is visible to its apps** | A capture of the iPhone Mirroring window reaches the app on the phone as a screenshot: in a device run (iPhone 17 Pro Max on iOS 27, Mac on macOS 27.2) LinkedIn and rednote each showed their after-screenshot share sheet 1–4 s after every capture, one more per capture. Captures are made by `phone_screenshot` / `phone_ocr` / `phone_find`, any `expect` check, the checks inside `phone_type` / `phone_open` / `phone_scroll`, and a phone input that first has to bring iPhone Mirroring to the front | **Inherent** | noracu cannot read the mirror without capturing it. It captures no more than a tool needs: where the phone screen sits inside the window is measured once per window size and macOS version and remembered in `~/Library/Caches/noracu/phone-screen-rect.json` (window size, macOS version, four edges, two timestamps — nothing from the phone), so once the edges are remembered `phone_tap`, `phone_longpress` and `phone_swipe` without `expect` add no capture of their own — except when iPhone Mirroring first has to be brought to the front, which is one of the captures listed above. Not tested: apps that log screenshots or tell the other person in a chat about them — assume they do so on every capture, and keep such apps off the screen while an agent observes |
114
- | 22 | **A listener on the iPhone (XCUITest backend)** | The runner on the phone takes commands over TCP; whoever can reach it and knows its token can read and drive the phone | **Partially mitigated** | Off unless `NORACU_PHONE_BACKEND=xcuitest`. The runner binds only the device's own CoreDevice tunnel address — a unique-local (`fc00::/7`) address, or `::1` when CoreDevice reports the tunnel as loopback (a simulator's runner binds `127.0.0.1`); any other address is refused before the runner starts — measured on an iPhone 16 Pro: the same port on the phone's Wi-Fi address refuses connections — accepts only peers in the tunnel's /64, and requires a 128-bit token made new at every start, compared in constant time; a wrong token or a request line over 64 KiB closes the connection. The token travels in the environment of `xcodebuild`, never in arguments, results or the trace file — but another process of the same macOS user can read that environment and reach the tunnel while the runner is up, so do not run software you do not trust in the account that runs noracu. The server stops `xcodebuild` (and with it the runner) when it exits |
115
- | 23 | **iPhone input through XCUITest** | `ios_tap` / `ios_type` / `ios_swipe` / `ios_key` act in any app of an unlocked iPhone, payment and messaging apps included; a raw x,y tap or a swipe has no element re-check | **Inherent** | Opt-in backend; `NORACU_READ_ONLY=1` refuses all `ios_*` input; `NORACU_STOP_FILE`, `NORACU_DENY_APPS` and `NORACU_APPROVAL_FILE` are checked before every input, on the iOS bundle id — an approval file that allows only the apps you mean is the tightest setting; a locked iPhone, or one whose lock state cannot be read, gets nothing — the lock is read when a call starts and again before any command sent more than 1 s after the last unlocked answer, so a phone locked within that second is not caught (a lock during a running call has not been tried on a device); no input goes to an app while a system alert is up on the phone (`system_alert`); an `element_index` is re-read before it is used. Use a spare iPhone for unattended runs |
116
- | 24 | **A stale picture of what is in front** | For about a second after an app leaves the front (measured after a Home press), iOS still reports it as in front; an index or a point used in that moment could land on another screen | **Partially mitigated** | `ios_home` and `ios_launch` end every earlier index and wait for the change to show; before an index is used the app is read again and the element must match in type, label, identifier and frame; the runner refuses input for an app that is not in front. What remains is that second after someone presses Home on the phone itself |
117
- | 25 | **An unlocked iPhone** | The XCUITest backend works only while the iPhone is unlocked, and unattended use means turning auto-lock off | **Inherent** | Physical access to the phone is then access to everything on it. Use a spare device without your main accounts, and keep it where you can see it |
118
- | 26 | **Signing the runner** | `noracu ios-setup` builds and signs the runner with your Apple developer team: Xcode contacts Apple's developer service and may create a development provisioning profile and an app identifier in the team; `--register-device` adds the iPhone to the team's devices | **Inherent** | Only when you run that command — never on install, never while the MCP server runs. A simulator build is not signed and contacts nothing |
119
- | 27 | **The Home Screen as a way around app rules (XCUITest backend)** | Input that names `com.apple.springboard` is sent by screen coordinates and lands on whatever is in front — SpringBoard reads as "in front" under every app (measured on an iOS 26.5 simulator) — so a rule that allows it would let a tap reach an app the rules do not allow | **Mitigated** | While `NORACU_APPROVAL_FILE` or a `NORACU_DENY_APPS` of your own is set, no input that names `com.apple.springboard` is sent — not even one tap on a button of a system prompt: taps, long presses, drags, text and keys return `input_denied` before a runner is started, and nothing reaches the phone. Apps are opened with `ios_launch`, which asks the rules; `ios_home` still goes out. The cost: under app rules the agent cannot answer a system prompt (a permission dialog) — the person at the phone does. With no rules set, such input is sent as asked and reaches the app in front |
120
- | 28 | **Working in the person's own Chrome** | `browser_launch` with `chrome: true` attaches to the Chrome the person uses, through Chrome's remote-debugging switch; the tabs noracu opens there carry the person's sign-ins, so an agent working in them acts as the person on those sites, and while the switch is on any local program can ask Chrome for a connection | **Partially mitigated** | Off unless `NORACU_ALLOW_CHROME=1`; refused under `NORACU_READ_ONLY=1`; it needs Chrome's own switch (`chrome://inspect/#remote-debugging`, off by default), and Chrome asks the person to allow each connection and shows a banner while one is open (since Chrome 136 `--remote-debugging-port` is ignored for the default profile). noracu opens a window of its own in the background and lists, reads and acts only on the tabs it opened there and tabs those tabs open; noracu never lists, reads or acts on the person's other tabs unless the person also sets `NORACU_CHROME_TABS=all` (then the person's http(s) tabs are listed and can be selected, read and acted on, never closed or sent to a non-http(s) address, and become the active page only when selected and stop being it when they leave http(s); `file://`, `chrome://` and the like are not listed, whatever `NORACU_ALLOW_FILE_URL` says), and in noracu's own tabs the address rules apply (http(s) only; `file://` only with `NORACU_ALLOW_FILE_URL=1`; `chrome://` and the like never). `browser_evaluate` never runs in a `chrome: true` session. `browser_close` closes noracu's tabs and disconnects (it keeps the session while one of them is still open or the disconnect is unconfirmed); noracu never quits Chrome. Remaining: whatever an agent does in those tabs is done as the person (posting, buying, changing settings on a site), and a page loaded there can do what any page in the person's Chrome can, and with `NORACU_CHROME_TABS=all` that includes every signed-in site the person has open (mail, banking, admin consoles); the switch, once turned on, stays on until the person turns it off, and connections from other programs are only as safe as the person's answer to Chrome's dialog |
121
- | 11 | **Untrusted observation content** | ARIA snapshots, AX trees, OCR, page text contain attacker-controlled text | **Not mitigated** | The MCP client must treat tool results as data, never as instructions |
122
-
123
- ## Hardening recommendations
124
-
125
- - Leave `NORACU_ENABLE_EVAL` unset unless you actively need `browser_evaluate`; `NORACU_DISABLE_EVAL=1` keeps it off whatever else is set.
126
- - Set `NORACU_STOP_FILE` to a path you can `touch` in one step (a shell alias, a Shortcut) so you can stop all Mac and iPhone input, and the browser tools that act on a page, at once (`browser_launch` and the reading tools are not stopped); delete the file to resume.
127
- - For unattended runs, set `NORACU_APPROVAL_FILE` and list only the apps the task needs under `allow`.
128
- - Leave `NORACU_ALLOW_CDP` unset unless you drive an Electron app's web contents; quit the app when done so its DevTools port closes.
129
- - `NORACU_TRACE` writes only `{ ts, tool, args, ms, error, code }` — argument names and sizes, error code prefix, never argument text, result text, or error messages — and opens the file `0600` with `O_NOFOLLOW` (refusing symlinks).
130
- - Before an agent touches the iPhone layer: turn on a Focus, open a neutral app,
131
- and start with `NORACU_READ_ONLY=1`. Prefer "Ask every time" in iPhone
132
- Mirroring settings unless you need unattended sessions.
133
- - Gate `mac_type` / `mac_paste` behind human confirmation when the frontmost
134
- app is a password manager or banking site (client-side policy).
135
- - Run untrusted automation in a dedicated macOS user account with
136
- Accessibility + Screen Recording granted only to that account's client.
137
- - Audit tool calls in your MCP client's log — every action is visible there.
138
- - The persistent browser profile at `~/.noracu/browser-profile` keeps cookies
139
- across sessions — clear it between untrusted runs.
140
- - `NORACU_READ_ONLY=1` does not block the one-time `playwright install
141
- chromium` download triggered by `browser_launch`; set
142
- `NORACU_DISABLE_AUTO_INSTALL=1` to require a manual install instead.
161
+ | <a id="threat-1"></a>1 | **Prompt injection → arbitrary code execution** | Observed content (web page text, AX tree titles, OCR output) contains instructions that trick the agent into calling tools with malicious arguments | **Mitigated** | The Mac accessibility engine `src/mac-ax.js` is a static script that takes its whole request as JSON on stdin — parameters are data, never script source (regression-tested in `test/e2e.mjs`); the remaining inline JXA (scroll wheel) takes clamped numbers through argv |
162
+ | <a id="threat-2"></a>2 | **Arbitrary local control** | `mac_click` / `mac_type` / `mac_paste` can operate password managers, banking pages, terminals | **Inherent** | Use client-side confirmation gates for high-stakes targets; see [Session hygiene](#session-hygiene). Optional `app` focus guard on `mac_paste` / `mac_key` (and `mac_type` keystrokes) refuses input unless that app — compared by process, not by name — is frontmost; `mac_type` keystrokes after a click on an `element_index` go out only if the element's app is then frontmost. An `element_index` is re-identified inside the window it came from (by CGWindowID) before any action, and a physical click or drag (both ends) is sent only when a hit test shows the point reaches the element, or — when the hit test is inconclusive — when the topmost on-screen window at the point is that same window (by CGWindowID, not covered by another window of the same app; `occluded` otherwise). Right before a physical click or drag is sent, the window on top at each point is checked again (by CGWindowID); afterwards a physical click counts as `delivered_verified` only if the element is still there, changed, and its own window is still on top at the click point. An element read with `surface: "app"` is bound to its window's CGWindowID, and an element in a window without a CGWindowID (other than Finder's desktop) is refused with `policy_denied`. A `mac_click` at raw x,y is sent only when the topmost on-screen window at the point belongs to `app` (default: the frontmost app; the menu bar counts as the frontmost app's, and the strip a display keeps for the Dock counts as the Dock's; Notification Center's full-display overlay counts only over a banner or alert it draws, or everywhere when their frames cannot be read), unless `force: true`; a short gap remains between that check and the click. `mac_key` refuses quit / log-out / lock / force-quit / delete-immediately / empty-Trash chords without `force`; `mac_menu_command` applies the same chord list, refuses Apple-menu items without `force`, and never quits the MCP host or a session process. |
163
+ | <a id="threat-3"></a>3 | **Arbitrary JS in browser** | `browser_evaluate` executes any JavaScript in the page context | **Partially mitigated** | Off by default: `browser_evaluate` returns `eval_disabled` unless the server was started with `NORACU_ENABLE_EVAL=1`, and `NORACU_DISABLE_EVAL=1` keeps it off even then (it stays listed in `tools/list`). Once it is turned on, any script runs in the page |
164
+ | <a id="threat-4"></a>4 | **Input validation gaps** | Malformed arguments (NaN coordinates, oversized strings, `javascript:` URLs) | **Mitigated** | `validateArgs` validates every tool's arguments (types, ranges, enums, string lengths, URL schemes) before any subprocess runs; `tools/list` emits `required` arrays derived from non-optional arguments |
165
+ | <a id="threat-5"></a>5 | **Screenshot privacy** | `mac_screenshot` / `phone_screenshot` capture the full screen / phone display | **Inherent** | Run in a dedicated macOS user account or virtual display for untrusted automation. `NORACU_READ_ONLY=1` prevents side effects (and skips `enableWebAccessibility` on apps), not screen secrecy: `mac_screenshot` still shows visible notification banners on screen, and Notification Center accessibility reads via `mac_ax_state` / `mac_find` are not blocked by bundle id |
166
+ | <a id="threat-6"></a>6 | **iPhone operations** | `phone_tap` / `phone_type` can interact with payment and SMS-verification UIs; taps go to OCR coordinates with no element re-check | **Inherent** | Keep Mirroring off for untrusted sessions; `NORACU_READ_ONLY=1` refuses all phone input; all phone input (including `phone_home` / `phone_app_switcher`, via `require_enabled` on the menu item or `imctl`'s `_require_live`) fails closed with `mirror_not_live` when not live — without stealing focus when paused or closed — or `mirror_state_unknown` when the state cannot be read, checks that iPhone Mirroring is frontmost before synthesized events, and never falls back to a second gesture after an uncertain menu timeout (`menu_unknown`); optional `expect` OCR anchor gates coordinate/key/type actions; "Authenticate automatically" lets anyone at the unlocked Mac start mirroring |
167
+ | <a id="threat-7"></a>7 | **Supply chain** | malicious PRs / dependency poisoning after open-sourcing | **Partially mitigated** | Review all PRs touching `src/server.mjs` argument handling; lockfile committed; no `postinstall` scripts; the only runtime download is the one-time Playwright `chromium` install triggered by `browser_launch`, which can be disabled with `NORACU_DISABLE_AUTO_INSTALL=1` |
168
+ | <a id="threat-8"></a>8 | **Local file read via browser** | `browser_navigate` to a `file://` URL, then `browser_read` exfiltrates local files; or a tab that someone opened on a local file becomes the active page | **Partially mitigated** | `file://` blocked at the `browser_navigate` argument and at the `url` of `browser_tabs` `new` unless `NORACU_ALLOW_FILE_URL=1` (initial URL only; redirects fall under threat 9). A tab becomes the active page — through `browser_tabs` `select`, or by taking over when the active tab closes — only when it shows an http(s) page, or is still on the blank page that `browser_launch` or `browser_tabs` opened it on (a blank page a tab shows after it has loaded anything else does not count: one reached from a local file still loads other local files into frames, where a screenshot shows them). The session's first tab is Chromium's own, so it is not taken on trust: when it starts on a blank page noracu sends it to `about:blank` itself, checks that a new document is there, and empties `window.name` before it counts (measured: after that navigation a blank page that a local file went to no longer loads local files and the old document is gone; the name survives it), and any navigation the tab reports afterwards ends that — also one back to an earlier blank page in its history (measured: `history.back()` to a blank page that a local file had reached loads local files again). A first tab that starts on anything else is held to the rule like any other tab. A tab restored at launch was looked for and not seen: a headed Chromium started the way noracu starts it, on a profile set to continue where it left off whose last session had a blank tab that a local file had gone to, came back with one fresh blank tab (two runs); the checks above do not rely on that. The tab that already is the active page is held to the same rule each time a page tool is called: once it shows anything else — a blob the page made, Chromium's page for a load that failed, a blank page after another page, a local file someone opened in that tab — the page tools return `active_page_not_allowed`, and only `browser_navigate` (which reads nothing of the page it leaves) and `browser_tabs` act. A tab on a local file, a browser page or a blob, and a blank tab that a page opened (it shares that page's origin and can read it), are listed with their url and title and nothing else of them is read: `tab_not_selectable`, and `no_active_page` from the page tools when no other tab is open. What a tab shows is looked at when a call starts, by the address the browser reports for it then; while a navigation is being committed that is still the old address for a moment (measured after a load that failed: calls sent with no pause got past this check every time). So the tools that return page content — `browser_read`, `browser_snapshot`, `browser_screenshot`, `browser_evaluate` — look again once they have their result, or an error, and drop it when the page no longer passes — or when the tab went through a page that does not pass while they worked and is back on one that does (measured: 60 calls in that moment, none handed over the arriving page; this rests on the browser reporting a navigation before it answers from the new page). The input tools are checked at the start only: in that moment input can reach the page that is arriving. A page cannot take itself to a local file or a browser page (Chromium refuses that), and the browser tools' own keystrokes go to the page, never to the address bar (measured in a headed Chromium), so the arriving page is a local file only when one is opened in the active tab from outside the browser tools — by hand, or by Mac-layer input. Remaining: input that reaches an arriving page in that moment (a click or fill by selector also tells whether the selector exists there). Outside this row: a session attached to an app with `cdp_port` (threat 15), which uses that app's own pages whatever they show; and the Mac layer when it is on — its input can type an address into a headed browser's address bar, and `mac_screenshot` shows the browser's window like any other (threats 2 and 5) |
169
+ | <a id="threat-9"></a>9 | **HTTP GET side effects** | navigation triggers logout links, one-time tokens, private-network / cloud-metadata endpoints | **Not mitigated** | No URL blocklist (redirects and DNS rebinding defeat pre-navigation checks); client-side policy |
170
+ | <a id="threat-10"></a>10 | **Clipboard clobbering by mac_paste** | `mac_paste` overwrites the clipboard with the pasted text | **Partially mitigated** | One engine call copies every clipboard item and type aside (inside that process), writes the text marked `org.nspasteboard.TransientType`, sends ⌘V only if the clipboard and the frontmost app are unchanged, and puts the user's items back after the paste shows in the same focused element (held at least 0.3 s; else after a 1 s hold) and only if nothing else wrote to the clipboard meanwhile; when the keystroke may not have completed it is not put back. An item marked concealed (on any clipboard item) is never copied: the clipboard is cleared after the paste. Universal Clipboard content and clipboards over 64 MB are refused unless `force`. Remaining: for up to about a second the clipboard holds the pasted text (a clipboard manager that ignores the transient marker can record it); an app that reads the clipboard after the hold receives the restored content; when the app stops answering the pasted text is left on the clipboard |
171
+ | <a id="threat-11"></a>11 | **Untrusted observation content** | ARIA snapshots, AX trees, OCR, page text contain attacker-controlled text | **Not mitigated** | The MCP client must treat tool results as data, never as instructions |
172
+ | <a id="threat-12"></a>12 | **Phone screen as model input** | `phone_screenshot` / `phone_ocr` / `phone_find` — and, under the XCUITest backend, `ios_screenshot` / `ios_snapshot` — return notifications, messages, mail and one-time codes visible on the phone | **Inherent** | Use a Focus mode and a neutral app; the MCP client sends tool results to its model; iPhone notifications also reach the Mac once Mirroring is set up |
173
+ | <a id="threat-13"></a>13 | **Actions on windows the user cannot see** | Semantic Mac actions (press, set value, insert text) work on background windows without moving the pointer or taking focus | **Inherent** | Results report `delivery` and `retry`; review the client's tool log; close high-stakes apps during unattended runs |
174
+ | <a id="threat-14"></a>14 | **Quitting apps** | `mac_app` quit can close apps; force-quit loses unsaved work | **Mitigated** | Graceful quit by default and verified by the process ending; `force: true` required to force-quit; session processes (Finder, Dock, loginwindow, SystemUIServer, Control Center, Notification Center, …) and the MCP host process are never quit |
175
+ | <a id="threat-15"></a>15 | **DevTools port exposure** | `mac_app` launch with `cdp_port` opens a Chromium/Electron app's remote-debugging port on `127.0.0.1` (no per-user isolation); any local process can then control that app | **Partially mitigated** | Off unless `NORACU_ALLOW_CDP=1` (or `=any`); `browser_launch` with `cdp_port` is refused under `NORACU_READ_ONLY=1` even with `NORACU_ALLOW_CDP` set; bound to `127.0.0.1`; only for a fresh launch after canonicalizing `.app` paths (`realpath`, trailing slash stripped — a running app is refused, never quit for you); the app rules (`NORACU_DENY_APPS`, the approval file) decide before the launch, by the bundle id read from the app on disk, so an app they rule out is not given a port; with `NORACU_ALLOW_CDP=1`, `browser_launch` attaches only when the port was recorded by this `noracu` process (at launch, only when the process listening on it is the launched app or one of its child processes and `/json/version` names a websocket on that port), its PID is still alive, and `/json/version`'s `webSocketDebuggerUrl` matches (attaching to any other loopback port requires `NORACU_ALLOW_CDP=any`); `~/.noracu` and `cdp-profiles` are created `0700`; Chrome-family browsers get a separate profile under `~/.noracu/cdp-profiles`; standalone `browser_launch` is refused while a CDP session is open; the port closes when the app quits |
176
+ | <a id="threat-16"></a>16 | **Clipboard and notification content** | `mac_clipboard_read` / `mac_notifications` return clipboard text, images, file paths and notification text to the model | **Partially mitigated** | Items marked `org.nspasteboard.ConcealedType` (password managers) are never returned; `mac_clipboard_read`, `mac_notifications`, and `mac_wait` with `condition: "notification"` are refused under `NORACU_READ_ONLY=1` (`NORACU_READ_ONLY=1` prevents side effects, not screen secrecy: `mac_screenshot` still shows visible notification banners and Notification Center AX reads are not blocked by bundle id); notification actions reject empty `id` / `expected_app` / `expected_title`, return `notification_not_found` when absent, and require an id or an index plus a re-checked app/title fingerprint; `mac_set_value` on `AXSecureTextField` never echoes the value. Remaining: `mac_clipboard_read` on Universal Clipboard content (copied on another device) makes macOS fetch it from that device; the result marks it `remote: true` |
177
+ | <a id="threat-17"></a>17 | **Text in process arguments** | Text sent as keystrokes (`mac_type` physical path: `cliclick t:…`) is visible in the process list while it runs | **Partially mitigated** | The accessibility path (`mac_type` default, `mac_set_value`), `mac_paste`, and `phone_type` / `phone_find` / `phone_open` (imctl reads the text from stdin) pass text on stdin, and `mac_set_value` on `AXSecureTextField` and `imctl type` never echo typed text; only the keystroke fallback uses argv. A phone call's `expect` text is still an argument |
178
+ | <a id="threat-18"></a>18 | **Clipboard on the phone path** | `phone_type` / `phone_open` paste through the Mac clipboard; iPhone Mirroring fetches the paste asynchronously, sometimes more than 10 s after ⌘V, from whatever the clipboard holds then, so putting the user's clipboard back too early could paste it into the phone | **Partially mitigated** | `phone_type` and `phone_open` wait at least 1.5 s after writing the clipboard before ⌘V, and call ⌘V off (`focus_lost`) rather than bring iPhone Mirroring back if another app came to the front meanwhile. `phone_type` copies every clipboard item aside and puts them back only on screen evidence read within its 2.5 s check while no "Pasting from" progress box shows: OCR sees the text at a new spot below the status-bar strip in two reads, counted against a read taken right before ⌘V. A text of one to three characters (spaces and case aside) never licenses it, and neither does a paste seen only later. An item marked concealed or transient is never copied (the clipboard is cleared instead). Without that evidence the typed text stays on the clipboard and the result says so. An error before ⌘V is sent restores the clipboard; an error once ⌘V may be on its way never does. `phone_open` never restores it once ⌘V may have been sent (before ⌘V — an error, or `focus_lost` — it goes back under the same rule). Remaining: the user's previous clipboard is lost whenever the evidence is missing; Universal Clipboard content and clipboards over 64 MB are not copied, so they are replaced by the typed text; a ⌘V that reaches the phone before Universal Clipboard has announced the new text can paste the phone's own older clipboard instead — possibly something once pasted on the phone, such as a password — and the wait — 1.5 s, a judgement rather than a measured delay — is meant to let the new text reach the phone first but does not close that window; the OCR evidence matches the typed text inside a line, so an older clipboard that contains the typed text can pass for the paste; the "Pasting from" box is recognized only in English |
179
+ | <a id="threat-19"></a>19 | **Input the person at the Mac cannot see** | Background input (bgpost, 0.3.0) posts physical clicks and named keys straight to an app's process: the pointer does not move and the app need not be in front | **Partially mitigated** | Input still waits for the person at the Mac (`user_active`); `NORACU_STOP_FILE` stops all Mac and iPhone input at once, and the browser tools that act on a page (`browser_click`, `browser_type`, `browser_fill`, `browser_press_key`, `browser_scroll`, `browser_navigate`, `browser_evaluate`, and `browser_tabs` new / close — not `browser_launch` or the reading tools); the deny list (by default the common terminal apps and IDEs with a built-in terminal) and the opt-in approval file are judged on the app that receives the input, and an app that cannot be identified gets nothing; web-engine apps and `mechanism: "physical"` use the real pointer; `NORACU_NO_BGPOST=1` turns background input off. Results carry `route`. Watching the client's tool log is still the only way to see every action |
180
+ | <a id="threat-20"></a>20 | **Approval, deny and stop settings changed by the agent** | An agent with a shell or file tool (the MCP host's, not noracu's) edits `NORACU_APPROVAL_FILE` or deletes the stop file | **Partially mitigated** | noracu never writes these files and reads them at every call; once `NORACU_APPROVAL_FILE` is set, the file must exist, be a plain file (not a symlink), mode `0600`, owned by the user running noracu and hold only `allow` / `ask` / `deny` with non-empty patterns, else all Mac and iPhone input is refused (app rules do not judge the browser layer; the stop file stops it). Anything running as you can still edit them — they stop the model through noracu's tools, not other software or a host shell tool you allowed (see "What noracu hands to your model" above) |
181
+ | <a id="threat-21"></a>21 | **Looking at the phone is visible to its apps** | A capture of the iPhone Mirroring window reaches the app on the phone as a screenshot: in a device run (iPhone 17 Pro Max on iOS 27, Mac on macOS 27.2) LinkedIn and rednote each showed their after-screenshot share sheet 1–4 s after every capture, one more per capture. Captures are made by `phone_screenshot` / `phone_ocr` / `phone_find`, any `expect` check, the checks inside `phone_type` / `phone_open` / `phone_scroll`, and a phone input that first has to bring iPhone Mirroring to the front | **Inherent** | noracu cannot read the mirror without capturing it. It captures no more than a tool needs: where the phone screen sits inside the window is measured once per window size and macOS version and remembered in `~/Library/Caches/noracu/phone-screen-rect.json` (window size, macOS version, four edges, two timestamps — nothing from the phone), so once the edges are remembered `phone_tap`, `phone_longpress` and `phone_swipe` without `expect` add no capture of their own — except when iPhone Mirroring first has to be brought to the front, which is one of the captures listed above. Not tested: apps that log screenshots or tell the other person in a chat about them — assume they do so on every capture, and keep such apps off the screen while an agent observes |
182
+ | <a id="threat-22"></a>22 | **A listener on the iPhone (XCUITest backend)** | The runner on the phone takes commands over TCP; whoever can reach it and knows its token can read and drive the phone | **Partially mitigated** | Off unless `NORACU_PHONE_BACKEND=xcuitest`. The runner binds only the device's own CoreDevice tunnel address — a unique-local (`fc00::/7`) address, or `::1` when CoreDevice reports the tunnel as loopback (a simulator's runner binds `127.0.0.1`); any other address is refused before the runner starts — measured on an iPhone 16 Pro: the same port on the phone's Wi-Fi address refuses connections — accepts only peers in the tunnel's /64, and requires a 128-bit token made new at every start, compared in constant time; a wrong token or a request line over 64 KiB closes the connection. The token travels in the environment of `xcodebuild`, never in arguments, results or the trace file — but another process of the same macOS user can read that environment and reach the tunnel while the runner is up, so do not run software you do not trust in the account that runs noracu. The server stops `xcodebuild` (and with it the runner) when it exits |
183
+ | <a id="threat-23"></a>23 | **iPhone input through XCUITest** | `ios_tap` / `ios_type` / `ios_swipe` / `ios_key` act in any app of an unlocked iPhone, payment and messaging apps included; a raw x,y tap or a swipe has no element re-check | **Inherent** | Opt-in backend; `NORACU_READ_ONLY=1` refuses all `ios_*` input; `NORACU_STOP_FILE`, `NORACU_DENY_APPS` and `NORACU_APPROVAL_FILE` are checked before every input, on the iOS bundle id — an approval file that allows only the apps you mean is the tightest setting; a locked iPhone, or one whose lock state cannot be read, gets nothing — the lock is read when a call starts and again before any command sent more than 1 s after the last unlocked answer, so a phone locked within that second is not caught (a lock during a running call has not been tried on a device); no input goes to an app while a system alert is up on the phone (`system_alert`); an `element_index` is re-read before it is used. Use a spare iPhone for unattended runs |
184
+ | <a id="threat-24"></a>24 | **A stale picture of what is in front** | For about a second after an app leaves the front (measured after a Home press), iOS still reports it as in front; an index or a point used in that moment could land on another screen | **Partially mitigated** | `ios_home` and `ios_launch` end every earlier index and wait for the change to show; before an index is used the app is read again and the element must match in type, label, identifier and frame; the runner refuses input for an app that is not in front. What remains is that second after someone presses Home on the phone itself |
185
+ | <a id="threat-25"></a>25 | **An unlocked iPhone** | The XCUITest backend works only while the iPhone is unlocked, and unattended use means turning auto-lock off | **Inherent** | Physical access to the phone is then access to everything on it. Use a spare device without your main accounts, and keep it where you can see it |
186
+ | <a id="threat-26"></a>26 | **Signing the runner** | `noracu ios-setup` builds and signs the runner with your Apple developer team: Xcode contacts Apple's developer service and may create a development provisioning profile and an app identifier in the team; `--register-device` adds the iPhone to the team's devices | **Inherent** | Only when you run that command — never on install, never while the MCP server runs. A simulator build is not signed and contacts nothing |
187
+ | <a id="threat-27"></a>27 | **The Home Screen as a way around app rules (XCUITest backend)** | Input that names `com.apple.springboard` is sent by screen coordinates and lands on whatever is in front — SpringBoard reads as "in front" under every app (measured on an iOS 26.5 simulator) — so a rule that allows it would let a tap reach an app the rules do not allow | **Mitigated** | While `NORACU_APPROVAL_FILE` or a `NORACU_DENY_APPS` of your own is set, no input that names `com.apple.springboard` is sent — not even one tap on a button of a system prompt: taps, long presses, drags, text and keys return `input_denied` before a runner is started, and nothing reaches the phone. Apps are opened with `ios_launch`, which asks the rules; `ios_home` still goes out. The cost: under app rules the agent cannot answer a system prompt (a permission dialog) — the person at the phone does. With no rules set, such input is sent as asked and reaches the app in front |
188
+ | <a id="threat-28"></a>28 | **Working in the person's own Chrome** | `browser_launch` with `chrome: true` attaches to the Chrome the person uses, through Chrome's remote-debugging switch; the tabs noracu opens there carry the person's sign-ins, so an agent working in them acts as the person on those sites, and while the switch is on any local program can ask Chrome for a connection | **Partially mitigated** | Off unless `NORACU_ALLOW_CHROME=1`; refused under `NORACU_READ_ONLY=1`; it needs Chrome's own switch (`chrome://inspect/#remote-debugging`, off by default), and Chrome asks the person to allow each connection and shows a banner while one is open (since Chrome 136 `--remote-debugging-port` is ignored for the default profile). noracu opens a window of its own in the background and lists, reads and acts only on the tabs it opened there and tabs those tabs open; noracu never lists, reads or acts on the person's other tabs unless the person also sets `NORACU_CHROME_TABS=all` (then the person's http(s) tabs are listed and can be selected, read and acted on, never closed or sent to a non-http(s) address, and become the active page only when selected and stop being it when they leave http(s); `file://`, `chrome://` and the like are not listed, whatever `NORACU_ALLOW_FILE_URL` says), and in noracu's own tabs the address rules apply (http(s) only; `file://` only with `NORACU_ALLOW_FILE_URL=1`; `chrome://` and the like never). `browser_evaluate` never runs in a `chrome: true` session. `browser_close` closes noracu's tabs and disconnects (it keeps the session while one of them is still open or the disconnect is unconfirmed); noracu never quits Chrome. Remaining: whatever an agent does in those tabs is done as the person (posting, buying, changing settings on a site), and a page loaded there can do what any page in the person's Chrome can, and with `NORACU_CHROME_TABS=all` that includes every signed-in site the person has open (mail, banking, admin consoles); the switch, once turned on, stays on until the person turns it off, and connections from other programs are only as safe as the person's answer to Chrome's dialog |
143
189
 
144
190
  ## Reporting a vulnerability
145
191
 
146
- Please report security issues privately through a GitHub Security Advisory
147
- (repo → **Security** → **Advisories** → **Report a vulnerability**). Do not
148
- open public issues for exploitable bugs. We aim to respond within 72 hours.
192
+ Report it privately through a [GitHub Security Advisory](https://github.com/sgInnora/noracu/security/advisories/new)
193
+ (on GitHub: **Security** → **Advisories** → **Report a vulnerability**). Do not open a public issue, pull request or
194
+ discussion for an exploitable bug, a switch that can be bypassed, or a leak of local data before a fix ships.
195
+
196
+ - **Include:** the noracu version or commit, the summary line of `npx noracu doctor`, the macOS version, the MCP client,
197
+ the layers and iPhone backend, the `NORACU_*` variables set, the tool names, minimal steps, what you expected and what
198
+ happened, and which server-enforced boundary failed (read-only, the stop file, the deny list, the approval file,
199
+ `eval_disabled`, the active-page checks, hit testing, DevTools or XCUITest access).
200
+ - **Leave out:** live credentials, browser cookies, one-time codes, personal screenshots or clipboard contents, Apple
201
+ team IDs and device UDIDs.
202
+ - Ordinary bugs, and prompt-injection behaviour inside the documented boundaries where no server control failed, go to
203
+ the [issue forms](https://github.com/sgInnora/noracu/issues/new/choose).
204
+ - noracu is maintained by one person, with no formal response time; the aim is to acknowledge a private report within
205
+ 72 hours.