Issues (11)

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/wormling/phparia/Resources/Endpoint.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
/*
4
 * Copyright 2014 Brian Smith <[email protected]>.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *      http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace phparia\Resources;
20
21
use phparia\Client\AriClient;
22
use phparia\Events\Event;
23
24
/**
25
 * An external device that may offer/accept calls to/from Asterisk.
26
 *
27
 * @author Brian Smith <[email protected]>
28
 */
29
class Endpoint extends Resource
30
{
31
    /**
32
     * @var array Id's of channels associated with this endpoint
33
     */
34
    private $channelIds;
35
36
    /**
37
     * @var string Identifier of the endpoint, specific to the given technology.
38
     */
39
    private $resource;
40
41
    /**
42
     * @var string (optional) - Endpoint's state
43
     */
44
    private $state;
45
46
    /**
47
     * @var string Technology of the endpoint
48
     */
49
    private $technology;
50
51
    /**
52
     * @return array Id's of channels associated with this endpoint
53
     */
54
    public function getChannelIds()
55
    {
56
        return $this->channelIds;
57
    }
58
59
    /**
60
     * @return string Identifier of the endpoint, specific to the given technology.
61
     */
62
    public function getResource()
63
    {
64
        return $this->resource;
65
    }
66
67
    /**
68
     * @return string (optional) - Endpoint's state
69
     */
70
    public function getState()
71
    {
72
        return $this->state;
73
    }
74
75
    /**
76
     * @return string Technology of the endpoint
77
     */
78
    public function getTechnology()
79
    {
80
        return $this->technology;
81
    }
82
83
    /**
84
     * @param callable $callback
85
     */
86
    public function onEndpointStateChange(callable $callback)
87
    {
88
        $this->on(Event::ENDPOINT_STATE_CHANGE.'_'.$this->getResource(), $callback);
89
    }
90
91
    /**
92
     * @param callable $callback
93
     */
94
    public function onceEndpointStateChange(callable $callback)
95
    {
96
        $this->once(Event::ENDPOINT_STATE_CHANGE.'_'.$this->getResource(), $callback);
97
    }
98
99
    /**
100
     * @param AriClient $client
101
     * @param string $response
102
     */
103
    public function __construct(AriClient $client, $response)
104
    {
105
        parent::__construct($client, $response);
106
107
        $this->channelIds = $this->getResponseValue('channel_ids');
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getResponseValue('channel_ids') of type * is incompatible with the declared type array of property $channelIds.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
108
        $this->resource = $this->getResponseValue('resource');
109
        $this->state = $this->getResponseValue('state');
110
        $this->technology = $this->getResponseValue('technology');
111
    }
112
113
}
114