# IDOR Exposes All Machine Learning Models

GraphQL mlModel/mlModelVersion queries lacked authorization checks, letting any authenticated user read private ML Model Registry models and versions by guessing incremental IDs.

- Payout: $1,160
- Severity: medium
- Program: GitLab
- Found by: moblig
- Disclosed: 2024-10-01
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/2528293
- Library page: https://bugbountylibrary.com/r/h1%3A2528293
- Tags: area:web domain:api domain:web impact:data-leak kind:bounty platform:hackerone sev:medium tech:graphql vuln:access-control vuln:idor vuln:info-disclosure

**Target:** GitLab GraphQL API (ML Model Registry)
**Root cause:** The `mlModel` and `mlModelVersion` GraphQL resolvers did not enforce project/namespace authorization on the model, so any authenticated user could query arbitrary model IDs.
**Steps:**
1. Authenticate to gitlab.com and capture `cookie` and `X-Csrf-Token` from any `/api/graphql` request
2. Send `POST /api/graphql` with `query getModel` and `variables:{"id":"gid://gitlab/Ml::Model/1000401"}` for a private project's model
3. Observe private model name, description, versionCount, candidate params/metadata/metrics returned
4. Decrement the incremental model ID to enumerate other private models
5. Use returned `Ml::ModelVersion` IDs with `getModelVersion` query to read individual versions
**How found:** Researcher examined the ML Model Registry GraphQL API, noticed model IDs are sequential global IDs, and tested querying a model belonging to a private project from an unrelated account.
**Exploitation:** Any authenticated GitLab user sends crafted GraphQL queries with guessed incremental `Ml::Model` and `Ml::ModelVersion` global IDs; the API returns private model metadata, candidate params, metrics, and CI job/pipeline info without authorization, enabling enumeration of all models across tenants.
**Insight:** When a new feature ships GraphQL resolvers, test object-level authorization by querying global IDs (`gid://...`) of objects in private projects from an unrelated account; sequential/incremental IDs make enumeration trivial.

