Internal Server Error while using Content-Type=multipart/form-data; boundary=cats on /v1/user/keys #8950

Closed
opened 2025-11-02 08:23:54 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @ludovicianul on GitHub (May 13, 2022).

Description

Description

While doing some fuzzing using https://github.com/Endava/cats I discovered an issue for the /v1/user/keys" endpoint. Doing a POST with multipart/form-data; boundary=cats Content-Type results in a 500, rather that something more meaningful.

You can reproduce the issue using (just replace $token with your own token):

cats replay Test1246.json

Test1246.json.zip

Gitea Version

1.17.0+dev-573-ge45738e3c

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Onlinehttps://try.gitea.io/

Database

No response

Originally created by @ludovicianul on GitHub (May 13, 2022). ### Description ### Description While doing some fuzzing using https://github.com/Endava/cats I discovered an issue for the `/v1/user/keys"` endpoint. Doing a POST with `multipart/form-data; boundary=cats` `Content-Type` results in a 500, rather that something more meaningful. You can reproduce the issue using (just replace $token with your own token): `cats replay Test1246.json` [Test1246.json.zip](https://github.com/go-gitea/gitea/files/8686686/Test1246.json.zip) ### Gitea Version 1.17.0+dev-573-ge45738e3c ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? [Online](https://try.gitea.io)https://try.gitea.io/ ### Database _No response_
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 08:23:54 -06:00
Author
Owner

@zeripath commented on GitHub (May 14, 2022):

Would it be possible to see some logs for this?

@zeripath commented on GitHub (May 14, 2022): Would it be possible to see some logs for this?
Author
Owner

@wxiaoguang commented on GitHub (Oct 7, 2022):

It could be reproduced by:

curl -v -XPOST -H "Authorization: token $token" -H "Content-Type: multipart/form-data; boundary=cats" "https://try.gitea.io/api/v1/user/keys"
@wxiaoguang commented on GitHub (Oct 7, 2022): It could be reproduced by: ``` curl -v -XPOST -H "Authorization: token $token" -H "Content-Type: multipart/form-data; boundary=cats" "https://try.gitea.io/api/v1/user/keys" ```
Author
Owner

@wxiaoguang commented on GitHub (Oct 7, 2022):

panic here:

image

@wxiaoguang commented on GitHub (Oct 7, 2022): panic here: ![image](https://user-images.githubusercontent.com/2114189/194555519-82494aac-6b48-40fa-bec4-155e052f5830.png)
Author
Owner

@zeripath commented on GitHub (Oct 9, 2022):

PR to prevent the NPE in binding https://gitea.com/go-chi/binding/pulls/13

@zeripath commented on GitHub (Oct 9, 2022): PR to prevent the NPE in binding https://gitea.com/go-chi/binding/pulls/13
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8950