---
id: "CVE-2026-127958"
page: "https://infrastack.ai/live/CVE-2026-127958"
kind: "vulnerability"
aliases: ["CVE-2026-127958", "GHSA-859w-9wv7-c5x9"]
title: "Pending reviews created via the API leak into the PR timeline and feeds"
severity: "low"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "gitea.dev", "fixed": ["28.4.0"], "affected": ">= 1.12, <= 28.3.0", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["cwe-200", "gitea", "package", "pull-requests", "rest-api", "self-hosted"]
not_affected_if: ["managed-hosting-patched", "no-public-repos", "web-diff-only-reviews"]
published_at: "2026-11-15T21:03:21+00:00"
first_seen_at: "2026-11-15T21:12:46+00:00"
updated_at: "2026-11-15T21:14:14+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/go-gitea/gitea/security/advisories/GHSA-859w-9wv7-c5x9", "first_seen_at": "2026-11-15T21:12:46+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-127958", "first_seen_at": "2026-11-15T22:40:23+00:00"}]
exploit_sources: []
---

# Pending reviews created via the API leak into the PR timeline and feeds

Link for people: https://infrastack.ai/live/CVE-2026-127958 (this .md is for agents)

Gitea publishes a pending pull request review created through the REST API to everyone who can read the pull request, including anonymous visitors on public repositories. An attacker gets read access to draft review text and line comments the reviewer had not submitted, and the text also appears in activity feeds and RSS/Atom.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:gitea.dev affected >= 1.12, <= 28.3.0 fixed 28.4.0

## How to check

- Check the Gitea version with `gitea --version` and compare it against the affected range `>= 1.12, <= 28.3.0`.
- On a public repository, call `GET /api/v1/repos/{owner}/{repo}/issues/{index}/timeline` anonymously and look for entries of type `review` created by a PENDING review.
- Check the repository feed `GET /api/v1/repos/{owner}/{repo}/activities/feeds` for `comment_pull` entries tied to unsubmitted reviews.

## Fix

- Gitea `28.4.0` (fixed version for the affected range listed in the sources).

## Timeline

- 2026-11-15T21:12:46+00:00 ghsa-repo https://github.com/go-gitea/gitea/security/advisories/GHSA-859w-9wv7-c5x9
- 2026-11-15T22:40:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-127958

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/go-gitea/gitea/security/advisories/GHSA-859w-9wv7-c5x9
- [fix] Release notes: github.com https://github.com/go-gitea/gitea/releases/tag/v28.4.0

## From the sources

A review that a reviewer starts through the REST API as a draft (`POST /repos/{owner}/{repo}/pulls/{index}/reviews` with `"event": "PENDING"` or with no `event`) is published immediately. Its body and line comments appear to everyone who can read the pull request, which on a public repository includes anonymous visitors. The reader cannot cause this and gains only read access to text the reviewer has not submitted. The disclosure happens whenever a reviewer uses the API's create-as-PENDING, submit-later flow, even if the draft is never submitted. Meanwhile Gitea tells the reviewer the review is `PENDING` and tells everyone else it does not exist.

`CreatePullReview` (`routers/api/v1/repo/pull_review.go:563`) maps `PENDING`, an empty event or an unknown event to `ReviewTypePending` and still sends the review through `pull_service.SubmitReview`. `issues_model.SubmitReview` (`models/issues/review.go:549`) then creates the `CommentTypeReview` timeline comment without checking the review type, although it checks for the pending type a few lines earlier. The service layer fires the review and code-comment notifications, and the feed notifier copies the draft text into `comment_pull` activity entries and the repository's RSS/Atom feeds.

The reviews API and the diff view correctly hide the draft. However, the conversation page loads the linked review's code comments with a concrete review, which bypasses the pending filter in `comment_code.go`, and the issue timeline API returns the comment unfiltered. When the draft is later submitted, a second entry is added and the original draft text stays on the page. Deleting the draft does not remove the feed entries.

The attached reproducer runs a stock binary with default settings. A regular user with no rights on a public repository creates a PENDING review. An anonymous visitor then gets `[]` from the reviews API and no line comment in the diff view, but sees both the draft body and the line comment on the conversation page and the body in the timeline API. Drafts started in the web diff view are not affected. The behaviour dates from the introduction of the API review endpoints in c97494a4f4 (#11224), first released in v1.12.0-rc1.

## Details

Scanned commit `31626de2a6cdd3e1fe93216e4ac80f511297f1e7`, default configuration. The reader who gains something is anyone able to view the pull request (an anonymous visitor on a public repository); the affected user is a reviewer who starts a review through the REST API.

The root cause is one missing check: `issues_model.SubmitReview` (`models/issues/review.go:549`) creates the public timeline comment, and `pull_service.SubmitReview` then fires the review notifications, for a review whose type stays `ReviewTypePending`. The API handler `CreatePullReview` is the only caller that passes that type. The draft then surfaces in several places that read timeline comments or notifications (conversation page, timeline API, activity feeds and RSS/Atom, notifications); they are all symptoms of that one write.

`POST /api/v1/repos/{owner}/{repo}/pulls/{index}/reviews` with `"event": "PENDING"` (or with no `event`) returns `"state": "PENDING"`, and from that moment the review body and its line comments are shown to every reader of the pull request on `/{owner}/{repo}/pulls/{index}`, and the body is returned by `GET /api/v1/repos/{owner}/{repo}/issues/{index}/timeline`. At the same time `GET .../pulls/{index}/reviews` returns `[]` to those readers and the diff view `/{owner}/{repo}/pulls/{index}/files` does not show the line comment, because both treat the review as a draft that only its author may see.

On a fresh instance, with `reviewer` being a regular user without any rights on the public repository `owner/project`:

```
POST /api/v1/repos/owner/project/pulls/1/reviews        (as reviewer)
{"event": "PENDING", "body": "DRAFT-REVIEW-BODY",
 "comments": [{"path": "feature.txt", "new_position": 1, "body": "DRAFT-LINE-COMMENT"}]}
  -> 200, "state": "PENDING"

GET /api/v1/repos/owner/project/pulls/1/reviews         (anonymous) -> []
GET /owner/project/pulls/1/files                        (anonymous) -> no DRAFT-LINE-COMMENT
GET /owner/project/pulls/1                              (anonymous) -> contains DRAFT-REVIEW-BODY and DRAFT-LINE-COMMENT
GET /api/v1/repos/owner/project/issues/1/timeline       (anonymous) -> entry of type "review" with body DRAFT-REVIEW-BODY
```

The same happens for a pending review that has only line comments and no body, a request the API accepts since `dcef88a233` ("fix(api): allow pending-inline-comment-only reviews (#39433)").

### Why

`CreatePullReview` maps `PENDING`, an empty and any unknown `event` to `ReviewTypePending`, stores the line comments as pending, and then sends every review, pending or not, through the submit path:

```go
// routers/api/v1/repo/pull_review.go:704
	default:
		return issues_model.ReviewTypePending, false
…
// routers/api/v1/repo/pull_review.go:562
	// create review and associate all pending review comments
	review, _, err := pull_service.SubmitReview(ctx, ctx.Doer, ctx.Repo.GitRepo, pr.Issue, reviewType, opts.Body, opts.CommitID, nil)
```

`issues_model.SubmitReview` creates or updates the `review` row with the requested type and then, whatever that type is, adds the timeline comment that announces the review:

```go
// models/issues/review.go:549
	comm, err := CreateComment(ctx, &CreateCommentOptions{
		Type:        CommentTypeReview,
		Doer:        doer,
		Content:     review.Content,
		…
		ReviewID:    review.ID,
```

The function does anticipate the pending type: a few lines earlier (`models/issues/review.go:541`) it tests `reviewType != ReviewTypePending` before clearing a leftover review request. The comment creation that follows has no such test.

Back in `pull_service.SubmitReview` (`services/pull/review.go:338-354`) the same comment is handed to `notify_service.PullRequestReview` and each line comment to `notify_service.PullRequestCodeComment`, as for a submitted review. The feed notifier (`services/feed/notifier.go:207`) turns these into `comment_pull` actions carrying the draft text, which is where the activity-feed and RSS/Atom entries come from.

So a pending review created this way owns a `CommentTypeReview` comment, and nothing that reads timeline comments looks at the type of the linked review:

- The conversation page renders the content of every `CommentTypeReview` comment (`routers/web/repo/issue_view.go:686`) and then loads the linked review's line comments with `comment.Review.LoadCodeComments(ctx)` (`routers/web/repo/issue_view.go:788`). That goes to `fetchCodeCommentsByReview(ctx, r.Issue, nil, r, false)` (`models/issues/review.go:162`), i.e. with a concrete review, and the pending filter only applies when no review is given:

  ```go
  // models/issues/comment_code.go:107
  // If the review is pending only the author can see the comments (except if the review is set)
  if review.ID == 0 && re.Type == ReviewTypePending &&
  	(currentUser == nil || currentUser.ID != re.ReviewerID) {
  	continue
  }
  ```

  The template prints the entry like a submitted comment review (`templates/repo/issue/view_content/comments.tmpl:386-392`, type 0 falls into the `else` branch).
- `ListIssueCommentsAndTimeline` returns every comment except `CommentTypeCode` (`routers/api/v1/repo/issue_comment.go:203`).

The places that do know about drafts hide this review: `ToPullReviewList` skips pending reviews of other users (`services/convert/pull_review.go:69`), `prepareSingleReview` answers 404 to other signed-in users (`routers/api/v1/repo/pull_review.go:730`), and the diff view loads comments through `FetchCodeComments` (`models/issues/comment_code.go:22`), which passes no review, so the filter above applies.

No other caller sends a pending review through `SubmitReview`. A draft started in the web diff view only calls `pull_service.CreateCodeComment(..., !form.SingleReview, ...)` (`routers/web/repo/pull_review.go:90-101`)

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
