other
Warning
- Location
- scripts/generate_map.py:72
- Finding
- Contact addresses are disclosed to an external geocoding service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate_map.py:45-51, 72-109` **Vulnerability Type**: Third-Party Personal Data Disclosure **Risk Level**: Medium ### Vulnerable Code ```python def geocode_address(q, headers): params = {'q': q, 'format': 'json', 'limit': 1, 'countrycodes': 'de'} r = requests.get('https://nominatim.openstreetmap.org/search', params=params, headers=headers, timeout=15) if r.status_code == 200: data = r.json() if data: return float(data[0]['lat']), float(data[0]['lon']) return None, None ``` ```python fields = ['id', 'name', 'street', 'street2', 'zip', 'city', 'country_id', 'email', 'phone'] partners = models.execute_kw(db, uid, secret, 'res.partner', 'search_read', [domain], {'fields': fields, 'limit': 10000}) headers = {'User-Agent': 'OpenClaw/contact-map-bm/1.0'} entries = [] for pidx, p in enumerate(partners, 1): parts = [] if p.get('street'): parts.append(p.get('street')) if p.get('street2'): parts.append(p.get('street2')) if p.get('zip'): parts.append(p.get('zip')) if p.get('city'): parts.append(p.get('city')) addr = ', '.join([x for x in parts if x]) # attempt to find coordinate-like custom fields lat = p.get('x_partner_lat') or p.get('x_lat') or p.get('latitude') or p.get('lat') lon = p.get('x_partner_lng') or p.get('x_lng') or p.get('longitude') or p.get('lng') if lat and lon: try: entries.append({'id': p['id'], 'name': p.get('name'), 'lat': float(lat), 'lon': float(lon), 'addr': addr, 'email': p.get('email'), 'phone': p.get('phone'), 'city': p.get('city')}) continue except Exception: pass if addr: q = addr + ', Germany' latv, lonv = geocode_address(q, headers) if latv and lonv: entries.append({'id': p['id'], 'name': p.get('name'), 'lat': latv, 'lon': lonv, 'addr': addr, 'email': p.get('email'), 'phone': p.get('phone'), 'city': p.g ...[truncated 2370 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Query available Odoo model fields before retrieving contacts and explicitly include supported coordinate fields in `search_read`. 2. Prefer stored coordinates and geocode only contacts that lack valid latitude and longitude values. 3. Require explicit operator consent before transmitting contact addresses to an external geocoder. 4. Clearly identify the destination service, transferred fields, retention considerations, and expected volume before processing begins. 5. Provide an option to use a locally hosted or organization-approved geocoding endpoint. 6. Apply data minimization where exact street-level precision is unnecessary, such as geocoding only postal code and city. 7. Add an option to disable external geocoding entirely and omit records without stored coordinates. 8. Implement a persistent local cache so the same address is not repeatedly disclosed during subsequent runs. 9. Ensure the processing and selected provider comply with applicable contractual, privacy, and data-protection requirements. ]]>
