GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (1410)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

protected/extensions/eauth/EOAuthService.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * EOAuthService class file.
4
 *
5
 * @author Maxim Zemskov <[email protected]>
6
 * @link http://github.com/Nodge/yii-eauth/
7
 * @license http://www.opensource.org/licenses/bsd-license.php
8
 */
9
10
require_once 'EAuthServiceBase.php';
11
12
/**
13
 * EOAuthService is a base class for all OAuth providers.
14
 *
15
 * @package application.extensions.eauth
16
 */
17
abstract class EOAuthService extends EAuthServiceBase implements IAuthService {
18
19
	/**
20
	 * @var EOAuthUserIdentity the OAuth library instance.
21
	 */
22
	private $auth;
23
24
25
	/**
26
	 * @var string OAuth2 client id.
27
	 */
28
	protected $key;
29
30
	/**
31
	 * @var string OAuth2 client secret key.
32
	 */
33
	protected $secret;
34
35
	/**
36
	 * @var string OAuth scopes.
37
	 */
38
	protected $scope = '';
39
40
	/**
41
	 * @var array Provider options. Must contain the keys: request, authorize, access.
42
	 */
43
	protected $providerOptions = array(
44
		'request' => '',
45
		'authorize' => '',
46
		'access' => '',
47
	);
48
49
50
	/**
51
	 * Initialize the component.
52
	 *
53
	 * @param EAuth $component the component instance.
54
	 * @param array $options properties initialization.
55
	 */
56
	public function init($component, $options = array()) {
57
		parent::init($component, $options);
58
59
		$this->auth = new EOAuthUserIdentity(array(
60
			'scope' => $this->scope,
61
			'key' => $this->key,
62
			'secret' => $this->secret,
63
			'provider' => $this->providerOptions,
64
		));
65
66
		// Try to restore access token and customer from session.
67
		$this->restoreCredentials();
68
	}
69
70
	/**
71
	 * Authenticate the user.
72
	 *
73
	 * @return boolean whether user was successfuly authenticated.
74
	 * @throws EAuthException
75
	 */
76
	public function authenticate() {
77
		$this->authenticated = $this->auth->authenticate();
78
		$error = $this->auth->getError();
79
		if (isset($error)) {
80
			throw new EAuthException($error);
81
		}
82
83
		// In case of successful authentication save access token and
84
		// customer to session.
85
		if ($this->authenticated) {
86
			$this->saveCredentials();
87
		}
88
89
		return $this->getIsAuthenticated();
90
	}
91
92
	/**
93
	 * Returns the OAuth consumer.
94
	 *
95
	 * @return object the consumer.
96
	 */
97
	protected function getConsumer() {
98
		return $this->auth->getProvider()->consumer;
99
	}
100
101
	/**
102
	 * Returns the OAuth access token.
103
	 *
104
	 * @return string the token.
105
	 */
106
	protected function getAccessToken() {
107
		return $this->auth->getProvider()->token;
108
	}
109
110
	/**
111
	 * Save access credentials to the session.
112
	 */
113
	protected function saveCredentials() {
114
115
		$this->setState('auth_token', $this->getAccessToken());
116
		$this->setState('auth_consumer', $this->getConsumer());
117
	}
118
119
	/**
120
	 * Restore access credentials from the session.
121
	 *
122
	 * @return boolean whether the access credentials were successfully restored.
123
	 */
124
	protected function restoreCredentials() {
125
		if (!$this->authenticated) {
126
			if ($this->hasState('auth_consumer') && $this->hasState('auth_token')) {
127
				$this->auth->getProvider()->consumer = $this->getState('auth_consumer');
128
				$this->auth->getProvider()->token = $this->getState('auth_token');
129
				$this->authenticated = true;
130
			}
131
			else {
132
				$this->authenticated = false;
133
			}
134
		}
135
136
		return $this->authenticated;
137
	}
138
139
	/**
140
	 * Initializes a new session and return a cURL handle.
141
	 *
142
	 * @param string $url url to request.
143
	 * @param array $options HTTP request options. Keys: query, data, referer.
144
	 * @param boolean $parseJson Whether to parse response in json format.
0 ignored issues
show
There is no parameter named $parseJson. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
145
	 * @return cURL handle.
146
	 */
147
	protected function initRequest($url, $options = array()) {
148
		$ch = parent::initRequest($url, $options);
149
		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
150
		return $ch;
151
	}
152
153
	/**
154
	 * Returns the protected resource.
155
	 *
156
	 * @param string $url url to request.
157
	 * @param array $options HTTP request options. Keys: query, data, referer.
158
	 * @param boolean $parseJson Whether to parse response in json format.
159
	 * @return string the response.
160
	 * @see makeRequest
161
	 */
162
	public function makeSignedRequest($url, $options = array(), $parseJson = true) {
163
		if (!$this->getIsAuthenticated()) {
164
			throw new CHttpException(401, Yii::t('eauth', 'Unable to complete the request because the user was not authenticated.'));
165
		}
166
167
		$consumer = $this->getConsumer();
168
		$signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();
169
		$token = $this->getAccessToken();
170
171
		$query = null;
172
		if (isset($options['query'])) {
173
			$query = $options['query'];
174
			unset($options['query']);
175
		}
176
177
		$request = OAuthRequest::from_consumer_and_token($consumer, $token, isset($options['data']) ? 'POST' : 'GET', $url, $query);
178
		$request->sign_request($signatureMethod, $consumer, $token);
179
180
		return $this->makeRequest($request->to_url(), $options, $parseJson);
181
	}
182
}