Skip to content

security: require authentication for attachment uploads - #8128

Merged
unknwon merged 1 commit into
mainfrom
security/fix-unauthenticated-file-upload
Jan 31, 2026
Merged

unknwon merged 1 commit into
mainfrom
security/fix-unauthenticated-file-upload

Conversation

@unknwon

@unknwon unknwon commented Jan 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix unauthenticated file upload vulnerability (GHSA-fc3h-92p8-h36f)
  • Move /issues/attachments and /releases/attachments endpoints from ignSignIn to reqSignIn route group

Background

The /issues/attachments and /releases/attachments endpoints were placed in the ignSignIn route group, which only enforces authentication when RequireSignInView is enabled. Since the default is disabled, anonymous users could upload arbitrary files to the server.

This could be exploited for:

  • Disk exhaustion via repeated uploads
  • Using the Gogs instance as a public file host
  • Hosting malware or phishing payloads

🤖 Generated with Claude Code

Move `/issues/attachments` and `/releases/attachments` endpoints from
the `ignSignIn` route group to a new group protected by `reqSignIn`.

Previously, these endpoints were accessible without authentication when
`RequireSignInView` was disabled (the default), allowing anonymous users
to upload arbitrary files to the server.

Reported-by: brelinsky-openai
Reference: GHSA-fc3h-92p8-h36f

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@unknwon
unknwon merged commit 628216d into main Jan 31, 2026
7 checks passed
@unknwon
unknwon deleted the security/fix-unauthenticated-file-upload branch January 31, 2026 19:40
@unknwon unknwon added this to the 0.14.0 milestone Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant