T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/apply_feishu_multi_agent.py:75
- Finding
- Global Session Visibility Violates Least-Privilege Boundaries<![CDATA[ ## Vulnerability Details **File Location**: `scripts/apply_feishu_multi_agent.py:75-94`, `scripts/audit_feishu_multi_agent.py:36-44`, `scripts/render_feishu_multi_agent.py:157-164` **Vulnerability Type**: Excessive cross-session access **Risk Level**: High ### Vulnerable Code ```python def merge_tooling(config: dict[str, Any], roles: list[dict[str, Any]]) -> list[str]: changes: list[str] = [] tools = ensure_dict_path(config, ["tools"]) sessions = ensure_dict_path(tools, ["sessions"]) if sessions.get("visibility") != "all": sessions["visibility"] = "all" changes.append("set tools.sessions.visibility=all") agent_to_agent = ensure_dict_path(tools, ["agentToAgent"]) if agent_to_agent.get("enabled") is not True: agent_to_agent["enabled"] = True changes.append("set tools.agentToAgent.enabled=true") existing_allow = agent_to_agent.get("allow") if not isinstance(existing_allow, list): existing_allow = [] agent_to_agent["allow"] = existing_allow for role in roles: if role["agentId"] not in existing_allow: existing_allow.append(role["agentId"]) changes.append(f"allow agentToAgent: {role['agentId']}") return changes ``` The audit utility also treats global visibility as mandatory: ```python allow = set(dotted_get(config, ["tools", "agentToAgent", "allow"], []) or []) sessions_visibility = dotted_get(config, ["tools", "sessions", "visibility"]) agent_to_agent_enabled = dotted_get(config, ["tools", "agentToAgent", "enabled"]) if sessions_visibility != "all": failures.append("tools.sessions.visibility should be 'all'") if agent_to_agent_enabled is not True: failures.append("tools.agentToAgent.enabled should be true") ``` Generated configuration contains the same setting: ```python "tools": { "sessions": {"visibility": "all"}, "agentToAgent": {"enabled": True, "allow": allow}, }, ``` ### Technical Analysis The Skill enabl ...[truncated 1674 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace global session visibility with visibility scoped to the required agents and Feishu group sessions. 2. Keep `agentToAgent.allow` restricted to the minimum necessary set of Agent IDs. 3. If OpenClaw supports group-level or session-prefix authorization, permit only session keys matching the intended Feishu group. 4. If the platform cannot scope visibility, require explicit informed confirmation before setting it to `all`. 5. Change the audit utility so global visibility produces a security warning rather than treating it as the only valid configuration. 6. Document which data becomes visible after enabling the option and recommend deployment isolation between unrelated teams. 7. Add a post-apply verification step that enumerates effective Agent and session permissions. ]]>
