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 (9)

Security Analysis    no request data  

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.

src/Wsdl/WsdlManager.php (1 issue)

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
namespace Skautis\Wsdl;
4
5
use Skautis\EventDispatcher\EventDispatcherInterface;
6
use Skautis\Config;
7
use Skautis\User;
8
9
/**
10
 * Třída pro správu webových služeb SkautISu
11
 */
12
class WsdlManager
13
{
14
15
    /**
16
     * @var WebServiceFactoryInterface
17
     */
18
    protected $webServiceFactory;
19
20
    /**
21
     * @var Config
22
     */
23
    protected $config;
24
25
    /**
26
     * Aliasy webových služeb pro rychlý přístup
27
     *
28
     * @var array
29
     */
30
    protected $aliases = [
31
        "user" => "UserManagement",
32
        "usr" => "UserManagement",
33
        "org" => "OrganizationUnit",
34
        "app" => "ApplicationManagement",
35
        "event" => "Events",
36
        "events" => "Events",
37
    ];
38
39
    /**
40
     * Dostupné webové služby SkautISu
41
     *
42
     * @var array
43
     */
44
    protected $supportedWebServices = [
45
        "ApplicationManagement",
46
        "ContentManagement",
47
        "DocumentStorage",
48
        "Evaluation",
49
        "Events",
50
        "Exports",
51
        "GoogleApps",
52
        "Grants",
53
        "Insurance",
54
        "Journal",
55
        "Material",
56
        "Message",
57
        "OrganizationUnit",
58
        "Power",
59
        "Reports",
60
        "Summary",
61
        "Task",
62
        "Telephony",
63
        "UserManagement",
64
        "Vivant",
65
        "Welcome",
66
    ];
67
68
    /**
69
     * @var array
70
     */
71
    protected $webServiceListeners = [];
72
73
    /**
74
     * Pole aktivních webových služeb
75
     *
76
     * @var array
77
     */
78
    protected $webServices = [];
79
80
81
    /**
82
     * @param WebServiceFactoryInterface $webServiceFactory továrna pro vytváření objektů webových služeb
83
     * @param Config $config
84
     */
85 3
    public function __construct(WebServiceFactoryInterface $webServiceFactory, Config $config)
86
    {
87 3
        $this->webServiceFactory = $webServiceFactory;
88 3
        $this->config = $config;
89 3
    }
90
91
    /**
92
     * @return Config
93
     */
94
    public function getConfig()
95
    {
96
        return $this->config;
97
    }
98
99
    /**
100
     * Získá objekt webové služby
101
     *
102
     * @param string $name jméno nebo alias webové služby
103
     * @param string|null $loginId skautIS login token
104
     * @return WebServiceInterface
105
     */
106 1
    public function getWebService($name, $loginId = null)
107
    {
108 1
        $name = $this->getWebServiceName($name);
109 1
        $key = $loginId . '_' . $name . ($this->config->isTestMode() ? '_Test' : '');
110
111 1
        if (!isset($this->webServices[$key])) {
112 1
            $options = $this->config->getSoapOptions();
113 1
            $options[User::ID_LOGIN] = $loginId;
114 1
            $this->webServices[$key] = $this->createWebService($name, $options);
115 1
        }
116
117 1
        return $this->webServices[$key];
118
    }
119
120
    /**
121
     * Vytváří objekt webové služby
122
     *
123
     * @param string $name jméno webové služby
124
     * @param array $options volby pro SoapClient
125
     * @return WebService|mixed
126
     */
127 1
    public function createWebService($name, array $options = [])
128
    {
129 1
        $webService = $this->webServiceFactory->createWebService($this->getWebServiceUrl($name), $options);
130
131 1
        if ($webService instanceof EventDispatcherInterface) {
132
            // Zaregistruj listenery na vytvořeném objektu webové služby, pokud je to podporováno
133
            foreach ($this->webServiceListeners as $listener) {
134
                $webService->subscribe($listener['eventName'], $listener['callback']);
135
            }
136
        }
137
138 1
        return $webService;
139
    }
140
141
    /**
142
     * Vrací celé jméno webové služby
143
     *
144
     * @param string $name jméno nebo alias webové služby
145
     * @return string
146
     * @throws WsdlException
147
     */
148 1
    protected function getWebServiceName($name)
149
    {
150 1
        if (in_array($name, $this->supportedWebServices)) {
151
            // služba s daným jménem existuje
152 1
            return $name;
153
        }
154
        if (array_key_exists($name, $this->aliases) && in_array($this->aliases[$name], $this->supportedWebServices)) {
155
            // je definovaný alias pro tuto službu
156
            return $this->aliases[$name];
157
        }
158
        throw new WsdlException("Web service '$name' not found.");
159
    }
160
161
    /**
162
     * Vrací URL webové služby podle jejího jména
163
     *
164
     * @param string $name celé jméno webové služby
165
     * @return string
166
     */
167 1
    protected function getWebServiceUrl($name)
168
    {
169 1
        return $this->config->getBaseUrl() . "JunakWebservice/" . rawurlencode($name) . ".asmx?WSDL";
170
    }
171
172
    /**
173
     * Vrací seznam webových služeb, které podporuje
174
     *
175
     * @return array
176
     */
177 1
    public function getSupportedWebServices()
178
    {
179 1
        return $this->supportedWebServices;
180
    }
181
182
    /**
183
     * @return bool
184
     */
185
    public function isMaintenance()
186
    {
187
        $headers = get_headers($this->getWebServiceUrl("UserManagement"));
188
        return !$headers || !in_array('HTTP/1.1 200 OK', $headers);
0 ignored issues
show
Bug Best Practice introduced by
The expression $headers of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
189
    }
190
191
    /**
192
     * Přidá listener na spravovaných vytvářených webových služeb.
193
     *
194
     * @param string $eventName
195
     * @param callable $callback
196
     */
197
    public function addWebServiceListener($eventName, callable $callback)
198
    {
199
        $this->webServiceListeners[] = [
200
            'eventName' => $eventName,
201
            'callback' => $callback,
202
        ];
203
    }
204
}
205