-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
go-gitea/gitea
#399Labels
💊 bugSomething isn't workingSomething isn't working🔒 securityCategorizes as related to securityCategorizes as related to security
Milestone
Description
As my previous report sent to the email that you specified to send vulnerabilities was ignored for more than a month, I see the need to report the following vulnerability through this method. Please excuse me if this causes you any inconvenience.
- Gogs version (or commit ref): 0.9.99.0915
- Git version: the one that your demo site uses as of 16th Dec 2016
- Operating system: same as above answer
- Database: same as above answer
- PostgreSQL
- MySQL
- SQLite
- Can you reproduce the bug at https://try.gogs.io:
- Log gist:
Description
Ability to delete arbitrary repository's releases
I found that I'm able to delete arbitrary releases from any Gogs instance in which I've a registered account.
To reproduce this vulnerability, please, follow this steps:
- Create an account for attacker, let's call this account
gogsreporteA. - Create an account for victim, let's call this account
gogsreporteB. - Activate them both.
- Login to userA and create a
repositorywith any values you want. Then create areleaseof it. - Login to userB and create a
repository(private or not, it's your choice) with any values you want. Then create areleaseof it. - Now, once it has been created, turn on any http traffic proxy with the ability to intercept traffic (Burp Suite was my choice).
- Enable the proxy and then, delete the
releaseyou created in step 3. (thegogsreporteA'srelease). - Now the request will look like: (see below)
- Modify the
idparameter and put the release ID from our victim (gogsreporteB). But... you do not know it, right? See that it is a numeric ID, we could bruteforce it (Burp's intruder or simple python script), Let's assume we know it. - Put that ID in the request and forward it.
- The
gogsreporteB's release was removed. - Profit (?)
POST /gogsreporteA/usedtohackotheruser/releases/delete HTTP/1.1
Host: try.gogs.io
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 73
Cookie: lang=en-US; i_like_gogits=8ea2647e8d8e44fa; _csrf=8zS9PCrDiSOtu13AOdo1jQPujE06MTQ4MTg0NDM2MzgyMzI5ODUwMw%3D%3D
DNT: 1
Connection: close
_csrf=8zS9PCrDiSOtu13AOdo1jQPujE06MTQ4MTg0NDM2MzgyMzI5ODUwMw%3D%3D&id=[VICTIM-REPO-RELEASE-ID-HERE]
Kind regards,
Miguel Ángel Jimeno
Metadata
Metadata
Assignees
Labels
💊 bugSomething isn't workingSomething isn't working🔒 securityCategorizes as related to securityCategorizes as related to security