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

Migration: Spawned git process includes username and password in cleartext #3966

Closed
2 of 7 tasks
sebastian-sauer opened this issue May 15, 2018 · 2 comments
Closed
2 of 7 tasks
Labels
topic/security Something leaks user information or is otherwise vulnerable. Should be fixed!

Comments

@sebastian-sauer
Copy link
Contributor

sebastian-sauer commented May 15, 2018

  • Operating system: Debian 9.4
  • Gitea version (or commit ref): 1.4.1
  • Git version: 2.11.0
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: << not needed >>

Description

When migrating a password protected repository via the migrate functionality git will be spawned on the command line with username & password in the remote url, resulting in processes visible with username & password in clear text.

For example (just one spawned process by git):

git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning --no-progress https://user:password@remote-repo/git.git

Possible workaround: Use a temporary file to store the password & username and use core.askpass when spawning git processes (as jenkins and other CI tools do for example)

@techknowlogick techknowlogick added the topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! label May 15, 2018
@jonasfranz
Copy link
Member

jonasfranz commented May 24, 2018

I propose the following flow:

  1. Create a .gitea-credentials file with read-write permissions in the gitea directory.
  2. Save the credentials in the following format: https://USERNAME:PASSWORD@HOST
  3. Activate storage helper: git config credential.helper 'store --file=$GITEA_PATH/.gitea_credentials'

An alternative would be to write a custom helper which is connected to the database.

@6543
Copy link
Member

6543 commented Sep 17, 2020

not the case anymore

@6543 6543 closed this as completed Sep 17, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/security Something leaks user information or is otherwise vulnerable. Should be fixed!
Projects
None yet
Development

No branches or pull requests

4 participants