Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: add security warnings for shell/browser APIs and restrict cdpHost to localhost

Adam Eivy5940999f22c5
diff --git a/docs/API.md b/docs/API.md
index 99d31b293c..18a9d8a105 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -489,6 +489,8 @@ socket.on('detect:complete', (appData) => {
### Shell Terminal
+> **Security**: The shell WebSocket API provides full terminal access as the PortOS process user. It relies on PortOS's network-level access control (see [Security Model](#security-model)) — do not expose the PortOS server to untrusted networks.
+
```javascript
// Start a shell session
socket.emit('shell:start', { id: 'my-session' });
diff --git a/docs/features/browser.md b/docs/features/browser.md
index 10996d69d0..9e73f48a81 100644
--- a/docs/features/browser.md
+++ b/docs/features/browser.md
@@ -43,6 +43,10 @@ portos-browser (PM2 process)
| GET | `/api/browser/version` | CDP version info |
| GET | `/api/browser/logs` | Recent PM2 logs |
+## Security
+
+Browser management relies on PortOS's network-level access control (see [Security Model](../API.md#security-model)). The `cdpHost` config is restricted to localhost values (`127.0.0.1`, `localhost`, `::1`) to prevent SSRF via CDP endpoint redirection. Do not expose the PortOS server to untrusted networks.
+
## Configuration
Stored in `data/browser-config.json`:
diff --git a/server/routes/browser.js b/server/routes/browser.js
index 424f92f012..5d0b0987f1 100644
--- a/server/routes/browser.js
+++ b/server/routes/browser.js
@@ -7,7 +7,7 @@ const router = express.Router();
// Validation schemas
const updateConfigSchema = z.object({
cdpPort: z.number().int().min(1024).max(65535).optional(),
- cdpHost: z.string().optional(),
+ cdpHost: z.enum(['127.0.0.1', 'localhost', '::1']).optional(),
healthPort: z.number().int().min(1024).max(65535).optional(),
autoConnect: z.boolean().optional(),
headless: z.boolean().optional(),