T05 · Unauthorized Access and Privilege Escalation
- Location
app.py:310- Finding
Unauthenticated Access to Lead Records and Administrative Operations
- Content
View full analysis
/messages', methods=['GET']) def get_lead_messages(lead_id): """Get messages for a specific lead.""" messages = get_messages(lead_id, limit=50) return jsonify({'messages': messages}) @app.route('/api/leads//handoff', methods=['POST']) def mark_handoff(lead_id): """Manually mark a lead as handed off.""" update_conversation(lead_id, handed_off=1, stage='handed_off') return jsonify({'status': 'ok'}) ``` ### Technical Analysis The lead-management endpoints do not require authentication or perform authorization checks. The application therefore exposes phone numbers, qualification attributes, timestamps, and complete SMS histories to any client that can reach the service. Lead identifiers are sequential integers. Once `/api/leads` is queried, an attacker can directly retrieve each lead's messages. The unauthenticated handoff endpoint also permits an attacker to change application state, causing legitimate leads to stop receiving ...[truncated 1174 chars]- Remediation
View remediation
