Geocoding failures surface a validation error, not silent (0,0) coordinate storage
Why it matters
Silent geocoding failure that stores (0,0) coordinates plants listings in the Gulf of Guinea — visibly off the map for most directories, or worse, clustered with other (0,0) entries in a way that makes them appear at a real but incorrect location. CWE-754 (Improper Check for Unusual Conditions) and CWE-20 (Improper Input Validation) both apply: the application accepts invalid geocoding output without surfacing an error. ISO 25010:2011 reliability is violated because the system produces incorrect outputs without notifying the user. From a business standpoint, silent (0,0) storage corrupts the directory's data integrity and is difficult to detect and backfill at scale.
Severity rationale
High because silent (0,0) storage corrupts listing data permanently without user awareness, and the defect is difficult to detect and remediate after the fact at scale.
Remediation
Reject listing creation when geocoding fails and surface a specific, actionable error message. Do not store a listing with null or (0,0) coordinates.
// src/app/api/listings/route.ts
export async function POST(req: Request) {
const { address, name } = await req.json();
const geocoded = await geocodeAddress(address);
if (!geocoded || geocoded.confidence < 0.8) {
return Response.json(
{ error: 'Address could not be verified. Please enter a more complete address, including city and postal code.' },
{ status: 400 }
);
}
const listing = await db.listings.create({
data: { name, address, latitude: geocoded.lat, longitude: geocoded.lng }
});
return Response.json(listing);
}
In the submission form, display the API error message directly rather than a generic fallback, so users understand what to correct. Handle all error paths: address not found, API timeout, rate limit exceeded — each should produce a distinct message.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Map & Location Integration Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-754 — Improper Check for Unusual or Exceptional Conditions — geocoding failure stored silently as (0,0)
- cwe · CWE-20 — Improper Input Validation — invalid geocoding result accepted without rejection
- iso-25010:2011 · reliability — Fault Tolerance — graceful handling of geocoding API failures
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-map-location·automated