Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test: add security validation test cases to manual test plans

Mario85ab0afb7073
diff --git a/tests/manual/core.md b/tests/manual/core.md
index 581708c2..f70be018 100644
--- a/tests/manual/core.md
+++ b/tests/manual/core.md
@@ -179,6 +179,18 @@ Navigate to the test page first: `POST /navigate {"url":"file://<repo>/tests/ass
| CF4 | Custom profile dir | `BRIDGE_PROFILE=/tmp/test-profile ./pinchtab` | Uses specified profile |
| CF5 | No restore | `BRIDGE_NO_RESTORE=true ./pinchtab` | Doesn't restore previous tabs |
+### 1.16 Security & Validation
+
+| # | Scenario | Steps | Expected |
+|---|----------|-------|----------|
+| SEC1 | Profile name with ".." | `POST /profiles {"name":"../../../etc/passwd"}` | 400, invalid profile name |
+| SEC2 | Profile name with "/" | `POST /profiles {"name":"test/profile"}` | 400, path separators not allowed |
+| SEC3 | Profile name with "\" | `POST /profiles {"name":"test\\profile"}` | 400, path separators not allowed |
+| SEC4 | Profile name empty | `POST /profiles {"name":""}` | 400, name required |
+| SEC5 | Valid profile names | `POST /profiles {"name":"valid-profile"}` | 201, profile created |
+| SEC6 | SSRF prevention | Proxy to non-localhost (e.g., example.com via /instances/{id}/navigate) | 400, localhost required or fails safely |
+| SEC7 | Proxy safe URL | Proxy normal navigate via /instances/{id}/navigate | 200, works as expected |
+
### 1.14 CLI Subcommands
| # | Scenario | Steps | Expected |
diff --git a/tests/manual/dashboard.md b/tests/manual/dashboard.md
index 4e11c741..e55cc100 100644
--- a/tests/manual/dashboard.md
+++ b/tests/manual/dashboard.md
@@ -204,6 +204,57 @@ Verify every registered route returns a non-404 status (may return 400/503 for m
---
+## 10. Security: Validation Tests
+
+### DSE1: Profile Name Validation
+
+**Goal:** Verify invalid profile names are rejected by the API.
+
+**Steps:**
+1. Start dashboard
+2. Try to create profile with ".." in name:
+ ```bash
+ curl -X POST http://localhost:9867/profiles \
+ -H "Content-Type: application/json" \
+ -d '{"name":"../test"}'
+ ```
+ Should get **400 Bad Request** (invalid profile name)
+
+3. Try with "/" separator:
+ ```bash
+ curl -X POST http://localhost:9867/profiles \
+ -H "Content-Type: application/json" \
+ -d '{"name":"test/profile"}'
+ ```
+ Should get **400 Bad Request**
+
+4. Try with empty name:
+ ```bash
+ curl -X POST http://localhost:9867/profiles \
+ -H "Content-Type: application/json" \
+ -d '{"name":""}'
+ ```
+ Should get **400 Bad Request**
+
+5. Create valid profile (control):
+ ```bash
+ curl -X POST http://localhost:9867/profiles \
+ -H "Content-Type: application/json" \
+ -d '{"name":"__test_security__"}'
+ ```
+ Should get **201 Created**
+
+6. Clean up:
+ ```bash
+ curl -X DELETE http://localhost:9867/profiles/__test_security__
+ ```
+
+**Expected:** Invalid names rejected with 400, valid names accepted with 201.
+
+**Criteria:** ✓ ".." rejected | ✓ "/" rejected | ✓ "" rejected | ✓ Valid names work
+
+---
+
## Release Criteria
### Must Pass
diff --git a/tests/manual/orchestrator.md b/tests/manual/orchestrator.md
index 095ec590..71744a5e 100644
--- a/tests/manual/orchestrator.md
+++ b/tests/manual/orchestrator.md
@@ -93,7 +93,7 @@
```bash
# Get instance PID (starts pinchtab as subprocess on port 9868, etc.)
PID=$(lsof -i :9868 | grep pinchtab | awk '{print $2}')
-
+
# Monitor RSS (resident set size) every 2 seconds
while true; do
ps -p $PID -o pid,rss,vsz,comm
@@ -242,20 +242,20 @@
1. Create instance and time how long until Chrome is ready:
```bash
START=$(date +%s%N)
-
+
INST=$(curl -s -X POST http://localhost:9867/instances/launch \
-H "Content-Type: application/json" \
-d '{"name":"lazy-test","headless":true}')
-
+
ID=$(echo $INST | jq -r '.id')
-
+
# Poll health until OK
while true; do
STATUS=$(curl -s http://localhost:9867/instances/$ID/health 2>/dev/null | jq -r '.status')
if [ "$STATUS" = "ok" ]; then break; fi
sleep 0.1
done
-
+
END=$(date +%s%N)
ELAPSED=$(( (END - START) / 1000000 ))
echo "Chrome ready in ${ELAPSED}ms"
@@ -478,7 +478,7 @@
ID=$(curl -s -X POST http://localhost:9867/instances/launch \
-H "Content-Type: application/json" \
-d '{"name":"snap-test","headless":true}' | jq -r '.id')
-
+
curl -X POST http://localhost:9867/instances/$ID/navigate \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}' > /dev/null
@@ -522,6 +522,84 @@
---
+## 10. Security: Path Traversal & SSRF Prevention
+
+### MSE1: Profile Name Path Traversal Blocked
+
+**Goal:** Verify that profile names with "..", "/", or "\" are rejected.
+
+**Steps:**
+1. Start dashboard
+2. Try to create a profile with traversal pattern:
+ ```bash
+ curl -X POST http://localhost:9867/instances/launch \
+ -H "Content-Type: application/json" \
+ -d '{"name":"../../../etc/passwd","headless":true}'
+ ```
+ Should get **400 Bad Request** (invalid profile name)
+
+3. Try with "/" separator:
+ ```bash
+ curl -X POST http://localhost:9867/instances/launch \
+ -H "Content-Type: application/json" \
+ -d '{"name":"test/malicious","headless":true}'
+ ```
+ Should get **400 Bad Request**
+
+4. Try with empty name:
+ ```bash
+ curl -X POST http://localhost:9867/instances/launch \
+ -H "Content-Type: application/json" \
+ -d '{"name":"","headless":true}'
+ ```
+ Should get **400 Bad Request**
+
+5. Create valid profile (control):
+ ```bash
+ curl -X POST http://localhost:9867/instances/launch \
+ -H "Content-Type: application/json" \
+ -d '{"name":"valid-profile","headless":true}'
+ ```
+ Should get **201 Created**
+
+**Expected:** Malicious names rejected with 400, valid names accepted with 201.
+
+**Criteria:** ✓ ".." rejected | ✓ "/" rejected | ✓ "\" rejected | ✓ "" rejected | ✓ valid names accepted
+
+---
+
+### MSE2: SSRF Prevention — Proxy Localhost Only
+
+**Goal:** Verify that proxy endpoints only target localhost.
+
+**Steps:**
+1. Create an instance:
+ ```bash
+ curl -X POST http://localhost:9867/instances/launch \
+ -H "Content-Type: application/json" \
+ -d '{"name":"ssrf-test","headless":true}'
+ ```
+ Note the `id` and `port`.
+
+2. Navigate via proxy (should work):
+ ```bash
+ curl -X POST http://localhost:9867/instances/{id}/navigate \
+ -H "Content-Type: application/json" \
+ -d '{"url":"https://example.com"}'
+ ```
+ Should get **200 OK** (proxy routes to localhost instance)
+
+3. Stop instance:
+ ```bash
+ curl -X POST http://localhost:9867/instances/{id}/stop
+ ```
+
+**Expected:** Proxy routes to localhost instance without error.
+
+**Criteria:** ✓ Proxy navigates successfully | ✓ URL constructed safely
+
+---
+
## Notes
- Tests should run on the same machine as the dashboard (needed for window verification and process monitoring).