-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
pr/breakingMerging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!topic/securitySomething leaks user information or is otherwise vulnerable. Should be fixed!Something leaks user information or is otherwise vulnerable. Should be fixed!type/enhancementAn improvement of existing functionalityAn improvement of existing functionality
Milestone
Description
- Gitea version (or commit ref): 1.3.0
- Git version: 2.7.4
- Operating system: osx
- Database (use
[x]
):- PostgreSQL
- [ x] MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- [ x] Not relevant
- Log gist:
Description
After creating an application token, I checked the database, and the token is stored in plaintext in the database! This is bad because anyone that may gain access to the database would have access to all tokens.
Suggested fix is just to hash the token before storing it locally, for example, the token you give the user is 30ab72898b83c8549e510ee36cde7c7d7be01d97
becomes A6DCC734FFB0E5A1E871E10C1B2A48CA60E9104F8F61FD41BD1DC01789062D81
when ran through a sha256 hash.
This way you can take what the user provides turing an authorized token use, and run the value they give you through sha256, and validate that the result matches what's in your database.
...
Screenshots
Metadata
Metadata
Assignees
Labels
pr/breakingMerging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!topic/securitySomething leaks user information or is otherwise vulnerable. Should be fixed!Something leaks user information or is otherwise vulnerable. Should be fixed!type/enhancementAn improvement of existing functionalityAn improvement of existing functionality