# CVE-2026-52795: Gogs: Authorization Bypass in Watch API allows any user to monitor private repository activity

> An authenticated attacker can watch private repositories due to an inverted access check, exposing commit messages, branch names, and issue details.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 24 Jun 2026
- **Updated:** 25 Jun 2026
- **Also known as:** GHSA-v8w7-f6gc-cqc2

## What is CVE-2026-52795?

CVE-2026-52795 is a medium-severity missing authorization vulnerability in gogs, published on 24 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Gogs is an open source self-hosted Git service. In 0.14.3 and earlier, any authenticated user can watch a private repository they have no access to, because the access check in the Watch API handler is inverted. The code checks if repoCtx.ViewerCanRead() (returns 404 when the user CAN read) instead of if !repoCtx.ViewerCanRead() (return 404 when the user CANNOT read). Once watching, the attacker's dashboard activity feed shows commit messages, branch names, issue titles, and PR details from the private repository. If email notifications are enabled, the attacker also receives emails containing issue and comment content.

Weakness: CWE-863 (Incorrect Authorization)

## Which versions are affected by CVE-2026-52795?


## How do I fix CVE-2026-52795?

No fix has been published for CVE-2026-52795 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-52795 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-52795 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-52795 and fix it if it is affected.

What it is: CVE-2026-52795 is a medium-severity missing authorization vulnerability in gogs, published on 24 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-52795 exists.

Affected product: gogs. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-52795/ (Markdown: https://insights.sbomify.com/CVE-2026-52795/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-52795
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-52795
- OSV: https://osv.dev/vulnerability/CVE-2026-52795

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-52795/
Summaries are generated and may contain mistakes; the official description above is the record.
