CVE-2026-52815: Gogs.io/gogs Gogs Vulnerable To Unauthenticated Organization Vulnerability

MODERATE
Advisory Identifier: GHSA-744x-3838-5r56
CWE-200
Published
Advisory Summary

CVE-2026-52815 is a MODERATE gogs vulnerable to unauthenticated organization vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves gogs vulnerable to unauthenticated organization teams information disclosure via api. Remediation is available by upgrading affected packages to version 0.14.3.

CVE-2026-52815 at a Glance

CVE Identifier CVE-2026-52815
GHSA Identifier GHSA-744x-3838-5r56
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-52815

To remediate this vulnerability, upgrade all affected Gogs.io/gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gogs.io/gogs fixed: 0.14.3
Upgrade gogs.io/gogs to 0.14.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-52815, inspect your project dependencies for Gogs.io/gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Gogs.io/gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary 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. ## Affected Versions Gogs (all current versions) ## Vulnerability Details ### Root Cause: Missing reqToken() middleware on org teams route group `internal/route/api/v1/api.go` lines 380-385: ```go // Org teams route group — no reqToken() middleware m.Group("/:orgname", func() { m.Get("/teams", org.ListTeams) // No auth required }, orgAssignment(true)) ``` The `orgAssignment(true)` middleware only loads the organization object — it performs no authentication. The `listTeams()` handler at `org_team.go:8` returns all teams unconditionally: ```go func ListTeams(c *context.APIContext) { org := c.Org.Organization teams, err := database.GetTeamsByOrgID(org.ID) // Returns all teams — no c.IsLogged check, no permission check } ``` Compare with other org endpoints that correctly require authentication: ```go m.Group("/orgs/:orgname", func() { // ... other endpoints ... }, reqToken(), orgAssignment(true, true)) // reqToken() enforces auth ``` ### Attack Chain - Attacker sends `GET /api/v1/orgs/target-org/teams` with no authentication - `orgAssignment(true)` loads the organization but does not check auth - `ListTeams()` queries all teams and returns them - Response includes team IDs, names, descriptions, and permission levels (read/write/admin/owner) ## Proof of Concept ```bash # List all teams in an organization — no authentication needed curl -s "http://TARGET:3000/api/v1/orgs/myorg/teams" | python3 -m json.tool # Expected: 200 OK with full team list # [ # { # "id": 1, # "name": "Owners", # "description": "Admin team", # "permission": "owner" # }, # { # "id": 2, # "name": "backend-devs", # "description": "Backend development team", # "permission": "write" # } # ] ``` ## Impact An unauthenticated attacker can: - Enumerate all teams within any organization, including private/internal teams - Discover team permission levels (read/write/admin/owner), aiding privilege escalation planning - Map organizational structure and identify high-value targets (admin/owner teams) - Harvest team IDs for use in other API calls that may have weaker authorization checks ## Suggested Remediation ```go m.Group("/:orgname", func() { m.Get("/teams", org.ListTeams) }, reqToken(), orgAssignment(true)) ``` Add `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.

CVE-2026-52815 Affected Gogs.io/gogs Versions

1 component(s)
Fixed Versions:
0.14.3
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
< 0.14.3
0.14.3

References

Frequently Asked Questions

What is CVE-2026-52815?
CVE-2026-52815 is a security vulnerability in Gogs.io/gogs involving Gogs Vulnerable to Unauthenticated Organization Teams Information Disclosure via API under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.14.3 across affected packages: gogs.io/gogs.
What version fixes CVE-2026-52815?
Upgrading to 0.14.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.14.3. Upgrade your dependency to 0.14.3 or later.
What CWE is associated with CVE-2026-52815?
CVE-2026-52815 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Go dependencies for CVE-2026-52815?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-744x-3838-5r56",
  "modified" : "2026-07-21T13:40:52Z",
  "published" : "2026-06-23T17:13:25Z",
  "aliases" : [ "CVE-2026-52815" ],
  "summary" : "Gogs Vulnerable to Unauthenticated Organization Teams Information Disclosure via API",
  "details" : "## 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-744x-3838-5r56"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-52815"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/pull/8336"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/2ebc0e27069deade992219e10a89fbc44bec8bb9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/releases/tag/v0.14.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-23T17:13:25Z",
    "nvd_published_at" : "2026-06-24T21:16:57Z"
  }
}