@weavetab/mcp 2.5.0-beta.5 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/AGENTS.md +49 -49
  2. package/ARCHITECTURE.md +590 -590
  3. package/README.md +216 -100
  4. package/SECURITY.md +207 -207
  5. package/TROUBLESHOOTING.md +373 -365
  6. package/dist/anticaptcha/detector.js +395 -395
  7. package/dist/anticaptcha/solver.js +130 -130
  8. package/dist/cdp/bridge.js +73 -73
  9. package/dist/cdp/connector.js +46 -22
  10. package/dist/cdp/extension.js +34 -34
  11. package/dist/cdp/helpers.js +174 -174
  12. package/dist/cdp/pruner.js +195 -195
  13. package/dist/cdp/ref_cache.js +66 -66
  14. package/dist/cdp/security.js +10 -10
  15. package/dist/cdp/verify.js +57 -57
  16. package/dist/cdp/walker.js +563 -525
  17. package/dist/cli/plugin.js +26 -3
  18. package/dist/config/loader.d.ts +0 -3
  19. package/dist/config/loader.js +0 -9
  20. package/dist/index.js +0 -4
  21. package/dist/intelligence/intent.js +81 -81
  22. package/dist/intelligence/sessionMemory.js +2 -2
  23. package/dist/overlay/ghost.js +22 -22
  24. package/dist/overlay/injector.js +89 -89
  25. package/dist/plugin/extension_bridge.js +54 -54
  26. package/dist/plugin/interface.d.ts +7 -0
  27. package/dist/plugin/loader.js +3 -4
  28. package/dist/plugin/schema.d.ts +11 -0
  29. package/dist/plugin/schema.js +59 -0
  30. package/dist/security/guard.js +18 -18
  31. package/dist/sensors/actionability.js +167 -167
  32. package/dist/sensors/guard.js +29 -29
  33. package/dist/sensors/network.js +15 -17
  34. package/dist/server.d.ts +1 -1
  35. package/dist/server.js +173 -144
  36. package/dist/state/delta.js +6 -7
  37. package/dist/tools/automation.js +85 -85
  38. package/dist/tools/canvas.js +48 -25
  39. package/dist/tools/checkpoint.js +94 -35
  40. package/dist/tools/click.js +52 -41
  41. package/dist/tools/clipboard.js +80 -74
  42. package/dist/tools/design_extract.js +441 -441
  43. package/dist/tools/dialog.js +13 -13
  44. package/dist/tools/emulation.d.ts +2 -0
  45. package/dist/tools/emulation.js +7 -0
  46. package/dist/tools/fill.js +344 -347
  47. package/dist/tools/find.js +78 -52
  48. package/dist/tools/highlight.js +67 -67
  49. package/dist/tools/inspect.js +54 -25
  50. package/dist/tools/key.js +42 -35
  51. package/dist/tools/navigate.d.ts +1 -1
  52. package/dist/tools/navigate.js +35 -35
  53. package/dist/tools/office/parse.js +62 -18
  54. package/dist/tools/pdf.d.ts +9 -0
  55. package/dist/tools/pdf.js +7 -4
  56. package/dist/tools/performance.d.ts +11 -4
  57. package/dist/tools/performance.js +94 -42
  58. package/dist/tools/performance_test.d.ts +2 -2
  59. package/dist/tools/performance_test.js +69 -69
  60. package/dist/tools/pointer.js +116 -116
  61. package/dist/tools/read.js +99 -67
  62. package/dist/tools/recording.js +9 -0
  63. package/dist/tools/scrape.js +146 -146
  64. package/dist/tools/screenshot.d.ts +2 -0
  65. package/dist/tools/screenshot.js +46 -4
  66. package/dist/tools/scroll.d.ts +3 -1
  67. package/dist/tools/scroll.js +13 -15
  68. package/dist/tools/select.d.ts +3 -0
  69. package/dist/tools/select.js +131 -124
  70. package/dist/tools/snapshot.js +8 -6
  71. package/dist/tools/storage.d.ts +5 -1
  72. package/dist/tools/storage.js +16 -0
  73. package/dist/tools/tabs.d.ts +7 -5
  74. package/dist/tools/tabs.js +79 -26
  75. package/dist/tools/thought.js +8 -8
  76. package/dist/tools/type.js +274 -274
  77. package/dist/tools/type_secret.js +23 -23
  78. package/dist/tools/upload.js +3 -3
  79. package/dist/tools/video_compiler.js +9 -0
  80. package/dist/tools/wait.js +35 -35
  81. package/dist/version.d.ts +1 -1
  82. package/dist/version.js +1 -1
  83. package/docs/DOCUMENTATION.md +583 -585
  84. package/docs/PLUGINS.md +139 -121
  85. package/docs/TOOLS.md +3 -4
  86. package/docs/architecture/blind-injection.md +83 -83
  87. package/docs/architecture/overview.md +49 -49
  88. package/docs/configuration/configuration.md +39 -27
  89. package/docs/configuration/folders.md +62 -55
  90. package/docs/desktop-automation/electron-apps.md +225 -214
  91. package/docs/get-started/installation.md +1 -1
  92. package/docs/get-started/introduction.md +60 -60
  93. package/docs/get-started/quickstart.md +2 -2
  94. package/docs/get-started/setup-wizard.md +1 -1
  95. package/docs/intelligence/site-profiles.md +151 -151
  96. package/docs/tools/tools.md +582 -631
  97. package/docs/troubleshooting/trouble-loop.md +31 -31
  98. package/ext-dist/background.js +415 -415
  99. package/ext-dist/content.js +2527 -2527
  100. package/ext-dist/dashboard.html +583 -583
  101. package/ext-dist/hud/hud.js +3 -3
  102. package/ext-dist/hud/index.html +20 -20
  103. package/ext-dist/manifest.json +73 -73
  104. package/ext-dist/styles.css +223 -223
  105. package/mcp.json +796 -805
  106. package/package.json +8 -8
  107. package/server.json +23 -23
  108. package/smithery.yaml +7 -11
  109. package/dist/cdp/walker.test.d.ts +0 -2
  110. package/dist/cdp/walker.test.js +0 -172
  111. package/dist/intelligence/sessionMemory.test.d.ts +0 -2
  112. package/dist/intelligence/sessionMemory.test.js +0 -62
  113. package/dist/intelligence/trail.test.d.ts +0 -2
  114. package/dist/intelligence/trail.test.js +0 -110
  115. package/dist/state/cache.test.d.ts +0 -2
  116. package/dist/state/cache.test.js +0 -76
  117. package/dist/state/delta.test.d.ts +0 -2
  118. package/dist/state/delta.test.js +0 -279
  119. package/dist/state/groups.d.ts +0 -15
  120. package/dist/state/groups.js +0 -80
  121. package/dist/tools/accessibility.d.ts +0 -14
  122. package/dist/tools/accessibility.js +0 -32
  123. package/dist/tools/ask.d.ts +0 -14
  124. package/dist/tools/ask.js +0 -49
  125. package/dist/tools/click_and_wait.d.ts +0 -33
  126. package/dist/tools/click_and_wait.js +0 -149
  127. package/dist/tools/drag.d.ts +0 -15
  128. package/dist/tools/drag.js +0 -29
  129. package/dist/tools/geo.d.ts +0 -19
  130. package/dist/tools/geo.js +0 -29
  131. package/dist/tools/github/analyze.d.ts +0 -4
  132. package/dist/tools/github/analyze.js +0 -113
  133. package/dist/tools/github/cache.d.ts +0 -21
  134. package/dist/tools/github/cache.js +0 -28
  135. package/dist/tools/github/index.d.ts +0 -19
  136. package/dist/tools/github/index.js +0 -40
  137. package/dist/tools/github/issues.d.ts +0 -9
  138. package/dist/tools/github/issues.js +0 -88
  139. package/dist/tools/github/pr.d.ts +0 -5
  140. package/dist/tools/github/pr.js +0 -88
  141. package/dist/tools/github/rateLimiter.d.ts +0 -4
  142. package/dist/tools/github/rateLimiter.js +0 -46
  143. package/dist/tools/github/read.d.ts +0 -34
  144. package/dist/tools/github/read.js +0 -74
  145. package/dist/tools/github/repoContext.d.ts +0 -20
  146. package/dist/tools/github/repoContext.js +0 -129
  147. package/dist/tools/hover.d.ts +0 -19
  148. package/dist/tools/hover.js +0 -57
  149. package/dist/tools/integration.test.d.ts +0 -2
  150. package/dist/tools/integration.test.js +0 -96
  151. package/dist/tools/macro_compiler.d.ts +0 -7
  152. package/dist/tools/macro_compiler.js +0 -82
  153. package/dist/tools/mouse.d.ts +0 -21
  154. package/dist/tools/mouse.js +0 -62
  155. package/dist/tools/response.d.ts +0 -129
  156. package/dist/tools/response.js +0 -5
  157. package/dist/tools/wait_for.d.ts +0 -23
  158. package/dist/tools/wait_for.js +0 -30
  159. package/dist/tools/windows.d.ts +0 -22
  160. package/dist/tools/windows.js +0 -57
package/SECURITY.md CHANGED
@@ -1,207 +1,207 @@
1
- # Weavetab MCP Security Policy
2
-
3
- > **Version:** 2.5.0 (Beta) | **Package:** `@weavetab/mcp` | **Last Updated:** August 2026
4
-
5
- ---
6
-
7
- ## Supported Versions
8
-
9
- Only the latest major release of Weavetab receives security updates. Users are strongly advised to keep their installation current.
10
-
11
- | Version | Supported | Security Updates |
12
- |---------|-----------|------------------|
13
- | 2.x.x | Yes | Yes |
14
- | < 2.0 | No | No |
15
-
16
- ---
17
-
18
- ## Architecture Context
19
-
20
- Weavetab interacts directly with the local Chromium browser instance via the Chrome DevTools Protocol (CDP). Because it can control the browser at the operating system level, Weavetab operates at a highly privileged layer (Layer 0).
21
-
22
- ### Security Mechanisms
23
-
24
- | Mechanism | Description | Implementation |
25
- |-----------|-------------|----------------|
26
- | **Domain Blacklist** | High-risk domains (banking portals, IAM providers, cloud infrastructure consoles) are hard-blocked from navigation and interaction | Hardcoded entries + user-configurable `block`/`allow` lists in `~/.Weavetab/policy.json` |
27
- | **Domain Policy Engine** | Per-domain modes: `allow`, `read-only`, `deny`, `audit` | Policies defined as `{ pattern, mode }` entries; read-only mode blocks mutation tools |
28
- | **Localhost Binding** | The CDP WebSocket endpoint is strictly bound to `127.0.0.1` | No external network interfaces are exposed |
29
- | **Zero Cloud Dependency** | Weavetab executes entirely on the local machine | No telemetry, analytics, or user data transmitted unless `telemetry: true` is configured |
30
- | **Rate Limiting** | Configurable actions-per-minute threshold | Mutex-based enforcement prevents runaway agent behavior |
31
- | **Role-Based Access Control** | Four roles restrict tool access | `admin`, `operator`, `viewer`, `automation` with permission matrices |
32
- | **Root Guard** | Prevents execution as root or superuser at startup | `assertNotRoot()` check on Unix systems |
33
- | **Shadow DOM UI Isolation** | All injected interfaces run in isolated contexts | Prevents host page script tampering |
34
- | **Blind Injection** | Secrets injected via `browser_type_secret` are masked to `[REDACTED]` in all subsequent DOM reads and audit logs | Domain scoping, Shadow DOM isolation, JS property hardening |
35
- | **Secrets Management** | Resolves secrets from project-scoped or global `secrets.json` | `JsonSecretStore` with atomic file writes and `chmod 600` enforcement |
36
- | **Storage Blocker** | Optional nullification of `localStorage`, `sessionStorage`, and `document.cookie` | Prevents tracking and fingerprinting |
37
- | **Input Filter** | Strips elements with suspicious labels from DOM snapshots | Removes excessive length, invisible Unicode characters, prompt injection patterns |
38
- | **Two-Factor Lock Validation** | Browser process lock validated by PID liveness + TCP port connectivity | Prevents stale lock false-positives after crashes |
39
- | **Atomic Config Writes** | Config files written to temp file then renamed atomically | Prevents partial reads from concurrent processes |
40
- | **Path Traversal Protection** | `downloadDir` and `profileDir` paths validated to reject `..` traversal | Prevents directory escape attacks |
41
- | **Proxy Credential Detection** | Proxy URLs with embedded credentials rejected with warning | Users must use environment variables instead |
42
-
43
- ---
44
-
45
- ## Blind Injection Threat Model & Hardening
46
-
47
- The **Blind Injection** architecture specifically ensures that credentials do not leak back into the LLM context, Weavetab logs, DOM snapshots, visual captures, or scrape results.
48
-
49
- ### Threats Mitigated
50
-
51
- - **Accidental Context Inclusion** — LLM reading the DOM, AX tree, or input discovery and echoing passwords
52
- - **DOM & Scrape Scraping** — Passwords extracted via direct DOM access, `browser_scrape`, or `document.querySelector().value`
53
- - **Visual Capture Leaks** — Passwords visible in screenshots, MHTML snapshots, or PDF printouts
54
- - **Log Scraping** — Passwords appearing in plaintext action logs or audit records
55
- - **DOM Snapshot Leakage** — Secret values masked as `[REDACTED]` in all subsequent maps, deltas, and AX tree dumps
56
- - **Prompt Injection Domain Theft** — Domain check runs before the secret value is ever resolved from disk
57
- - **Coercion & Serialization Leaks** — `JSON.stringify(el)`, `String(el)`, or array spreads leaking underlying element values
58
-
59
- ### Defense-in-Depth Implementation
60
-
61
- 1. **Storage at Rest**: Secrets in `~/.weavetab/secrets.json` are encrypted using AES-256-GCM with a machine-isolated key in `~/.weavetab-system/secrets-key`.
62
- 2. **In-Process Resolution**: The AI model only receives and passes the key name (`envKey: "MY_KEY"`). The secret value is resolved in memory and injected directly via CDP `Input.insertText`.
63
- 3. **DOM Property Hardening**: Injected elements are tagged `data-wt-secret="true"`, instance `.value` getters are overridden with `[REDACTED]`, and `Symbol.iterator`, `Symbol.toPrimitive`, and `toJSON` are locked.
64
- 4. **In-Memory SessionSecretTracker**: Tracks node IDs and secret substrings per session to redact any coincidental echoes across ActionMaps, delta diffs, or scrape outputs.
65
- 5. **Universal Tool Containment**:
66
- - `browser_type`: Broad secret regex (`type`, `name`, `id`, `autocomplete`, `aria-label`, PINs, tokens, multi-language variants) auto-hardens target fields and suppresses raw value readbacks.
67
- - `browser_fill`: Registers secrets in both single and `blast_mode`, redacting return values and scan discovery mode (`scan: true`).
68
- - `browser_scrape`: Evaluates in-page extraction substituting all attributes of sensitive nodes with `[REDACTED]`.
69
- - `browser_screenshot`, `browser_snapshot`, `browser_pdf`: Dynamically blanks/masks sensitive fields during capture and restores them in `finally` blocks.
70
-
71
- ### Threats NOT Mitigated
72
-
73
- - This does **not** protect against a compromised host or a malicious OS process with elevated privileges reading the secrets file directly.
74
- - It is not "zero-knowledge"; Weavetab must read and decrypt the secret from `secrets.json` to inject it into Chromium.
75
-
76
- ### Secrets Resolution Order
77
-
78
- When `browser_type_secret({ envKey: 'MY_SECRET' })` is called, the `JsonSecretStore` resolves from:
79
-
80
- 1. `./.weavetab/secrets.json` (project-scoped, opt-in via `weavetab secrets init --project`)
81
- 2. `~/.weavetab/secrets.json` (global default)
82
-
83
- The old `EnvSecretProvider` (`.env`-based) is **deprecated and no longer supported**. All secrets must be stored in `secrets.json`. See the [README Secrets Management section](README.md#-secrets-management) for the full CLI workflow.
84
-
85
- ### Secrets File Format
86
-
87
- ```json
88
- {
89
- "ACME_CORP_PASSWORD": {
90
- "value": "encrypted_aes_gcm_string",
91
- "domains": ["login.example.com"],
92
- "createdAt": "2026-08-29T10:00:00.000Z",
93
- "updatedAt": "2026-08-29T10:00:00.000Z"
94
- }
95
- }
96
- ```
97
-
98
- ---
99
-
100
- ## RBAC Role Matrix
101
-
102
- | Tool Category | admin | viewer | system |
103
- |---------------|-------|--------|--------|
104
- | All mutation tools | ✅ | ❌ | ❌ |
105
- | Read-only (map, find, scrape, console, eval, inspect, snapshot, screenshot, pdf, cookies, tabs, wait, browser_github) | ✅ | ✅ | ❌ |
106
- | burst, plan, wait, map | ✅ | ❌ | ✅ |
107
- | System (logs, detect, performance) | ✅ | ❌ | ❌ |
108
-
109
- ### Role Definitions
110
-
111
- - **admin** — Full access to all tools and system operations
112
- - **viewer** — Read-only access to observation tools only
113
- - **system** — Restricted to burst/plan/wait/map for automated workflows
114
-
115
- ---
116
-
117
- ## Security Architecture Flow
118
-
119
- ```mermaid
120
- flowchart TD
121
- Inv[Tool Invocation] --> Rate[Rate Limiter]
122
- Rate --> Dom[Domain Policy Check]
123
- Dom --> RBAC[RBAC Role Check]
124
- RBAC --> Custom[Custom Black List?]
125
- Custom -- Match --> Block1[Block: SecurityError]
126
- Custom -- No Match --> Hard[Hardcoded Blacklist]
127
- Hard -- Match --> Block2[Block: SecurityError]
128
- Hard -- No Match --> Stop[User Stop Check]
129
- Stop --> CDP[CDP Execution]
130
- CDP --> Audit[Audit Log]
131
- Audit --> Secret[Secret Tool?]
132
- Secret -- Yes --> Tracker[SessionSecret Tracker<br/>Marks node as secret]
133
- Tracker --> Ret[Return Result]
134
- Secret -- No --> Ret
135
- ```
136
-
137
- ---
138
-
139
- ## Reporting a Vulnerability
140
-
141
- If you discover a security vulnerability in Weavetab, please **do not** open a public GitHub issue.
142
-
143
- Instead, report via one of the following channels:
144
-
145
- - **Email**: security@weavetab.dev
146
- - **GitHub**: Use the private vulnerability reporting feature on the repository
147
-
148
- ### Disclosure Timeline
149
-
150
- 1. **48 hours** — Acknowledgment of receipt
151
- 2. **7 days** — Initial assessment and severity classification
152
- 3. **30 days** — Fix deployed (critical) or mitigation plan communicated (moderate)
153
-
154
- We strive to provide regular updates on progress throughout the process. If a fix is required, an emergency patch will be published to the NPM registry.
155
-
156
- ### Severity Classification
157
-
158
- | Severity | Definition | Response Time |
159
- |----------|------------|---------------|
160
- | **Critical** | Allows unauthorized system access or credential theft | 48 hours |
161
- | **High** | Allows data exfiltration or privilege escalation | 7 days |
162
- | **Medium** | Limited impact, requires user interaction | 30 days |
163
- | **Low** | Minor security issue with minimal impact | Next release |
164
-
165
- ---
166
-
167
-
168
-
169
- ## Security Best Practices
170
-
171
- ### For Users
172
-
173
- 1. **Keep Weavetab Updated** — Always use the latest version to ensure security patches
174
- 2. **Use RBAC** — Restrict tool access using appropriate roles (`admin`, `viewer`, `system`)
175
- 3. **Configure Domain Policies** — Block high-risk domains
176
- 4. **Use Blind Injection** — Never pass passwords or 2FA codes directly to `browser_type`; use `browser_type_secret`
177
-
178
- ### For Developers
179
-
180
- 1. **Test Security Features** — Verify domain policies, RBAC, and rate limiting in tests
181
- 2. **Use Least Privilege** - Tools should request only the permissions they need
182
-
183
- ---
184
-
185
- ## Security Notifications
186
-
187
- To receive security notifications:
188
-
189
- - **Watch the GitHub Repository** — Enable releases and security alerts
190
- - **Subscribe to Security Advisories** — Monitor GitHub Security Advisories for the repository
191
- - **Review CHANGELOG.md** — Check security updates in release notes
192
-
193
- ---
194
-
195
- ## Contact Information
196
-
197
- For security-related inquiries:
198
-
199
- - **Security Vulnerabilities**: security@weavetab.dev
200
- - **Security Questions**: conduct@weavetab.dev
201
- - **GitHub Security**: https://github.com/weavetab/mcp/security
202
-
203
- ---
204
-
205
- ## License
206
-
207
- Weavetab is licensed under AGPL-3.0. Security vulnerabilities should be reported responsibly as outlined in this document. Public disclosure of vulnerabilities before coordination with the maintainers is not permitted.
1
+ # Weavetab MCP Security Policy
2
+
3
+ > **Version:** 2.5.1 | **Package:** `@weavetab/mcp` | **Last Updated:** August 2026
4
+
5
+ ---
6
+
7
+ ## Supported Versions
8
+
9
+ Only the latest major release of Weavetab receives security updates. Users are strongly advised to keep their installation current.
10
+
11
+ | Version | Supported | Security Updates |
12
+ |---------|-----------|------------------|
13
+ | 2.x.x | Yes | Yes |
14
+ | < 2.0 | No | No |
15
+
16
+ ---
17
+
18
+ ## Architecture Context
19
+
20
+ Weavetab interacts directly with the local Chromium browser instance via the Chrome DevTools Protocol (CDP). Because it can control the browser at the operating system level, Weavetab operates at a highly privileged layer (Layer 0).
21
+
22
+ ### Security Mechanisms
23
+
24
+ | Mechanism | Description | Implementation |
25
+ |-----------|-------------|----------------|
26
+ | **Domain Blacklist** | High-risk domains (banking portals, IAM providers, cloud infrastructure consoles) are hard-blocked from navigation and interaction | Hardcoded entries + user-configurable `block`/`allow` lists in `~/.weavetab/config.json` |
27
+ | **Domain Policy Engine** | Per-domain modes: `allow`, `read-only`, `deny`, `audit` | Policies defined as `{ pattern, mode }` entries; read-only mode blocks mutation tools |
28
+ | **Localhost Binding** | The CDP WebSocket endpoint is strictly bound to `127.0.0.1` | No external network interfaces are exposed |
29
+ | **Zero Cloud Dependency** | Weavetab executes entirely on the local machine | No telemetry, analytics, or user data transmitted unless `telemetry: true` is configured |
30
+ | **Rate Limiting** | Configurable actions-per-minute threshold | Mutex-based enforcement prevents runaway agent behavior |
31
+ | **Role-Based Access Control** | Five roles restrict tool access | `admin`, `operator`, `viewer`, `automation`, `system` with permission matrices |
32
+ | **Root Guard** | Prevents execution as root or superuser at startup | `assertNotRoot()` check on Unix systems |
33
+ | **Shadow DOM UI Isolation** | All injected interfaces run in isolated contexts | Prevents host page script tampering |
34
+ | **Blind Injection** | Secrets injected via `browser_type_secret` are masked to `[REDACTED]` in all subsequent DOM reads and audit logs | Domain scoping, Shadow DOM isolation, JS property hardening |
35
+ | **Secrets Management** | Resolves secrets from project-scoped or global `secrets.json` | `JsonSecretStore` with atomic file writes and `chmod 600` enforcement |
36
+ | **Storage Blocker** | Optional nullification of `localStorage`, `sessionStorage`, and `document.cookie` | Prevents tracking and fingerprinting |
37
+ | **Input Filter** | Strips elements with suspicious labels from DOM snapshots | Removes excessive length, invisible Unicode characters, prompt injection patterns |
38
+ | **Two-Factor Lock Validation** | Browser process lock validated by PID liveness + TCP port connectivity | Prevents stale lock false-positives after crashes |
39
+ | **Atomic Config Writes** | Config files written to temp file then renamed atomically | Prevents partial reads from concurrent processes |
40
+ | **Path Traversal Protection** | `downloadDir` and `profileDir` paths validated to reject `..` traversal | Prevents directory escape attacks |
41
+ | **Proxy Credential Detection** | Proxy URLs with embedded credentials rejected with warning | Users must use environment variables instead |
42
+
43
+ ---
44
+
45
+ ## Blind Injection Threat Model & Hardening
46
+
47
+ The **Blind Injection** architecture specifically ensures that credentials do not leak back into the LLM context, Weavetab logs, DOM snapshots, visual captures, or scrape results.
48
+
49
+ ### Threats Mitigated
50
+
51
+ - **Accidental Context Inclusion** — LLM reading the DOM, AX tree, or input discovery and echoing passwords
52
+ - **DOM & Scrape Scraping** — Passwords extracted via direct DOM access, `browser_scrape`, or `document.querySelector().value`
53
+ - **Visual Capture Leaks** — Passwords visible in screenshots, MHTML snapshots, or PDF printouts
54
+ - **Log Scraping** — Passwords appearing in plaintext action logs or audit records
55
+ - **DOM Snapshot Leakage** — Secret values masked as `[REDACTED]` in all subsequent maps, deltas, and AX tree dumps
56
+ - **Prompt Injection Domain Theft** — Domain check runs before the secret value is ever resolved from disk
57
+ - **Coercion & Serialization Leaks** — `JSON.stringify(el)`, `String(el)`, or array spreads leaking underlying element values
58
+
59
+ ### Defense-in-Depth Implementation
60
+
61
+ 1. **Storage at Rest**: Secrets in `~/.weavetab/secrets.json` are encrypted using AES-256-GCM with a machine-isolated key in `~/.weavetab-system/secrets-key`.
62
+ 2. **In-Process Resolution**: The AI model only receives and passes the key name (`envKey: "MY_KEY"`). The secret value is resolved in memory and injected directly via CDP `Input.insertText`.
63
+ 3. **DOM Property Hardening**: Injected elements are tagged `data-wt-secret="true"`, instance `.value` getters are overridden with `[REDACTED]`, and `Symbol.iterator`, `Symbol.toPrimitive`, and `toJSON` are locked.
64
+ 4. **In-Memory SessionSecretTracker**: Tracks node IDs and secret substrings per session to redact any coincidental echoes across ActionMaps, delta diffs, or scrape outputs.
65
+ 5. **Universal Tool Containment**:
66
+ - `browser_type`: Broad secret regex (`type`, `name`, `id`, `autocomplete`, `aria-label`, PINs, tokens, multi-language variants) auto-hardens target fields and suppresses raw value readbacks.
67
+ - `browser_fill`: Registers secrets in both single and `blast_mode`, redacting return values and scan discovery mode (`scan: true`).
68
+ - `browser_scrape`: Evaluates in-page extraction substituting all attributes of sensitive nodes with `[REDACTED]`.
69
+ - `browser_screenshot`, `browser_snapshot`, `browser_pdf`: Dynamically blanks/masks sensitive fields during capture and restores them in `finally` blocks.
70
+
71
+ ### Threats NOT Mitigated
72
+
73
+ - This does **not** protect against a compromised host or a malicious OS process with elevated privileges reading the secrets file directly.
74
+ - It is not "zero-knowledge"; Weavetab must read and decrypt the secret from `secrets.json` to inject it into Chromium.
75
+
76
+ ### Secrets Resolution Order
77
+
78
+ When `browser_type_secret({ envKey: 'MY_SECRET' })` is called, the `JsonSecretStore` resolves from:
79
+
80
+ 1. `./.weavetab/secrets.json` (project-scoped, opt-in via `weavetab secrets init --project`)
81
+ 2. `~/.weavetab/secrets.json` (global default)
82
+
83
+ The old `EnvSecretProvider` (`.env`-based) is **deprecated and no longer supported**. All secrets must be stored in `secrets.json`. See the [README Secrets Management section](README.md#-secrets-management) for the full CLI workflow.
84
+
85
+ ### Secrets File Format
86
+
87
+ ```json
88
+ {
89
+ "ACME_CORP_PASSWORD": {
90
+ "value": "encrypted_aes_gcm_string",
91
+ "domains": ["login.example.com"],
92
+ "createdAt": "2026-08-29T10:00:00.000Z",
93
+ "updatedAt": "2026-08-29T10:00:00.000Z"
94
+ }
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ## RBAC Role Matrix
101
+
102
+ | Tool Category | admin | viewer | system |
103
+ |---------------|-------|--------|--------|
104
+ | All mutation tools | ✅ | ❌ | ❌ |
105
+ | Read-only (map, find, scrape, console, eval, inspect, snapshot, screenshot, pdf, cookies, tabs, wait) | ✅ | ✅ | ❌ |
106
+ | burst, plan, wait, map | ✅ | ❌ | ✅ |
107
+ | System (logs, detect, performance) | ✅ | ❌ | ❌ |
108
+
109
+ ### Role Definitions
110
+
111
+ - **admin** — Full access to all tools and system operations
112
+ - **viewer** — Read-only access to observation tools only
113
+ - **system** — Restricted to burst/plan/wait/map for automated workflows
114
+
115
+ ---
116
+
117
+ ## Security Architecture Flow
118
+
119
+ ```mermaid
120
+ flowchart TD
121
+ Inv[Tool Invocation] --> Rate[Rate Limiter]
122
+ Rate --> Dom[Domain Policy Check]
123
+ Dom --> RBAC[RBAC Role Check]
124
+ RBAC --> Custom[Custom Black List?]
125
+ Custom -- Match --> Block1[Block: SecurityError]
126
+ Custom -- No Match --> Hard[Hardcoded Blacklist]
127
+ Hard -- Match --> Block2[Block: SecurityError]
128
+ Hard -- No Match --> Stop[User Stop Check]
129
+ Stop --> CDP[CDP Execution]
130
+ CDP --> Audit[Audit Log]
131
+ Audit --> Secret[Secret Tool?]
132
+ Secret -- Yes --> Tracker[SessionSecret Tracker<br/>Marks node as secret]
133
+ Tracker --> Ret[Return Result]
134
+ Secret -- No --> Ret
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Reporting a Vulnerability
140
+
141
+ If you discover a security vulnerability in Weavetab, please **do not** open a public GitHub issue.
142
+
143
+ Instead, report via one of the following channels:
144
+
145
+ - **Email**: security@weavetab.dev
146
+ - **GitHub**: Use the private vulnerability reporting feature on the repository
147
+
148
+ ### Disclosure Timeline
149
+
150
+ 1. **48 hours** — Acknowledgment of receipt
151
+ 2. **7 days** — Initial assessment and severity classification
152
+ 3. **30 days** — Fix deployed (critical) or mitigation plan communicated (moderate)
153
+
154
+ We strive to provide regular updates on progress throughout the process. If a fix is required, an emergency patch will be published to the NPM registry.
155
+
156
+ ### Severity Classification
157
+
158
+ | Severity | Definition | Response Time |
159
+ |----------|------------|---------------|
160
+ | **Critical** | Allows unauthorized system access or credential theft | 48 hours |
161
+ | **High** | Allows data exfiltration or privilege escalation | 7 days |
162
+ | **Medium** | Limited impact, requires user interaction | 30 days |
163
+ | **Low** | Minor security issue with minimal impact | Next release |
164
+
165
+ ---
166
+
167
+
168
+
169
+ ## Security Best Practices
170
+
171
+ ### For Users
172
+
173
+ 1. **Keep Weavetab Updated** — Always use the latest version to ensure security patches
174
+ 2. **Use RBAC** — Restrict tool access using appropriate roles (`admin`, `operator`, `viewer`, `automation`, `system`)
175
+ 3. **Configure Domain Policies** — Block high-risk domains
176
+ 4. **Use Blind Injection** — Never pass passwords or 2FA codes directly to `browser_type`; use `browser_type_secret`
177
+
178
+ ### For Developers
179
+
180
+ 1. **Test Security Features** — Verify domain policies, RBAC, and rate limiting in tests
181
+ 2. **Use Least Privilege** - Tools should request only the permissions they need
182
+
183
+ ---
184
+
185
+ ## Security Notifications
186
+
187
+ To receive security notifications:
188
+
189
+ - **Watch the GitHub Repository** — Enable releases and security alerts
190
+ - **Subscribe to Security Advisories** — Monitor GitHub Security Advisories for the repository
191
+ - **Review CHANGELOG.md** — Check security updates in release notes
192
+
193
+ ---
194
+
195
+ ## Contact Information
196
+
197
+ For security-related inquiries:
198
+
199
+ - **Security Vulnerabilities**: security@weavetab.dev
200
+ - **Security Questions**: conduct@weavetab.dev
201
+ - **GitHub Security**: https://github.com/weavetab/mcp/security
202
+
203
+ ---
204
+
205
+ ## License
206
+
207
+ Weavetab is licensed under AGPL-3.0. Security vulnerabilities should be reported responsibly as outlined in this document. Public disclosure of vulnerabilities before coordination with the maintainers is not permitted.