llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · gogs.io/gogs

GHSA-VGHX-GP7M-XPX2

CSRF: Milestone open/close via GET request (CWE-352)

Sin parche publicado
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición5 dDesde la divulgación, 16 nov 2026, 10:29 a. m.
Detección2 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (baja) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
Nivel de alerta: llama en hamaca.Tranquilidad nivel Chimborazo nevado.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
16 nov 26
18 nov 26
22 nov 26
16 nov 26
18 nov 26
19 nov 26
20 nov 26
22 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-VGHX-GP7M-XPX2 divulgada
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
GitHub

Vulnerability Details

File: `cmd/gogs/internal/web/web.go` (route registration), `internal/route/repo/issue.go:1228` (`ChangeMilestonStatus`)
Line: `cmd/gogs/internal/web/web.go:431`
CWE: CWE-352 — Cross-Site Request Forgery (CSRF)
Severity: Low
CVSS: 4.3 — CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N

### Root Cause
`ChangeMilestonStatus` performs a state-changing operation (closing or
reopening a repository milestone) and is registered as a `GET` route:

m.Group("/milestones", func() {
    ...
    m.Get("/:id/:action", repo.ChangeMilestonStatus) // action = "open" | "close"
    m.Post("/delete", repo.DeleteMilestone)
}, reqRepoWriter, context.RepoRef())

CSRF token protection (`[session] CSRF_COOKIE_NAME`) was removed from
`main` in PR #8300. The session cookie set by `go-macaron/session`
(`i_like_gogs`) is `HttpOnly; SameSite=Lax` but does not carry any CSRF
token. Under `SameSite=Lax`, the cookie is still sent on a top-level GET
navigation (e.g. the victim clicking a link, or any redirect that results
in a top-level navigation). Because the milestone status change is wired
to `GET`, no token, `Origin`, or `Referer` check is performed, a single
crafted link is sufficient to trigger the state change while the victim is
authenticated.

This is the same class of bug recently fixed in PR #8321 ("Organization
team and member management actions accepted GET requests"), which appears
to have missed this handler.

### Attack Scenario
1. Victim is signed in to a Gogs instance and has write access to
`owner/repo` (collaborator, or org member with write-level team access).
2. Attacker sends the victim a link, e.g.:
`https://gogs.example.com/owner/repo/milestones/3/close`
3. Victim clicks the link while logged in. The browser performs a
top-level GET navigation and sends the `SameSite=Lax` session cookie.
4. `ChangeMilestonStatus` runs with the victim's session and calls
`database.ChangeMilestoneStatus(m, true)`, closing (or reopening, via
`/open`) the milestone without the victim's intent.

### Impact
Unauthorized opening/closing of repository milestones triggered by a
single link click from any authenticated repo writer. No data loss or
privilege escalation, but it is a genuine state-changing CSRF on a `GET`
endpoint in code that has otherwise just had this exact class of issue
fixed elsewhere (#8321).

Vulnerable Code
m.Get("/:id/:action", repo.ChangeMilestonStatus)
<a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}>...</a>

### Recommended Fix
Require `POST` for the status-change route (consistent with the existing
`DeleteMilestone` route) and update the UI to submit it via `$.post`
instead of a plain link:

m.Post("/:id/:action", repo.ChangeMilestonStatus)
<a href="#" class="link-action" data-url="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}>...</a>
$(".link-action").click(function() {
  $.post($(this).data("url")).done(function() {
    window.location.reload();
  });
  return false;
});

### Verification
Dynamically confirmed on `gogs/gogs:edge` (build commit
`515f45ae00db60b996aedb9e2c03fbbdb80cfd09`, matching `main` HEAD) in a
Docker lab on 2026-06-10:
- Created repo `gogsadmin/testrepo`, milestone "Test Milestone" (id=1, open).
- Sent `GET /gogsadmin/testrepo/milestones/1/close` with only the session
cookie and forged cross-site `Origin`/`Referer` headers (simulating a
cross-site top-level navigation under `SameSite=Lax`). No CSRF token or
`X-XSRF-TOKEN` header was sent.
- Server responded `302 Found` to `/gogsadmin/testrepo/milestones?state=closed`,
and the milestone was confirmed closed (moved from the open list to the
closed list) — proving the GET request alone mutated state.

A fix has been prepared (branch `fix/milestone-status-csrf`, commit
`9b2affe28`) and can be shared for review.

Versiones

Rangos afectados

Afectada Corregida Última
gogs.io/gogs< 0.15.0
v0.13.3
0.15.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogogs.io/gogs
Sin parche — — v0.13.3 afectada
Versiones corregidas0.15.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/gogs/gogs/security/advisories/GHSA-vghx-gp7m-xpx2

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.