T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/smyx_feed_intake_estimation_analysis.py:42- Finding
Unverified hidden identity parameter enables cloud-account impersonation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/smyx_feed_intake_estimation_analysis.py:42,59; supporting authentication flow inskills/smyx_common/scripts/util.py:550-566,576-612
Vulnerability Type: Improper authentication and untrusted identity assertion
Risk Level: HighComplete Code Snippet
python # scripts/smyx_feed_intake_estimation_analysis.py parser.add_argument("--open-id", required=False, help=argparse.SUPPRESS) # ... # Initialize the internal user identity. 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)python # skills/smyx_common/scripts/util.py def _get_or_create_user(username): _url = ApiEnum.BASE_URL_HEALTH + "/sys/phoneLogin" open_id = username _data = { "silent": 1, "register": 1, "openId": open_id, "mobile": username, "source": ConstantEnum.DEFAULT__SKILL_HUB_NAME } try: _response = requests.post(_url, json=_data) if _response.status_code == 200: _response_json = _response.json() if _response_json and _response_json.get("success"): return _response_json and _response_json.get("result") except Exception as _e: CommonUtil.trace_exception_stack(_e) return {} # ... current__user_name = ( ApiEnum.API_SECRET_KEY or ConstantEnum.CURRENT__USER_NAME or ConstantEnum.CURRENT__OPEN_ID ) if (not ApiEnum.TOKEN or not ApiEnum.OPEN_TOKEN) and current__user_name: # ... if not ApiEnum.TOKEN or not ApiEnum.OPEN_TOKEN: new_current_user = _get_or_create_user(current__user_name) if new_current_user: ApiEnum.TOKEN = new_current_user.get("token") ApiEnum.OPEN_TOKEN = new_current_user.get("openToken") # ... headers.setdefault("X-Access-Token", ApiEnum.TOKEN) headers.setdefault("X ...[truncated 2920 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the caller-controlled
--open-idoption from the public executable entry point. - Accept identity only from an authenticated, integrity-protected upstream channel.
- Use signed identity assertions containing an issuer, audience, subject, expiration time, and nonce.
- On the server, disable identifier-only silent login and require proof of identity ownership before issuing tokens.
- Bind all report-list and analysis operations to the subject encoded in the authenticated token rather than a separate username or Open ID field.
- Reject attempts to override an identity already established by the trusted runtime.
- Avoid using the same value as both
openIdandmobile. - Add authorization tests proving that one authenticated identity cannot list, retrieve, or create reports for another identity.
- Invalidate tokens previously issued through the identifier-only flow if the server currently permits it.
- Remove the caller-controlled
