Loading advisory.
Loading advisory.
Gitea: Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service
The AddTime API handler continues execution after an error returned by GetUserByName().
Published 2026-07-21 20:59 UTC · Modified 2026-08-14 17:40 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| code.gitea.io/gitea | Go | < 1.27.0 | 1.27.0 | go get code.gitea.io/gitea@v1.27.0 |
| gitea.dev | Go | < 1.27.0 | 1.27.0 | go get gitea.dev@v1.27.0 |
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.
Affected endpoint:
POST /api/v1/repos/{owner}/{repo}/issues/{index}/timesAffected file:
routers/api/v1/repo/issue_tracked_time.goRelevant 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.
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 dereferenceThe stack trace indicates execution reaches the AddTime code path with a nil user object.
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.
Add a return statement after the error response:
user, err = user_model.GetUserByName(ctx, form.User)
if err != nil {
ctx.APIErrorInternal(err)
return
}No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.005 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.005 | first score | v2026.06.15 |