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

Multiple JSONs returned when doing DELETE on /v1/user/keys/2 with a non-existing key #19398

Closed
ludovicianul opened this issue Apr 13, 2022 · 1 comment · Fixed by #19443
Closed
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented modifies/api This PR adds API routes or modifies them type/bug
Milestone

Comments

@ludovicianul
Copy link

Description

While doing some fuzzing using https://github.com/Endava/cats I discovered an issue for the /v1/user/keys/ endpoint. Doing a DELETE with non existing key return 2 JSONs in the same body.

{
    "message": "",
    "url": "https://try.gitea.io/api/swagger"
}
{
    "errors": null,
    "message": "The target couldn't be found.",
    "url": "https://try.gitea.io/api/swagger"
}

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

cats replay Test243.json

Or doing a curl at https://try.gitea.io/api/v1/user/keys/2 for example.
Test243.json.zip

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
@wxiaoguang
Copy link
Contributor

Well, a return is lost in code again

@wxiaoguang wxiaoguang added this to the 1.17.0 milestone Apr 14, 2022
@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Apr 14, 2022
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 20, 2022
- Add a return for the first "block" of errors, which fixes the double
error messages.
- Add a return for `externallyManaged`.
- Resolves go-gitea#19398
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 20, 2022
- Backport go-gitea#19443
  - Add a return for the first "block" of errors, which fixes the double error messages.
  - Add a return for `externallyManaged`.
  - Resolves go-gitea#19398
zeripath pushed a commit that referenced this issue Apr 20, 2022
- Backport #19443
  - Add a return for the first "block" of errors, which fixes the double error messages.
  - Add a return for `externallyManaged`.
  - Resolves #19398

Co-authored-by: 6543 <6543@obermui.de>
6543 pushed a commit that referenced this issue Apr 21, 2022
- Add a return for the first "block" of errors, which fixes the double
error messages.
- Add a return for `externallyManaged`.
- Resolves #19398
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
- Add a return for the first "block" of errors, which fixes the double
error messages.
- Add a return for `externallyManaged`.
- Resolves go-gitea#19398
@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
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented 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.

3 participants