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

[SECURITY!] obs-service-tar_scm leaks credentials. #373

Open
seife opened this issue Oct 7, 2020 · 0 comments
Open

[SECURITY!] obs-service-tar_scm leaks credentials. #373

seife opened this issue Oct 7, 2020 · 0 comments

Comments

@seife
Copy link

seife commented Oct 7, 2020

auth_url modifies self.url and adds credentials.

Later, self.url is used to read / write _servicedata, e.g. when changesgenerate is enabled.

Right now, luckily, this fails with

service obs_scm failed:
File _servicedata is missing tar_scm with URL 'https://github.my.instance/my-project/my-package'

The generated _servicedata has url=https://user:passwort@github.my.instance/my-project/my-package

But I would not bet that there are other methods of generating a _servicedata file which do not fail, and so the possibility of the credentials leaking is very high.

trivial fix:

Index: b/TarSCM/scm/git.py
===================================================================
--- a/TarSCM/scm/git.py
+++ b/TarSCM/scm/git.py
@@ -102,6 +102,7 @@ class Git(Scm):
 
     def fetch_upstream_scm(self):
         """SCM specific version of fetch_uptream for git."""
+        url = self.url
         self.auth_url()
         # clone if no .git dir exists
         command = self._get_scm_cmd() + ['clone', self.url, self.clone_dir]
@@ -131,6 +132,7 @@ class Git(Scm):
                 self._get_scm_cmd() + ['checkout', self.revision],
                 cwd=self.clone_dir
             )
+        self.url = url
 
     def fetch_specific_revision(self):
         if self.revision and not self._ref_exists(self.revision):

however, it needs to be investigated if "package-meta" feature will also leak the credentials in .git/config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant