T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/ari.py:1171
- Finding
- Specialized Workflow Restrictions Can Be Overridden Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ari.py:1171-1175` and `scripts/ari.py:1654-1655` **Vulnerability Type**: Specialized authorization and least-privilege boundary bypass **Risk Level**: Medium ### Vulnerable Code ```python def operation_payload(args): defaults = operation_defaults() workflow = (getattr(args, "workflow", None) or defaults.get("workflow") or "").strip() focus = (getattr(args, "focus", None) or defaults.get("focus") or "").strip() if not workflow or not focus: return None, error_obj( "ARI_VALIDATION_ERROR", 0, "运营工作流缺少 workflow/focus", "通用 Skill 请显式传 --workflow 和 --focus;专属 Skill 会内置固定值。") ``` The corresponding command-line options are exposed here: ```python def add_operation_args(parser, confirm=False): parser.add_argument("--asin", required=True) parser.add_argument("--site", default="amz_us", choices=SITES) parser.add_argument("--workflow") parser.add_argument("--focus") parser.add_argument("--competitor") parser.add_argument("--request-id", default="") ``` ### Technical Analysis The specialized Skill declares a fixed `listing/benefits` workflow in `skill-defaults.json` and states that callers must not change the workflow or focus. The implementation does not enforce that boundary. In `operation_payload()`, caller-controlled `args.workflow` and `args.focus` take precedence over the packaged defaults. The specialized CLI also explicitly exposes `--workflow` and `--focus`. Consequently, the supposedly immutable specialization values can be replaced at runtime. The subsequent capability check limits execution to workflow/focus combinations supported by the remote account, so this does not grant arbitrary server permissions. It nevertheless bypasses the Skill-level least-privilege boundary and may allow other account-enabled operational analyses or paid workflows to be invoked through a Skill advertised as being restricted to feature-to-bene ...[truncated 1586 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--workflow` and `--focus` from specialized builds. 2. Always load the workflow and focus from `skill-defaults.json`: ```python workflow = str(defaults.get("workflow") or "").strip() focus = str(defaults.get("focus") or "").strip() ``` 3. Reject runtime overrides explicitly, even if the parser is later modified: ```python if getattr(args, "workflow", None) or getattr(args, "focus", None): return None, error_obj( "ARI_FIXED_WORKFLOW_OVERRIDE", 403, "This specialized Skill does not permit workflow or focus overrides." ) ``` 4. Assert immediately before both quote and run requests that the payload exactly matches the packaged fixed values. 5. Have the server bind specialized Skill channels to an allowed workflow/focus pair instead of trusting client-supplied values. 6. Include the fixed workflow and focus in a server-verifiable specialization identifier, and reject mismatches server-side. 7. Add regression tests confirming that alternative workflow or focus values cannot reach either the quote or run endpoint. ]]>
