---
title: Security
description: How Pipedash stores and encrypts tokens, protects the web API and WebSocket, pairs devices, limits unencrypted HTTP, rejects cross-origin writes, handles telemetry and receives vulnerability reports.
---

Pipedash keeps provider tokens in one of 3 token stores and encrypts them with AES-256-GCM in the database stores. The web API uses the vault password as a bearer token. This page lists the encryption parameters, the routes that skip authentication and the cross-origin rules.

## Token storage

Pipedash supports 3 token stores. The [token storage page](/docs/configuration/token-storage) explains how Pipedash selects one.

| Store | Where tokens live |
|---|---|
| System keyring | One JSON token map in the OS keyring under service `pipedash` and account `tokens`. Desktop and iOS, where the keyring is the Keychain |
| Encrypted SQLite | The columns `providers.encrypted_token` and `providers.token_nonce` |
| Encrypted PostgreSQL | The table `encrypted_tokens` with provider ID, nonce and ciphertext |

Provider plugins declare token prefixes in their metadata, so Pipedash can recognize token-shaped values. Config validation still accepts a literal token in `config.toml`, and provider sync stores it. A token reference is the safe form: `${ENV_VAR}` or `env:VAR` reads the token from an environment variable, and a `NAME_FILE` variable points `${NAME}` at a [secret file](/docs/configuration#secret-files). `PIPEDASH_TOKEN_<provider_id>` has no effect.

Prefix detection is not a secret scanner. Credentials must not appear in configuration committed to source control, email or public issues.

At startup the desktop and iOS app use the keyring when the backend is SQLite, `PIPEDASH_VAULT_PASSWORD` is unset and the database holds no encrypted tokens. They start locked when SQLite holds encrypted tokens and the variable is unset, or when the backend is PostgreSQL and the variable is unset. Background tasks wait until the user enters the password, and the interface prompts for it.

The iOS app has an optional app lock that uses Face ID or Touch ID. The iOS notification copy of provider credentials lives in a separate Keychain item. The [privacy policy](/privacy) describes it. A phone that gets alerts from a host keeps a second copy, described under [Push relay](#push-relay).

## Encryption parameters

Both database stores encrypt each token with AES-256-GCM. They use a random 12-byte nonce and a 32-byte key. Each store derives the key from the vault password with Argon2id, version 0x13, and a 32-byte output.

| Use | Memory cost | Time cost | Parallelism |
|---|---|---|---|
| SQLite token key | 65536 KiB | 3 | 1 |
| PostgreSQL token key | 4096 KiB | 1 | 1 |
| SQLite backup key | 65536 KiB | 3 | 1 |
| PostgreSQL backup key | 4096 KiB | 1 | 1 |
| Keyring backup key | 4096 KiB | 1 | 1 |

Pipedash uses fixed salts, so the same password gives the same key on every install. A strong vault password carries the protection. The setup wizard requires at least 8 characters.

SQLite token encryption requires a vault password. PostgreSQL needs an explicit vault password as well. A passwordless PostgreSQL setup gets a random password that Pipedash does not save, so tokens written without one cannot be read after a restart.

### Vault binding

Both database stores keep an encrypted marker value in the `vault_verifier` table. The first password that opens a vault stays bound to it, even before a provider exists. Another password fails with the error "Wrong vault password" and never replaces the first one.

## API authentication

The web server keeps the API token in memory. It takes the token from `PIPEDASH_VAULT_PASSWORD` at startup. It also takes the vault password that the setup wizard sets when no token exists, and the password that opens a locked vault. Locking the vault or a wrong password never turns authentication off. When no token exists, the API accepts every request. When one exists, protected routes require this header:

```text
Authorization: Bearer <token>
```

The token is the operator API token or the token of a paired device. A paired device stays subject to the device-only and host-managed restrictions below. A missing or invalid token returns `401`. The server compares the operator token in constant time. These paths skip the check:

- Paths outside `/api/v1/`, which serve the embedded frontend
- Paths that start with `/api/v1/health` or `/api/v1/setup`
- The exact paths `/api/v1/vault/status`, `/api/v1/ws` and `/api/v1/plugins`
- `GET` requests on `/api/v1/downloads/{ticket}`

`/api/v1/vault/lock` and `/api/v1/vault/unlock` need the token. The setup route skips authentication, so it returns a conflict error when the instance is already configured. The [REST API page](/docs/deployment/rest-api) lists the routes.

A log download link carries a ticket instead of the token, so a browser can save the file through its own download manager. An authenticated request creates the ticket. The ticket is 128 random bits, works once and expires after 60 seconds. At most 32 tickets wait at a time. Opening the vault and a storage change cancel every pending ticket. The download answer sends `Cache-Control: no-store` and `Referrer-Policy: no-referrer`.

When authentication is required, a WebSocket client must send its first message as an `auth` frame with the operator API token or a paired-device token:

```json
{ "type": "auth", "token": "<token>" }
```

A device that has no token yet sends a `claim` frame with a pairing code, a device name and a platform instead. The server answers a successful `auth` or `claim` with `auth-ok`. An invalid token, an invalid code or a failed pairing gets an `auth-error` frame with a code and a message, and the server closes the socket. It compares the operator token in constant time. Events then arrive as `{ "type": "<event name>", "payload": ... }`.

### Provider action policy

Authentication does not make every provider action available. The backend checks the provider's current action policy before triggering, cancelling or changing a run.

A provider connected with `auth_mode = "none"` is read-only. The backend blocks its mutating actions even when a client sends a request directly. The [architecture page](/docs/resources/architecture#backend-presentation) shows where this check sits.

## Paired devices

A web server or a sharing desktop app can host other Pipedash apps. The [Mobile](/docs/deployment/mobile#connect-to-a-server) and [Desktop app](/docs/deployment/desktop#share-with-other-devices) pages describe the flow.

- **Pairing code:** the host shows an 8-character code. It works once and expires after 5 minutes. The host keeps at most 8 open codes.
- **Device token:** each paired device gets its own random token. The device keeps it in the system keychain, and it never reaches the web view. The host stores only the SHA-256 hash, with the device name, platform, paired date and last-connected date, in the `paired_devices` table.
- **Vault password:** it never leaves the host.
- **Removal:** removing a device in Settings, Devices closes its connection at once, and the app shows "This device was removed". "Disconnect" on the device tells the host to forget it. A factory reset on the host removes every paired device.
- **Host-managed settings:** a paired device cannot change the vault, setup, storage, push or the factory reset of the host. The host answers `409` with `HOST_MANAGED`.
- **Locked host:** a locked sharing desktop answers `503` with `HOST_LOCKED`. Devices reconnect after the unlock.
- **Demo mode:** a read-only demo allows pairing codes. It stores a device under a generic name such as "Demo iPhone or iPad" instead of the device hostname. A paired device can remove only itself and change only its own push registration, so visitors can't remove each other's devices.

The [REST API page](/docs/deployment/rest-api#devices) lists the routes and the WebSocket frames.

## Private HTTP policy

A paired app connects to its host over a WebSocket. `https` and `wss` addresses are always allowed. Plain `http` is allowed only for a private-network address, and only after the user turns on "Allow unencrypted connections on private networks". The switch is off by default. The app warns that anyone on that network could read pipelines and the access token of the device. The app refuses a public `http` address.

The app checks the addresses that the host name resolves to. These count as private:

- `10.0.0.0/8`, `172.16.0.0/12` and `192.168.0.0/16`
- `100.64.0.0/10` and `169.254.0.0/16`
- Loopback addresses
- `fc00::/7` and `fe80::/10`
- IPv4-mapped (`::ffff:0:0/96`) and NAT64 (`64:ff9b::/96`) addresses, judged by the IPv4 address they carry
- Single-label names and names that end in `.local`, `.lan`, `.home.arpa` or `.internal`

A sharing desktop serves on its LAN address over plain `http`. The proxy setting of the host applies to its provider calls and not to the device connection.

## Push relay

A phone can get alerts from a host in the background, and on iPhone and iPad through push. Apple delivers push only through a server that holds the signing key of the app, so the developer runs a relay at relay.pipedash.app. Push is off by default on a web server and opt-in on the phone. The relay is the only extra party. This section lists what it and Apple see.

- **Relay stores:** the APNs device token, the APNs environment, the app bundle id, timestamps, and a SHA-256 hash of the random subscription id. It drops a subscription after 90 days without activity.
- **Relay receives per alert:** the subscription id and an opaque alert id of 32 hex characters. It never receives a title, a body, a pipeline name, a provider id or a credential. It does see when an alert happens and for which subscription.
- **Apple receives per alert:** the generic title "Pipedash", the body "New alert. Open Pipedash to see it." and the alert id. The push expires after 24 hours, and the alert id is its collapse id.
- **Alert text:** the notification service extension in the iOS app downloads the real text from the host with `GET /alerts/{id}` and the bearer token of the device. The text never passes through the relay or Apple.
- **Extension access:** the extension reads the host address and the device token from a Keychain item. It shares the item with the app through one keychain access group. It has no push entitlement.
- **Extension HTTP rule:** `https` always works. Plain `http` works only when the user allowed unencrypted private connections and the host is a private IP address or ends in `.local`. The private ranges are `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, `169.254.0.0/16`, `127.0.0.0/8`, `::1`, `fc00::/7` and `fe80::/10`. The extension does not resolve names, so single-label names and names that end in `.lan` or `.internal` get the generic text. This is stricter than the [private HTTP policy](#private-http-policy) of the app.
- **Token copies:** background checks need the device token while the phone is locked. The app copies the host address and the token into a Keychain item on iOS or into encrypted files on Android. On iOS the item has the service `pipedash.background-notifications`. It is readable after the first unlock following a restart, on this device only. The copy ends when the user turns notifications off, removes the server or disconnects.
- **Operator choice:** a web server sends alerts to the relay only after an operator turns on "Background notifications" in Settings, Notifications, or sets `PIPEDASH_PUSH_RELAY_URL` to a non-empty value. The variable overrides the setting and disables the switch. The iPhone app accepts only the relay it was built for and reports a mismatch.
- **Host data:** the host stores the relay subscription id of each device that turned push on, and the alerts for 7 days (500 at most). Removing a device, turning notifications off in the app, or a factory reset on the host deletes the registration.

## Cross-origin requests

By default the server rejects requests that change state when a browser sends them from another origin. This stops another website from changing an instance through the browser of its user. The check covers every method except `GET`, `HEAD` and `OPTIONS`, and it covers WebSocket upgrades. A rejected request gets `403`.

The server decides with these rules:

- A `Sec-Fetch-Site` header other than `same-origin` or `none` marks the request as cross-origin.
- Without that header, the server compares the scheme and host of the `Origin` header with the `Host` header. The `X-Forwarded-Proto` header supplies the scheme behind a TLS proxy.
- A request without an `Origin` header, such as one from `curl`, a script or a native Pipedash app, passes.

The server sends no CORS headers by default. `PIPEDASH_CORS_ALLOW_ALL` set to `true` or `1`, or `server.cors_allow_all = true` in `config.toml`, turns the check off and allows any origin, method and header. The variable wins over the file. A deployment needs this setting only when it serves the frontend from a different origin.

## Telemetry

Pipedash sends no analytics, tracking or telemetry. Credentials, pipeline configuration and preferences stay on the device. Connections go directly from the device to the providers, to the storage servers and to the proxy that the user configures. Pipedash also reads public provider status pages without credentials. The switch "Check provider status pages" in Settings > General turns this off. The [privacy page](/privacy) has the policy. A server deployment with PostgreSQL stores its data in the PostgreSQL database it connects to.

The privacy policy covers the desktop, web, iOS and Android apps, the push relay and the website.

## Logs

Pipedash logs name the variable that supplied a token and count loaded tokens. They do not print token values. Errors from provider requests drop credentials, query strings and fragments from the URL. Request logs replace a download ticket with `[redacted]`. The push relay does not log device tokens, subscription IDs, alert IDs or notification text.

## Vulnerability reports

Vulnerability reports go through GitHub private vulnerability reporting. The [Report a vulnerability](https://github.com/hcavarsan/pipedash/security/advisories/new) page opens a private report. Email to hcavarsan@yahoo.com.br also works. Issues in the [GitHub issue tracker](https://github.com/hcavarsan/pipedash/issues) are public, so a report there omits token values, exploit steps and payloads. It names the affected component and version instead.
