Commit 1aaff83
test: add E2E security tests for origin validation
Adds comprehensive E2E tests to verify security infrastructure:
1. Sandbox Security
- Verifies valid messages are not rejected (asserts on rejection logs)
- Verifies host does not log unknown source warnings
- Tests app-to-host message reception
- Checks iframe sandbox attributes on both outer and inner iframes
2. Host Resilience
- Tests host UI loads with servers
- Verifies server count display
3. Origin Validation Infrastructure
- Tests CSP logging is active
- Verifies round-trip app communication
- Checks iframe isolation via sandbox attributes
4. Security Self-Test
- Verifies sandbox security self-test passes (window.top inaccessible)
- Confirms referrer validation allows localhost
Note: True cross-origin attack testing would require a multi-origin
test setup. These tests verify the security infrastructure is in place
and functioning correctly for valid communication paths.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 92a5376 commit 1aaff83
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
0 commit comments