Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ iphone-control is, by design, a remote control for a phone. Anyone who can talk
| Asset | Where | Who can reach it |
|---|---|---|
| Phone control (taps, typing, screenshots, apps) | Control socket: `$XDG_RUNTIME_DIR/iphone-control/ctl.sock` on Linux, `~/.local/share/iphone-control/ctl.sock` on macOS; mode 0600 | The user the daemon runs as, and root |
| WebDriverAgent (no authentication) | On the phone, reached through usbmuxd; nothing listens on the network unless you run `wda-bridge` | With `wda-bridge`: **every local user** on the host, since the port is on 127.0.0.1. Browsers are blocked by a Host-header check (DNS rebinding), other local processes are not |
| WebDriverAgent (no authentication) | On the phone, reached through usbmuxd. It listens on the phone's loopback only (`USE_IP=127.0.0.1`), so other devices on the phone's network can't reach its 8100 or 9100 port; nothing listens on the host's network unless you run `wda-bridge` | With `wda-bridge`: **every local user** on the host, since the port is on 127.0.0.1. Browsers are blocked by a Host-header check (DNS rebinding), other local processes are not |
| Live viewer (`iphone-control viewer`, opt-in; also as a service) | A page on `127.0.0.1` (port 8200 by default), with `--lan` also on the local network over HTTPS (connections only from loopback, private, link-local and 100.64/10 addresses); MCP over HTTP on the same port (`/mcp`); nothing listens unless you run it. Its AI tasks run Claude Code or Codex as the user who started the viewer. Login tokens in `viewer-tokens.json` in the data directory (0600); the self-signed HTTPS key in `viewer-tls/` (key 0600) | Whoever has a token: every HTTP request needs one, from `127.0.0.1` too (a reverse proxy on the host makes visitors look local). An operating token can watch the screen, control the phone and start AI tasks (which use that user's agent login); a read-only token can only watch. Wrong tokens are rate-limited (20 a minute for the whole viewer). Other web pages in a browser are blocked by the `Host`, `Origin`, JSON and `Sec-Fetch-Site` checks. An agent working for a task gets only the task's token: it acts for that task and can't pause, resume or confirm it |
| Apple ID session tokens, development signing key and certificate | `account/` in the data directory (0700, key 0600) | Whoever can read the data directory. The Apple ID password itself is never stored |
| Pairing records | The system's `/var/lib/lockdown` (Linux, kept by usbmuxd) or `/var/db/lockdown` (macOS, shared with Finder) | Root on the host. A pairing record lets its holder talk to the phone over USB without another *Trust* prompt |
Expand All @@ -28,15 +28,15 @@ The data directory is `~/.local/share/iphone-control`. Everything runs as your r
- The control socket is a Unix socket with mode 0600, not TCP.
- The tunnel to the phone uses a user-space TCP stack, so no network interface or routing changes on the host, and the daemon needs no root.
- Auto-unlock is off by default. When enabled, it stops for good after a single wrong attempt (it writes a stop marker, `logs/UNLOCK-DISABLED`, before entering the second digit) and sends a notification; it never retries a passcode that might be wrong. The marker is global: a failure on one device stops auto-unlock on all of them until you run `unlock-reset`. It does not work before the first unlock after a reboot (BFU) — that always needs a person.
- Dependencies are pinned to exact versions, `Cargo.lock` is committed, release archives come with a sha256 that `install.sh` checks, and the WebDriverAgent download is checked against a sha256. CI runs gitleaks on every push.
- Dependencies are pinned to exact versions and `Cargo.lock` is committed. Each release signs a manifest per archive and, on Linux, per .deb with Ed25519; the installer and `iphone-control update` check its signature, name, size and SHA-256 before installing. The WebDriverAgent download is checked against a sha256. CI runs gitleaks on every push.

## Known risks and recommendations

- **Anyone who can act as your user can control the phone.** The daemon runs as a per-user service and talks to the phone through the system usbmuxd. Keep the account and the host locked down.
- **Third-party anisette server.** Apple ID logins need "anisette" data that normally only Apple hardware produces. By default it comes from a public server (`https://mac-ani.jkcoxson.com`, the default of the Impactor/omnisette libraries). The server does not receive your Apple ID password, but your logins depend on an identity it provisions, and it sees when you log in. Set `ICTL_ANISETTE_URL` to an [anisette-v3 server](https://github.com/Dadoum/anisette-v3-server) you run yourself to avoid this.
- **Use a dedicated Apple ID.** The session token and signing key on disk are enough to manage that account's development certificates and devices. A separate free account limits the damage if the host is compromised and keeps your main account clear of developer-account restrictions.
- **Third-party anisette server (WDA only).** Apple ID logins need "anisette" data that normally only Apple hardware produces. Native control on iOS 27 and later needs no Apple ID. By default the data comes from a public server (`https://mac-ani.jkcoxson.com`, the default of the Impactor/omnisette libraries). The server does not receive your Apple ID password, but your logins depend on an identity it provisions, and it sees when you log in. Set `ICTL_ANISETTE_URL` to an [anisette-v3 server](https://github.com/Dadoum/anisette-v3-server) you run yourself to avoid this.
- **Use a dedicated Apple ID (WDA only).** The session token and signing key on disk are enough to manage that account's development certificates and devices. A separate free account limits the damage if the host is compromised and keeps your main account clear of developer-account restrictions. Native control on iOS 27 and later needs none of this.
- **Auto-unlock stores your passcode in plain text.** Anyone with root on the host, or access to backups of the data directory, can read it — and the passcode is also what protects the phone's data and Apple ID. Only enable it on a host you fully control, and prefer leaving Auto-Lock off on a phone dedicated to automation.
- **Agents act with your hands.** An agent with these tools can send messages, make purchases and change settings. The MCP server tells agents to ask before paying, deleting, sending messages or changing account or privacy settings, but that is an instruction, not an enforcement mechanism. The same goes for AI tasks started from the viewer: the agent is told to call `iphone_confirm` first and the page waits for your answer, and a step you reject is refused, but an agent that skips the call isn't stopped. There it gets only the phone tools (Claude Code without its shell and file tools, Codex in a read-only sandbox). Use a phone and accounts you are comfortable automating.
- **Agents act with your hands.** An agent with these tools can send messages, make purchases and change settings. The MCP server tells agents to ask before paying, deleting, sending messages or changing account or privacy settings, but that is an instruction, not an enforcement mechanism. The same goes for AI tasks started from the viewer: the agent is told to call `iphone_confirm` first and the page waits for your answer, and a step you reject is refused, but an agent that skips the call isn't stopped. A task can be limited to some apps (`--app`): before acting in any other app it asks the same way, and a rejected step is refused, but pressing buttons and quitting apps are never checked, since they are how the agent gets back after you say no. There it gets only the phone tools (Claude Code without its shell and file tools, Codex in a read-only sandbox). Use a phone and accounts you are comfortable automating.
- **Back up the data directory securely**, and never commit it or the settings file. `.gitignore` excludes `data/`, `secrets/` and key material in case you keep copies next to the source.

## Developer tools
Expand Down
Loading