Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
gitea

Gitea 28.3.0: a read-only user could steal secrets

Glowing network map of the Earth at night

If you self-host Gitea with Actions enabled, the 28.3.0 release from 1 November deserves more than a routine upgrade. Among its advisories is a High-severity one where an account with nothing but read access can run a workflow of its own choosing as if it were trusted. I run a small Gitea box for private projects, so I read the advisories end to end.

The review commit_id problem

GHSA-32h8-5xqg-h466 (CVE-2026-118386, CVSS 8.1) affects Gitea 1.19.0 through 28.2.0. When someone submits a review on a pull request, they can supply a commit_id. Gitea loads the workflow files from that commit, but the check that decides whether a run needs approval, gets secrets, and gets a write token looks at the reviewed pull request instead. Those two disagree, and the attacker lives in the gap.

According to the advisory, the attacker gets a commit containing a malicious workflow into the base repository, either via a fork pull request or by pushing to refs/for/main/<topic>. They then post a COMMENT review naming that commit on any same-repository pull request, open or merged. The result: approval is skipped, the repository's and owner's Actions secrets are exposed, and GITEA_TOKEN carries write access.

The detail that stuck with me: the advisory states that disabling forks does not prevent the attack. The preconditions are an account, a runner serving the repository, and one same-repository pull request. Registration is disabled by default on the affected commit, so this is mostly a risk where you hand out accounts, but that is exactly how a small team or family instance works.

Stored XSS through artifact headers

GHSA-9v6p-xpcp-7488 (CVE-2026-113429, CVSS 8.7) is a different class of bug in the same release. The v3 artifact upload handler stores the raw Content-Encoding request header unvalidated. On download, Gitea serves that value as the Content-Type, and if it starts with video/ or audio/, the sandbox Content-Security-Policy is dropped and the response is served inline. Per the advisory, Chromium can interpret something like video/mp4,text/html as HTML, so attacker script runs on the Gitea origin.

The victim has to open the direct artifact URL, for instance from a link in an issue; the sandboxed preview on the run page is not exploitable. If that victim is an administrator, the advisory says the attacker can take over the instance. The reporter only tested Chromium, and the advisory lists no workarounds.

What I'm doing about it

  • Both are patched in 28.3.0, so upgrading is the fix. The release notes also list further hardening around public-only token scope and access checks.
  • Until then, I would only worry about Actions runners attached to repos where untrusted accounts can comment on pull requests.
  • After upgrading, expect review-triggered runs to report refs/pull/N/head as their ref, per the advisory's description of the fix. If you have workflows keyed on the old behaviour, check them.

The practical lesson is an old one: a CI system has two trust decisions, which code runs and with what privileges, and they have to be derived from the same object. Here they weren't. If your instance still pins a floating tag, this is a good week to check which version is actually running before you assume it has patched itself.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.