Intent-Code Divergence
Medium
- Confidence
- 96% confidence
- Finding
- This is a real insecure direct object reference / tenant-isolation flaw in the reference pattern. The router indicates authenticated and tenant-scoped APIs, but the controller's show/update/delete paths fetch records by raw ID without constraining queries to conn.assigns.tenant_id, allowing access to or modification of another tenant's records if IDs are guessed or enumerated. In a code-generation skill, insecure examples are especially dangerous because downstream generated projects may reproduce the flaw broadly across resources.
