Client-side fetch paths resolve to server routes
Why it matters
A client that fetches /api/user/profile when the server only defines /api/users/me returns 404 on every call in production — and AI tools are specifically prone to inventing plausible-sounding endpoints that do not exist. The user sees a loading spinner that never resolves, or a silent data-load failure that reads as a blank page. This is reference-integrity at the API boundary and it aligns directly with OWASP A05 (Security Misconfiguration) when the 404 exposes stack traces.
Severity rationale
Critical because a broken fetch URL produces a user-visible 404 on every call and silently corrupts every page that depends on the data.
Remediation
For each unresolved URL, either create the missing route handler or correct the client specifier. In Next.js App Router, the handler lives next to the URL path in app/api/...:
// app/api/user/profile/route.ts
export async function GET() {
return Response.json({ /* ... */ })
}
If you route through next.config.* rewrites, verify the rewrite source matches the fetch specifier exactly.
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 Hallucinated References Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- owasp:2021 · A05 — Security Misconfiguration
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-slop-hallucinations·automated