Описание
Gitea: Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service
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:
Affected file:
Relevant code:
Execution continues to:
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:
Result:
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:
Пакеты
code.gitea.io/gitea
< 1.27.0
1.27.0
Связанные уязвимости
Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service
Null Pointer Dereference in AddTime API Causes Authenticated Denial of Service