T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/api_server.py:824- Finding
Unauthenticated Payment Activation and Unsigned Payment Callback
- Content
View full analysis
Dict: data = _load_orders() order = data['orders'].get(order_id) if not order: return {'error': 'order not found'} if order['status'] != 'pending': return {'error': f'order status: {order["status"]}'} now = int(time.time()) order['status'] = 'active' order['paid_at'] = now order['activated_at'] = now order['expire_at'] = now + order['tier_info']['period_days'] * 86400 # Updates the user's membership tier. for u in ud.get('users', {}).values(): if u['user_id'] == order['user_id']: u['tier'] = order['tier'] u['tier_expire_at'] = order['expire_at'] ``` ```python def alipay_callback(params: Dict) -> Dict: order_id = params.get('out_trade_no', '') trade_status = params.get('trade_status', '') trade_no = params.get('trade_no', '') if trade_status in ['TRADE_SUCCESS', 'TRADE_FINISHED']: result = mark_paid(order_id, trade_no) return {'code': 'success', 'message': 'paid', 'result': result} ``` ### Technical Analysis The mock-payment endpoint is ...[truncated 1896 chars]- Remediation
View remediation
