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/EOpenIDService.php (6 issues)

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
 * EOpenIDService 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
 * EOpenIDService is a base class for all OpenID providers.
14
 *
15
 * @package application.extensions.eauth
16
 */
17
abstract class EOpenIDService extends EAuthServiceBase implements IAuthService {
18
19
	/**
20
	 * @var string a pattern that represents the part of URL-space for which an OpenID Authentication request is valid.
21
	 * See the spec for more info: http://openid.net/specs/openid-authentication-2_0.html#realms
22
	 * Note: a pattern can be without http(s):// part
23
	 */
24
	public $realm;
25
26
	/**
27
	 * @var LightOpenID the openid library instance.
28
	 */
29
	private $auth;
30
31
	/**
32
	 * @var string the OpenID authorization url.
33
	 */
34
	protected $url;
35
36
	/**
37
	 * @var array the OpenID required attributes.
38
	 */
39
	protected $requiredAttributes = array();
40
41
	/**
42
	 * @var array the OpenID optional attributes.
43
	 */
44
	protected $optionalAttributes = array();
45
46
47
	/**
48
	 * Initialize the component.
49
	 *
50
	 * @param EAuth $component the component instance.
51
	 * @param array $options properties initialization.
52
	 */
53
	public function init($component, $options = array()) {
54
		parent::init($component, $options);
55
		$this->auth = Yii::app()->loid->load();
56
	}
57
58
	/**
59
	 * Authenticate the user.
60
	 *
61
	 * @return boolean whether user was successfuly authenticated.
62
	 * @throws EAuthException
63
	 * @throws CHttpException
64
	 */
65
	public function authenticate() {
66
67
		if (!empty($_REQUEST['openid_mode'])) {
68
			switch ($_REQUEST['openid_mode']) {
69
				case 'id_res':
70
					try {
71
						$this->auth->returnUrl = $this->getState('returnUrl');
72
						if ($this->auth->validate()) {
73
							$this->attributes['id'] = $this->auth->identity;
74
75
							$attributes = $this->auth->getAttributes();
76
							foreach ($this->requiredAttributes as $key => $attr) {
77
								if (isset($attributes[$attr[1]])) {
78
									$this->attributes[$key] = $attributes[$attr[1]];
79
								}
80 View Code Duplication
								else {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
81
									throw new EAuthException(Yii::t('eauth', 'Unable to complete the authentication because the required data was not received.', array('{provider}' => $this->getServiceTitle())));
82
									return false;
0 ignored issues
show
return false; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
83
								}
84
							}
85
86
							foreach ($this->optionalAttributes as $key => $attr) {
87
								if (isset($attributes[$attr[1]])) {
88
									$this->attributes[$key] = $attributes[$attr[1]];
89
								}
90
							}
91
92
							$this->authenticated = true;
93
							return true;
94
						}
95 View Code Duplication
						else {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
96
							throw new EAuthException(Yii::t('eauth', 'Unable to complete the authentication because the required data was not received.', array('{provider}' => $this->getServiceTitle())));
97
							return false;
0 ignored issues
show
return false; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
98
						}
99
					} catch (Exception $e) {
100
						throw new EAuthException($e->getMessage(), $e->getCode());
101
					}
102
					break;
0 ignored issues
show
break; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
103
104
				case 'cancel':
105
					$this->cancel();
106
					break;
107
108
				default:
109
					throw new CHttpException(400, Yii::t('yii', 'Your request is invalid.'));
110
					break;
0 ignored issues
show
break; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
111
			}
112
		}
113
		else {
114
			$this->auth->identity = $this->url; //Setting identifier
115
			$this->auth->required = array(); //Try to get info from openid provider
116
			foreach ($this->requiredAttributes as $attribute) {
117
				$this->auth->required[$attribute[0]] = $attribute[1];
118
			}
119
			foreach ($this->optionalAttributes as $attribute) {
120
				$this->auth->required[$attribute[0]] = $attribute[1];
121
			}
122
123
			if (isset($this->realm)) {
124
				if (!preg_match('#^[a-z]+\://#', $this->realm)) {
125
					$this->auth->realm = 'http' . (Yii::app()->request->getIsSecureConnection() ? 's' : '') . '://' . $this->realm;
126
				}
127
				else {
128
					$this->auth->realm = $this->realm;
129
				}
130
			}
131
			else {
132
				$this->auth->realm = Yii::app()->request->hostInfo;
133
			}
134
135
			$this->auth->returnUrl = Yii::app()->request->hostInfo . Yii::app()->request->url; //getting return URL
136
			$this->setState('returnUrl', $this->auth->returnUrl);
137
138
			try {
139
				$url = $this->auth->authUrl();
140
				Yii::app()->request->redirect($url);
141
			} catch (Exception $e) {
142
				throw new EAuthException($e->getMessage(), $e->getCode());
143
			}
144
		}
145
146
		return false;
147
	}
148
}