# Solfunmeme Dioxus Plugin Security Policy ## Threat Model Each plugin runs as WASM in the browser. Risks: 1. **Data exfiltration** โ€” plugin reads wallet keys or token balances 2. **UI spoofing** โ€” plugin renders fake wallet connect dialogs 3. **Resource exhaustion** โ€” plugin consumes CPU/memory, freezes browser 4. **Network abuse** โ€” plugin makes unauthorized RPC calls ## Security Boundaries ### Tier 1: DAO (๐Ÿ›๏ธ) โ€” HIGH trust Plugins that handle governance votes and token data. - **Allowed**: Read wallet pubkey, read token balances, POST to /solfunmeme/paste - **Denied**: Private key access, arbitrary network, localStorage write - **Constraint**: max_render_ms = 500, max_fetch = 10/min ### Tier 2: Data (๐Ÿ“Š) โ€” MEDIUM trust Plugins that display/submit data. - **Allowed**: Read-only RPC, POST to pastebin, read erdfa types - **Denied**: Wallet signing, private key access, WebSocket - **Constraint**: max_render_ms = 1000, max_fetch = 30/min ### Tier 3: Analysis (๐Ÿ”ฌ) โ€” MEDIUM trust Plugins that parse/analyze code. - **Allowed**: CPU computation, read source files, render charts - **Denied**: Network access, wallet access, storage write - **Constraint**: max_render_ms = 2000 (heavy computation allowed) ### Tier 4: Meta (๐Ÿงฌ) โ€” LOW trust Experimental ontology/MCP modules. - **Allowed**: Pure computation, render UI - **Denied**: All network, all storage, all wallet - **Constraint**: max_render_ms = 5000 ### Tier 5: Test (๐Ÿงช) โ€” SANDBOXED Test harnesses, no production access. - **Allowed**: Render only - **Denied**: Everything else - **Constraint**: max_render_ms = 10000 ## Verification Each plugin must provide: 1. **Source hash** โ€” SHA256 of source code at build time 2. **zkperf witness** โ€” proves render time โ‰ค max_render_ms 3. **Capability declaration** โ€” what APIs it claims to use 4. **Audit trail** โ€” git commit + reviewer signature ## Enforcement - `inventory` collects plugin metadata at compile time - Runtime: measure actual render time, compare to max_render_ms - Violation โ†’ plugin disabled + alert to DAO senate - Quarterly audit: all plugins re-verified against source hash ## Plugin Capability Matrix | Plugin | Network | Wallet | Storage | Compute | Max ms | |--------|---------|--------|---------|---------|--------| | dao_governance | POST paste | read pubkey | โ€” | low | 500 | | pastebin | POST paste | โ€” | โ€” | low | 500 | | p2p_sharing | POST paste | read pubkey | โ€” | low | 500 | | embedding | โ€” | โ€” | โ€” | low | 1000 | | wikidata | GET wikidata | โ€” | โ€” | low | 1000 | | doc_cleaner | โ€” | โ€” | โ€” | low | 1000 | | markdown | โ€” | โ€” | โ€” | low | 1000 | | rust_parser | โ€” | โ€” | โ€” | high | 2000 | | coverage | โ€” | โ€” | โ€” | high | 2000 | | bert_test | โ€” | โ€” | โ€” | high | 2000 | | monster_meme | โ€” | โ€” | โ€” | med | 5000 | | mcp | โ€” | โ€” | โ€” | med | 5000 | ## Incident Response 1. Plugin exceeds constraint โ†’ auto-disable, log to journal 2. Senate votes to re-enable or permanently remove 3. Source audit required before re-enable 4. All incidents posted to pastebin for transparency