GHSA-m932-crvm-gcp5

Suggest an improvement
Source
https://github.com/advisories/GHSA-m932-crvm-gcp5
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-m932-crvm-gcp5/GHSA-m932-crvm-gcp5.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-m932-crvm-gcp5
Aliases
Downstream
Published
2026-07-21T20:59:14Z
Modified
2026-07-27T17:11:23Z
Severity
  • 2.7 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
Summary
Gitea: Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service
Details

Summary

The AddTime API handler continues execution after an error returned by GetUserByName().

When a repository administrator specifies a non-existent user name, an error response is generated but execution does not stop. Subsequent code dereferences a nil user pointer, resulting in a runtime panic.

Details

Affected endpoint:

POST /api/v1/repos/{owner}/{repo}/issues/{index}/times

Affected file:

routers/api/v1/repo/issue_tracked_time.go

Relevant code:

user, err = user_model.GetUserByName(ctx, form.User)
if err != nil {
    ctx.APIErrorInternal(err)
    // missing return
}

Execution continues to:

trackedTime, err := issues_model.AddTime(
    ctx,
    user,
    issue,
    form.Time,
    created,
)

When GetUserByName() fails, user is nil.

The subsequent call dereferences the nil pointer and triggers a runtime panic.

Proof of Concept

Using a repository administrator account:

POST /api/v1/repos/owner/repo/issues/1/times
Content-Type: application/json

{
  "time": 3600,
  "user_name": "nonexistent_user_xyz"
}

Result:

HTTP 500
runtime error: invalid memory address or nil pointer dereference

The stack trace indicates execution reaches the AddTime code path with a nil user object.

Impact

An authenticated repository administrator can repeatedly trigger server-side panics through the affected endpoint.

Depending on deployment configuration and panic recovery behavior, this may result in request failures, stack trace disclosure, excessive log generation, or degraded service availability.

Suggested Fix

Add a return statement after the error response:

user, err = user_model.GetUserByName(ctx, form.User)
if err != nil {
    ctx.APIErrorInternal(err)
    return
}
Database specific
{
    "cwe_ids": [
        "CWE-476"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-21T20:59:14Z",
    "nvd_published_at": null,
    "severity": "LOW"
}
References

Affected packages

Go / code.gitea.io/gitea

Package

Name
code.gitea.io/gitea
View open source insights on deps.dev
Purl
pkg:golang/code.gitea.io/gitea

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.27.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-m932-crvm-gcp5/GHSA-m932-crvm-gcp5.json"