openai / gpt-6.1-sol / low / low effort preferred over xai / grok-4.7-efficient / low / low 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
Perform a source-grounded authorization and tenant-isolation review of review-pack access and worker-job token boundaries. Identify only a concrete cross-tenant, unauthorized-read/write, or token-confusion path supported by the code; give required preconditions, affected data/action, minimal mitigation, and regression coverage. Do not infer exploitability from names alone.
openai / gpt-6.1-sol / low / low effort answer
## Conditional finding: video resolution bypasses certification read authorization
**The supplied code establishes a read-bypass path, conditional on control of `review_manifest.json`; it does not establish how an attacker obtains that control.** Confidence: high in the bypass, uncertain in attacker reachability. Assessment was direct and independent.
### Evidence and reproducible trigger
In `[REDACTED: private project name]/backend/app/routers/review_pack.py`:
- Certification access requires the assigned reviewer’s home organization, slot, and email (1368–1427).
- Generic file serving explicitly blocks the `certification` directory (4058–4066).
- However, `GET /review-pack/{inspection_id}/video` reads `video_path` from the manifest and serves the corresponding pack-relative object without that private-path check (2638–2655). `_validate_path` only rejects absolute paths and `..` components (1163–1179).
**Required preconditions:**
1. A local certification pack contains another reviewer’s draft or locked packet.
2. The requester passes ordinary media authentication and inspection tenant checks, but is not the assigned reviewer.
3. Someone can author or alter that pack’s manifest.
4. No `.mp4` under `video/` takes precedence.
Set:
```json
{"video_path":"certification/stage1/<slot>.draft.json"}
```
Then request:
```http
GET /api/v1/review-pack/<inspection_id>/video
```
The route serves the draft bytes labeled `video/mp4`, bypassing reviewer assignment checks. The same path applies to an existing locked packet. This is an **unauthorized same-tenant read**, not an established cross-tenant exploit.
### Minimal mitigation and regression coverage
Reject private certification paths before **either** manifest-directed storage lookup in the video route. Apply the check to the resolved pack-relative destination, including direct-key resolution.
Regression tests:
- An unassigned, otherwise authorized media reader cannot retrieve drafts, locks, or manifests through `/video`.
- Mixed-case `Certification` and direct storage-key variants are also denied.
- Legitimate pack-relative and tenant-confined video references still work.
### Limits and discarded hypotheses
- The packet does **not** demonstrate that a worker-job bearer can write this manifest. Its allowlist excludes review-pack routes (`worker_job_tokens.py`:78–93, 207–216).
- Cross-tenant media/job associations and unscoped boot writes require caller, model, or RLS evidence outside this packet; they are not demonstrated exploits.
- JWT decoding and downstream enforcement dependencies are outside the packet, so no token-confusion finding is established.
**Next useful action:** add the video-path privacy regression test, then separately verify who can author manifests to determine practical exposure.xai / grok-4.7-efficient / low / low effort answer
No closed cross-tenant exploit is fully proven inside this packet. The concrete unauthorized-read path the code will execute is unbounded serving of `ProcessingJob.output_path`. Worker-job tokens are not a review-pack credential in this snapshot.
## Finding
**Arbitrary storage read via job `output_path` (cross-tenant if that key is another tenant’s object).**
`GET /review-pack/{inspection_id}/in-progress/{file_path}`, `GET /review-pack/{inspection_id}/in-progress/fps-count`, and the unfinalized fallback in `GET /review-pack/{inspection_id}/{file_path}` authorize the inspection, then read storage from a job path that is not bound to the tenant or the inspection.
Evidence:
- Inspection access is tenant-scoped in `_get_inspection` (`review_pack.py` 1242–1273): `Asset.municipality_id == scope.own_org_id` and `scope.inspection_filter()`.
- The follow-up media lookup does not repeat that check (`2339–2344`, `2435–2439`, `4074–4079`): `MediaFile.inspection_id` + `media_type == "video"` + `active()` only. No `municipality_id`. `.first()` is unordered.
- The job lookup (`2353–2374`, `2446–2466`, `4084–4096`) filters `media_file_id`, job type, and status only. No `ProcessingJob.municipality_id`.
- The handler then serves `{job.output_path}/{file_path}` (`2378`, `2470–2474`, `4095–4121`) with path-traversal checks on `file_path` only. Unlike manifest `video_path` (`2656–2666`), there is no `_confine_to_pack_tenant`.
Affected action: read of whatever object exists at that key. In-progress routes are limited to `fps/` and `modules/observations/`. The generic route, when `review_pack_path` is empty, serves any non-`certification/` relative path, including `inspection.json` and track/video artifacts.
Required preconditions (all visible in this code once the row exists):
1. Caller passes `_get_inspection` for inspection `I`.
2. An active video `MediaFile` has `inspection_id == I`.
3. A `review_pack` or `embedded_import` job for that media id is `pending`, `running`, or `completed`, with non-empty `output_path`.
4. Generic route only: `inspection.review_pack_path` is empty. In-progress routes use `output_path` even when a finalized pack exists, if the requested file is missing there (`2424–2470`).
5. The storage backend has an object at `{output_path}/{file_path}`.
Cross-tenant consequence: if `output_path` is another municipality’s key (shared bucket, opaque keys), this handler returns those bytes. How `output_path` is written is outside the packet, so the write step is not established here. Given such a row, the read is unconditional.
Minimal mitigation: select media and job only when both `municipality_id` values equal `scope.own_org_id`, and reject `output_path` unless it matches a server-built prefix for that inspection (not merely “non-empty”). Do not treat a completed job’s `output_path` as a standing read capability.
Regression: inspection in org A, video media linked to it, job `output_path` under org B’s prefix, object present → 404 and no `storage.get`/`get_response`. Same for in-progress `fps/` and for generic `inspection.json` when `review_pack_path` is null. Control: same-inspection prefix still serves.
## Same-file gap (not cross-tenant by itself)
`serve_review_pack_video` (`2646–2666`) will read a worker-written manifest `video_path` if it only shares the first two segments of `pack_key` (`_confine_to_pack_tenant`, `1194–1208`). That blocks `review-packs/{other_muni}/...` if segment 2 is the municipality id. It does not block another inspection or project under `review-packs/{same_muni}/...`, even though `_get_inspection` applied `inspection_filter()`. Preconditions: no `video/*.mp4`, `{pack}/{video_path}` missing, relative `video_path` exists under that two-segment root. Mitigation: confine to the inspection pack key, not `parts[:2]`. Regression: same-muni, different inspection key → 404.
## Worker-token boundary
No token-confusion path into review-pack is shown. `_ALLOWED_ROUTES` (`78–93`) does not include `/review-pack`. `validate_worker_job_request` 403s before DB work when method/path miss (`207–216`). `sub` remains the uploader, but the fence is type + `scp == [WORKER_PACK_INGEST]` + live job/tenant/resource snapshot (`197–205`, `271–295`). Review-pack routes use `get_media_user` / `require_role` / `require_scope`, not these tokens.
`GET /api/v1/organizations/\d+/profile-bank/stats` is allowlisted without binding the path org id in this function. `enforce_worker_job_municipality` exists (`309–321`) but is not called here. Whether that route calls it is outside the packet; do not treat the route name as a confirmed bypass.
## Discarded
- `_inspection_json_asset_context` (`339–377`) uses a fresh session and omits municipality on `Asset.id` / `observation.inspection_id`. Those predicates are the already-authorized primary keys, so this is not a cross-tenant read by itself.
- `persist_review_boot_from_bytes` / `stamp_review_boot` (`155–208`) write boot JSON by `Inspection` id with no tenant or worker-job check. A foreign id would be a cross-tenant metadata write. No caller in this packet passes that id, so this is not a closed path.
- `serve_document` (`2523–2537`) omits `MediaFile.municipality_id` but still keys off the authorized `inspection_id` and serves that row’s `storage_key`. Cross-tenant only if such a mismatched row already exists; creation is not in this packet.
## Missing dependencies
`app.deps` (whether every non-`access` token hits `validate_worker_job_request`), profile-bank/observations/inspections handlers (whether they call `enforce_worker_job_*`), job-claim code that sets `output_path`, and storage/RLS behavior. Until those are in evidence, do not claim the worker fence is bypassed or that a worker can mint the bad `output_path`.
Next useful action: add the output_path confinement checks and the two regression tests above; separately confirm the org-id stats route calls `enforce_worker_job_municipality` before any tenant read.Primary judge's stated reason
A offers the slightly better-supported remediation target: apply an existing private-resource restriction to an alternate serving route, while retaining legitimate video resolution. This is a forced, weak preference, not an established material quality gap; B provides useful broader boundary coverage, and an independent review could reasonably prefer that benefit.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 527c366a-0a3f-41a8-8ff5-f886f8eadb49. Pair: brp1_9406f62924791a5e5d6a79e52d1327dae8849bf135ffd72697c89520417c3e65. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.