← Model losses

Head-to-head comparison

claude-code-cli / claude-haiku-5-5 / low / low effort preferred over claude-code-cli / claude-sonnet-5-5 / medium / medium effort · close win.

Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.

Reviewed public evidence

Task goal

Read-only code-review analysis. A search endpoint verifies membership in organizationA, then queries records WHERE title matches the search term with no organization predicate. Pagination counts all matches, and a shared cache uses only the search term and page. Detail the data leak and count/cache leak, propose the smallest authorization/query/cache contract, and explain why filtering response rows afterward is insufficient. Include two cross-tenant verification cases. No tools, edits or executed-test claims. Three numbered items, under180words.

claude-code-cli / claude-haiku-5-5 / low / low effort answer

1. **Leaks.** The endpoint checks membership in organizationA, but the title match has no organization predicate, so other tenants' matching records are returned (detail leak). `COUNT` exposes other tenants' totals and page counts (count leak). A cache keyed only by term and page can serve one tenant's rows and total to another (cache leak). This is based on the packet description; no code was inspected.

2. **Minimal contract.** Derive `orgId` from authenticated membership, never from the request. Scope both the search and its count with `organization_id = :orgId`. Key the cache by `orgId`, term, and page, plus any sort or filter parameters.

3. **Why post-filtering fails.** Filtering after the query still reads other tenants' rows, so counts and cached totals leak, and any future unfiltered path reintroduces the problem. Verification: (a) Tenant B searches a term matching only organizationA titles; expect zero rows, count 0, and no cache hit from A. (b) Tenants A and B run the same term and page; expect distinct cache keys and B's results limited to B's records.

claude-code-cli / claude-sonnet-5-5 / medium / medium effort answer

1. **Leak:** Membership in organizationA only authorizes the caller. The query `WHERE title matches` has no `organization_id` predicate, so it returns other tenants' rows, including titles and any selected fields. The pagination total and page count include other tenants' matches, which reveals whether and how many foreign records match. The shared cache key `(term, page)` lets organizationB's cached result be served to organizationA, or the reverse, and it skips authorization on a hit.

2. **Smallest contract:** Derive `orgId` from the verified membership, never from client input. The query becomes `WHERE organization_id = :orgId AND title matches`, and the same predicate applies to the count query, ordering and page offsets. The cache key becomes `(orgId, normalizedTerm, page)`, with the membership check running before any cache read. Filtering afterward is insufficient because the count, page boundaries and cache contents were already computed over all tenants. Pages can come back short or empty, and totals still leak. A post-filter also relies on every caller remembering to apply it.

3. **Verification cases (not run):**
   - orgB owns "Merger Plan". An organizationA member searching "Merger" must get zero rows and a total that excludes it.
   - Warm the cache as orgB for "Merger" page 1, then request the same term and page as orgA. orgA must miss the cache and must not receive orgB's rows or total.

The packet contains only the question, not the endpoint code, so the actual query and cache implementation is unverified.

Primary judge's stated reason

A avoids presenting an unverified authorization bypass as an observed property while retaining the essential leak diagnosis and remediation. This is a forced, weak preference between substantially equivalent answers, not an established material quality gap. B's fuller pagination reasoning could reasonably lead an independent reviewer to prefer it.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: ab6583d2-98e2-4996-8386-edcc6d58d634. Pair: brp1_1c5d7936b1e57f24bfe8484cef18ab303621c8d7ef27c621f14e2c448e9462e9. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.