T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:200- Finding
Cross-Notebook Search Bypasses the Per-Agent Notebook Allowlist
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 200-204
Vulnerability Type: Missing object-level authorization
Risk Level: HighVulnerable Code
python @app.post("/v1/search") async def search(request: Request, agent=Depends(auth)): body = await request.json() audit.info(f"{agent['name']} POST /v1/search") async with httpx.AsyncClient(timeout=120) as c: r = await c.post(f"{UPSTREAM}/api/search", json=body, headers={"Authorization": f"Bearer {ON_PASSWORD}"}) return Response(content=r.content, status_code=r.status_code)Technical Analysis
The search endpoint authenticates the calling agent but does not invoke
check_notebook, constrain the upstream query to the agent'sallowed_notebooks, or filter the returned results.Other bridge endpoints are intended to enforce a per-agent notebook allowlist. In contrast, this endpoint forwards an unrestricted search request using the bridge's upstream credential. The upstream service therefore executes the query with the bridge's full access rather than the caller's limited access.
The documentation explicitly describes search as cross-notebook. However, cross-notebook search across all upstream notebooks exceeds the least privilege promised by the per-agent allowlist. Authentication alone is insufficient because authorization must also be applied to every returned search result.
Attack Path
- An attacker obtains any valid per-agent API key, including a key restricted to one notebook.
- The attacker sends targeted queries to
POST /v1/search. - The bridge authenticates the key but forwards the search directly to the upstream API without notebook restrictions.
- The upstream service searches embeddings across notebooks available to the bridge.
- Matches from notebooks outside the attacker's allowlist are returned unchanged.
Impact Assessment
A restricted agent may retrieve indexed content, ex ...[truncated 296 chars]
- Remediation
View remediation
Remediation Suggestions
- Pass the authenticated agent's permitted notebook IDs to the upstream search API when supported.
- Defensively filter every search result by its notebook ID before returning it.
- Reject search requests when a result cannot be reliably associated with an authorized notebook.
- If the upstream API cannot enforce notebook scoping, perform separate searches only against permitted notebooks or disable cross-notebook search for restricted agents.
- Add authorization tests proving that a key restricted to notebook A cannot discover content from notebook B.
- Treat wildcard access as an explicit privileged configuration rather than the default.
