From 6419266ea3a25332f2070bf5b6363f1d299a23fc Mon Sep 17 00:00:00 2001 From: Gennady Feldman Date: Mon, 28 Oct 2013 15:32:51 -0400 Subject: [PATCH] Validate the originUrl against the list of 'github-domains' from the config. --- src/Composer/Util/GitHub.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Util/GitHub.php b/src/Composer/Util/GitHub.php index ed988894b..49e56f8c9 100644 --- a/src/Composer/Util/GitHub.php +++ b/src/Composer/Util/GitHub.php @@ -51,6 +51,10 @@ class GitHub */ public function authorizeOAuth($originUrl) { + if (!in_array($originUrl, $this->config->get('github-domains'))) { + return false; + } + // if available use token from git config if (0 === $this->process->execute('git config github.accesstoken', $output)) { $this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic');