8000 Cross-Site Request Forgery (CSRF) in admin panel · Issue #5367 · gogs/gogs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cross-Site Request Forgery (CSRF) in admin panel #5367

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

Closed
1 of 3 tasks
math1as opened this issue Aug 6, 2018 · 7 comments · Fixed by #5997
Closed
1 of 3 tasks

Cross-Site Request Forgery (CSRF) in admin panel #5367

math1as opened this issue Aug 6, 2018 · 7 comments · Fixed by #5997
Assignees
Labels
🔒 security Categorizes as related to security
Milestone

Comments

@math1as
Copy link
math1as commented Aug 6, 2018
  • Gogs version (or commit ref): <= 0.11.53.0603
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist (usually found in log/gogs.log):

Description

The operations in admin panel could be called with GET method which is vulnearble to CSRF

op

attacker can embed an image tag in issues , when administrator visit the issue , the operation is fired.

see the online demo (attention , if administrator visit it , your ssh key is wipped out)

https://try.gogs.io/hellotester2/12312312313/issues/6

Patch

change the call method of these operations from GET to POST
or enable csrf token for get method.

Discoverer

Wenxu Wu of Tencent's Xuanwu Lab

@unknwon unknwon added the 🔒 security Categorizes as related to security label Aug 14, 2018
@unknwon unknwon added this to the 0.12 milestone Aug 14, 2018
@unknwon unknwon added 💊 bug Something isn't working and removed 💊 bug Something isn't working labels Aug 14, 2018
@beeonthego
Copy link

@math1as Is a CSRF token in query string vulnerable to redirect and theft? A header like referrer-policy may help, but some older browsers may not support this header. Should it be a separate token just for GET routes? What do you think? appreciate your wisdom.

@math1as
Copy link
Author
math1as commented Sep 3, 2018

@beeonthego I think change the method from GET to POST is not a bad idea , POST method in gogs has csrf token to mitigate CSRF attack , since github and gitlab apply it to every operation ,too.

@beeonthego
Copy link

@math1as Thank you. Gogs and Gitea have unconventional use of GET requests to perform actions. Changing them to POST will solve some problems, but it means breaking changes.

By the way, are you a researcher from Tencent's Xuanwu Lab?

@math1as
Copy link
Author
math1as commented Sep 3, 2018

@beeonthego yes, we recently focused on security vulnerabilities in open source software. and hope to help vendors fix these problems :)

@beeonthego
Copy link

@math1as Thank you for the time researching and disclosing them responsibly. I read vulnerabilities reports, coordinate patches internally and submit PRs. Other developers may be doing the same. It takes time to review the PR and merge into a popular repo like this. Please keep up the good work, even if some fixes may take time.

Cheers!

richmahn referenced this issue in unfoldingWord/dcs Feb 4, 2019
* Explicitly disable Git credential helper

If the user running Gitea has configured a credential helper, Git
credentials might leak out of Gitea.

There are two problems with credential helpers when combined with Gitea:

1. Credentials entered by a user when doing a migration or setting up a
   mirror will end up in the credential store. In the worst case, this
   is the plain text file ~/.git-credentials.
2. Credentials in the credential store will be used for migrations and
   mirrors by all users. For example, if user A sets up a mirror, their
   credentials will be stored. If user B later sets up a mirror from the
   same host and does not enter any credentials, user A's credentials
   will be used.

This PR prepends -c credential.helper= to all Git commands to clear the
list of helpers. This requires at least Git version 2.9, as previous
versions will try to load an empty helper instead. For more details, see
git/git@2432137

* Update git module
@NicoleG25
Copy link

Was this issue ever addressed? please note that CVE-2018-15193 was assigned

@unknwon unknwon modified the milestones: 0.13, 0.12 Jan 22, 2020
@unknwon unknwon self-assigned this Mar 21, 2020
@unknwon
Copy link
Member
unknwon commented Mar 21, 2020

Changed method to POST:

image

Thanks again for reporting :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔒 security Categorizes as related to security
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0