Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server error returned when doing a POST at /v1/user/repos with invalid data #19399

Closed
ludovicianul opened this issue Apr 13, 2022 · 0 comments · Fixed by #19445
Closed
Labels
modifies/api This PR adds API routes or modifies them type/bug

Comments

@ludovicianul
Copy link

Description

While doing some fuzzing using https://github.com/Endava/cats I discovered an issue for the /v1/user/repos endpoint. Doing a POST with invalid data results in a 500, rather that something more meaningful.

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

cats replay Test245.json

Test245.json.zip

Or using the following payload:

{
  "auto_init": true,
  "template": true,
  "issue_labels": "eEitLJaqLAv8GH",
  "license": "EJ4mZaqiB",
  "private": true,
  "trust_model": "default",
  "gitignores": "PnCQ60J8mksk8",
  "name": "L6fxpx",
  "description": "16udnqV6IumI",
  "default_branch": "J7ysZ6klvPLAP1G",
  "readme": "xN9l4LLHnL",
  "catsFuzzyField": "catsFuzzyField"
}

Gitea Version

1.17.0+dev-423-g4396d0e7c

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?

Using https://try.gitea.io/.

Database

No response

@techknowlogick techknowlogick added the modifies/api This PR adds API routes or modifies them label Apr 13, 2022
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 20, 2022
- Don't return Internal Server error if the user provide incorrect label
template, instead return UnprocessableEntity.
- Resolves go-gitea#19399
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 20, 2022
- Backport go-gitea#19445
  - Don't return Internal Server error if the user provide incorrect label template, instead return UnprocessableEntity.
  - Resolves go-gitea#19399
6543 pushed a commit that referenced this issue Apr 22, 2022
- Don't return Internal Server error if the user provide incorrect label
template, instead return UnprocessableEntity.
- Resolves #19399
6543 pushed a commit that referenced this issue Apr 22, 2022
* Mark TemplateLoading error as "UnprocessableEntity" (#19445)

- Backport #19445
  - Don't return Internal Server error if the user provide incorrect label template, instead return UnprocessableEntity.
  - Resolves #19399

- dep: upgrade: github.com/gogs/chardet
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
- Don't return Internal Server error if the user provide incorrect label
template, instead return UnprocessableEntity.
- Resolves go-gitea#19399
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants