T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/smyx_grooming_effectiveness_analysis.py:57- Finding
Workspace-wide fallback identity causes cross-user report access
- Content
View full analysis
Vulnerability Details
File Location:
scripts/smyx_grooming_effectiveness_analysis.py:57-65;skills/smyx_common/scripts/util.py:457-470;skills/smyx_common/scripts/util.py:580-612;skills/smyx_analysis/scripts/skill.py:143-157;skills/smyx_common/scripts/dao.py:475-495
Vulnerability Type: Broken user isolation through shared fallback authentication
Risk Level: HighVulnerable Code
The primary entry point only permits the already initialized upstream identity to be used when the hidden
--open-idargument was explicitly supplied:python # scripts/smyx_grooming_effectiveness_analysis.py:57-65 try: # 初始化内部用户身份;不要求用户输入,也不在帮助信息中展示。 OpenIdUtil.resolve_current_open_id(args.open_id, use_current=bool(args.open_id)) # 检查必需参数 if args.list: open_id = ConstantEnum.CURRENT__OPEN_ID result = show_analyze_list(open_id) print(result) exit(0)When
--open-idis absent during normal Skill use,use_currentis false. Consequently, the resolver skipsCURRENT__OPEN_IDandCURRENT__USER_NAME, even if those values were initialized from the upstream sender context. It instead loads a workspace-wide identity or creates and reuses a common default user:python # skills/smyx_common/scripts/util.py:457-470 @classmethod def resolve_current_open_id(cls, open_id=None, use_current=True): """解析并初始化当前 open-id,返回最终使用值。""" resolved_open_id = (open_id or "").strip() if isinstance(open_id, str) else open_id if not resolved_open_id and use_current: resolved_open_id = ConstantEnum.CURRENT__OPEN_ID or ConstantEnum.CURRENT__USER_NAME if not resolved_open_id: resolved_open_id = cls.get_api_key_file_open_id() if not resolved_open_id: resolved_open_id = cls.get_or_create_default_open_id() ConstantEnum.CURRENT__OPEN_ID = resolved_open_id if not ConstantEnum.CURRENT__USER_NAME: ConstantEnum.CURRENT__USER_NAME = resolved_open_id return resolved_ope ...[truncated 5722 chars]- Remediation
View remediation
Remediation Suggestions
-
Preserve the upstream sender identity
- Call
resolve_current_open_id(args.open_id, use_current=True)so thatCURRENT__OPEN_IDorCURRENT__USER_NAMEis preferred when available. - Treat an explicitly supplied internal identity and a trusted upstream sender identity separately from an anonymous fallback.
- Call
-
Do not share fallback accounts across requesters
- If anonymous operation is required, scope fallback identities to the current authenticated Agent user, conversation, or tenant.
- Do not select the first default user from a workspace-wide database for all invocations.
-
Enforce server-side ownership
- Bind analysis records to the authenticated upstream principal.
- Require the server to verify ownership for report listing, result polling, and report export.
- Do not rely solely on client-supplied usernames such as
pnaUserName.
-
Partition persisted credentials
- Store tokens under a key derived from a verified sender and tenant identity.
- Prevent one requester from loading tokens issued for another requester.
- Apply restrictive filesystem permissions to the credential database.
-
Fail closed in multi-user environments
- If no trusted sender identity is available, reject history queries rather than silently using a shared account.
- If anonymous analysis is supported, disable history access and isolate the generated report from other anonymous sessions.
-
Add isolation tests
- Create tests with two distinct upstream sender identities.
- Verify that each identity receives separate remote credentials.
- Verify that User B cannot list, poll, or export User A’s reports.
-
