T05 · Unauthorized Access and Privilege Escalation
- Location
server.py:238- Finding
Scoped API Keys Can Search and Export Unauthorized Namespaces
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
agentMemo is a coherent persistent memory server, but its advertised isolation and localhost-only protections are not reliably enforced, so it needs review before use.
Install only in an isolated local environment after fixing the namespace authorization bugs, changing the default bind address to 127.0.0.1, improving secret handling, and adding privacy/retention controls. Do not use this for shared, multi-agent, or sensitive memories until those issues are addressed.
server.py:238Scoped API Keys Can Search and Export Unauthorized Namespaces
server.py:372Batch Deletion Bypasses Namespace Authorization
server.py:428SSE and WebSocket Subscriptions Bypass Namespace RBAC
server.py:537Server Listens on All Interfaces Despite Localhost-Only Security Claim
server.py:435WebSocket API Keys Are Transmitted in Query Strings
templates/dashboard.html:259Stored Cross-Site Scripting Through Unescaped Namespace Values
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
body = json.dumps(data).encode() if data else None
req = urllib.request.Request(url, data=body, method=method)
req.add_header("Content-Type", "application/json")
with urllib.request.urlopen(req, timeout=30) as resp:
if resp.status == 204:
return None
return json.loads(resp.read())
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
| `GET` | `/v1/memories/search` | Search (semantic/keyword/hybrid) |
| `GET` | `/v1/memories/{id}` | Get memory by ID |
| `PUT` | `/v1/memories/{id}` | Update memory (creates version) |
| `DELETE` | `/v1/memories/{id}` | Delete memory |
| `GET` | `/v1/memories/{id}/versions` | Version history |
| `POST` | `/v1/memories/{id}/rollback` | Rollback to version |
| `POST` | `/v1/memories/batch` | Batch create/delete/search |
Referenced artifact was not completely inspected
orn, sentence-transformers, hnswlib, aiosqlite, and other dependencies. Review `requirements.txt` before running. Prefer installing inside a virtualenv or conta
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- [x] `GET /v1/memories/search` — Semantic / keyword / hybrid modes
- [x] `GET /v1/memories/{id}` — Retrieve by ID
- [x] `PUT /v1/memories/{id}` — Update with auto-versioning
- [x] `DELETE /v1/memories/{id}` — Delete
- [x] `GET /v1/memories/{id}/versions` — Version history
- [x] `POST /v1/memories/{id}/rollback` — Rollback to version
- [x] `POST /v1/memories/batch` — Batch create/delete/search
The startup example encourages loading environment variables via env $(cat .env | xargs), which can expose the admin key in process arguments and break safely on special characters or whitespace. Combined with storing the admin key in .env, this creates another path for credential leakage to process monitors, logs, and shell history.
echo "AGENTMEMO_ADMIN_KEY=$AGENTMEMO_ADMIN_KEY" >> "$ENV_FILE"
fi
echo ""
echo "✅ .env written to $ENV_FILE"
# Verify import
"$VENV_DIR/bin/python" -c "import server, database, embeddings, models, events; print('Import check: OK')"
The documented command expands .env contents directly into a command line, which can leak the admin key through process lists and may mishandle shell metacharacters. In a skill meant to provide shared persistent memory with RBAC, compromise of the admin key could allow unauthorized access or administrative control over stored agent data.
echo " source .venv/bin/activate && python server.py"
echo ""
echo "Or with dotenv:"
echo " env \$(cat .env | xargs) .venv/bin/python server.py"
echo ""
echo "Dashboard: http://localhost:${AGENTMEMO_PORT}/dashboard"
echo "Health: http://localhost:${AGENTMEMO_PORT}/health"
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"$VENV_DIR/bin/pip" install -q --upgrade pip
"$VENV_DIR/bin/pip" install -q -r requirements.txt
# Write .env
ENV_FILE="$PWD/.env"
cat > "$ENV_FILE" <<EOF
AGENTMEMO_PORT=$AGENTMEMO_PORT
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"$VENV_DIR/bin/pip" install -q --upgrade pip
"$VENV_DIR/bin/pip" install -q -r requirements.txt
# Write .env
ENV_FILE="$PWD/.env"
cat > "$ENV_FILE" <<EOF
AGENTMEMO_PORT=$AGENTMEMO_PORT
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"$VENV_DIR/bin/pip" install -q --upgrade pip
"$VENV_DIR/bin/pip" install -q -r requirements.txt
# Write .env
ENV_FILE="$PWD/.env"
cat > "$ENV_FILE" <<EOF
AGENTMEMO_PORT=$AGENTMEMO_PORT
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"$VENV_DIR/bin/pip" install -q -r requirements.txt
# Write .env
ENV_FILE="$PWD/.env"
cat > "$ENV_FILE" <<EOF
AGENTMEMO_PORT=$AGENTMEMO_PORT
AGENTMEMO_DB=$AGENTMEMO_DB
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"$VENV_DIR/bin/pip" install -q -r requirements.txt
# Write .env
ENV_FILE="$PWD/.env"
cat > "$ENV_FILE" <<EOF
AGENTMEMO_PORT=$AGENTMEMO_PORT
AGENTMEMO_DB=$AGENTMEMO_DB
This line writes the AGENTMEMO_ADMIN_KEY directly into a plaintext .env file. In the context of an agent memory server with RBAC and an admin key controlling privileged access, exposure of this value could allow unauthorized administration, data access, or cross-agent namespace compromise.
echo "AGENTMEMO_ADMIN_KEY=$AGENTMEMO_ADMIN_KEY" >> "$ENV_FILE"
fi
echo ""
echo "✅ .env written to $ENV_FILE"
# Verify import
"$VENV_DIR/bin/python" -c "import server, database, embeddings, models, events; print('Import check: OK')"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST http://localhost:8790/v1/memories \
-H 'Content-Type: application/json' \
-d '{
"text": "User prefers dark mode",
This markdown file documents bulk import/export endpoints and elsewhere documents delete operations, but it does not include any user-facing warning that these actions can expose or remove stored memory data. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data or system integrity.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
All /v1/ requests require X-API-Key header. Create scoped keys:
curl -X POST http://localhost:8790/v1/api-keys \
-H "X-API-Key: my-secret-admin-key" \
-H "Content-Type: application/json" \
-d '{"name": "agent-a", "namespaces": ["agent-a", "shared"]}'
The skill describes capabilities that involve environment secrets, local file/database writes, and network access, but it does not declare any explicit tool scope or allowed-tools restrictions. This creates a permission ambiguity where an agent may invoke the skill with broader capabilities than a reviewer expects, increasing the risk of unintended secret access, persistence, or outbound communication.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST http://localhost:8790/v1/memories \
-H 'Content-Type: application/json' \
-H 'X-API-Key: your-secret-key' \
-d '{"text": "User prefers dark mode", "namespace": "prefs", "tags": ["ui"], "importance": 0.9}'
This markdown file lists destructive and data-moving behaviors such as DELETE /v1/memories, rollback, and Import/Export JSON as accepted features, but it provides no warning that these actions can remove, overwrite, or expose stored memory data. For markdown files, the skill description should disclose behaviors that may affect user data or system integrity.
This Python file performs HTTP POST requests that send task seed text to the agentMemo server, including user-like preference, project-state, and correction data. Although the module docstring says a server is required, it does not clearly warn that running the script transmits benchmark content over HTTP to an external/local service.
The demo promotes cross-session recall of work context and user preferences as an automatic feature, but it does not mention consent, retention limits, privacy boundaries, or the risk of storing sensitive project and preference data. In a memory skill specifically designed for persistent agent context, normalizing silent retention can lead to unexpected collection and reuse of personal or operational information.
The scenario presents automatic resumption of a deployment from remembered state as beneficial without warning that persisted state may be stale, incomplete, tampered with, or inconsistent with the live system. In operational workflows, blindly trusting remembered execution state can cause skipped validation, duplicate actions, failed migrations, or integrity-impacting changes in production.
The integration plan explicitly proposes persisting user preferences, project state, and chat memory across sessions, but it does not pair that persistence with consent, notice, retention disclosure, or clear handling rules for privacy-sensitive data. In the context of an agent memory system designed for long-lived cross-session storage, this can lead to over-collection, retention of sensitive personal or behavioral data, and compliance/privacy failures even if no direct code exploit is present.
The client defaults to an insecure base URL using plain HTTP, and this library is specifically meant to carry sensitive agent memory, search queries, metadata, and API keys across sessions. In non-local or misconfigured deployments, traffic can be intercepted or modified in transit, exposing confidential memory contents and credentials.
The manifest describes agentMemo primarily as a semantic memory service for storing, searching, sharing namespaces with RBAC isolation, versioning, event streaming, and batch memory operations. This client also exposes creation, listing, and deletion of API keys, which is a separate administrative/security-management capability not declared as part of the skill's purpose or triggers.