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

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/JonnyW/PhantomJs/Engine.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
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace JonnyW\PhantomJs;
10
11
use JonnyW\PhantomJs\Exception\InvalidExecutableException;
12
13
/**
14
 * PHP PhantomJs
15
 *
16
 * @author Jon Wenmoth <[email protected]>
17
 */
18
class Engine
19
{
20
    /**
21
     * Executable path.
22
     *
23
     * @var string
24
     * @access protected
25
     */
26
    protected $path;
27
28
    /**
29
     * Debug flag.
30
     *
31
     * @var boolean
32
     * @access protected
33
     */
34
    protected $debug;
35
36
    /**
37
     * Cache flag.
38
     *
39
     * @var boolean
40
     * @access protected
41
     */
42
    protected $cache;
43
44
    /**
45
     * PhantomJs run options.
46
     *
47
     * @var array
48
     * @access protected
49
     */
50
    protected $options;
51
52
    /**
53
     * Log info
54
     *
55
     * @var string
56
     * @access protected
57
     */
58
    protected $log;
59
60
    /**
61
     * Internal constructor
62
     *
63
     * @access public
64
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
65
     */
66 27
    public function __construct()
67
    {
68 27
        $this->path    = 'bin/phantomjs';
69 27
        $this->options = array();
70
71 27
        $this->debug = false;
72 27
        $this->cache = true;
73 27
    }
74
75
    /**
76
     * Get PhantomJs run command with
77
     * loader run options.
78
     *
79
     * @access public
80
     * @return string
81
     */
82 55
    public function getCommand()
83
    {
84 55
        $path    = $this->getPath();
85 55
        $options = $this->getOptions();
86
87 55
        $this->validateExecutable($path);
88
89 54
        if ($this->cache) {
90 53
            array_push($options, '--disk-cache=true');
91 53
        }
92
93 54
        if ($this->debug) {
94 14
            array_push($options, '--debug=true');
95 14
        }
96
97 54
        return sprintf('%s %s', $path, implode(' ', $options));
98
    }
99
100
    /**
101
     * Set path.
102
     *
103
     * @access public
104
     * @param  string                   $path
105
     * @return \JonnyW\PhantomJs\Client
106
     */
107 1
    public function setPath($path)
108
    {
109 1
        $this->validateExecutable($path);
110
111
        $this->path = $path;
112
113
        return $this;
114
    }
115
116
    /**
117
     * Get path.
118
     *
119
     * @access public
120
     * @return string
121
     */
122 56
    public function getPath()
123
    {
124 56
        return $this->path;
125
    }
126
127
    /**
128
     * Set PhantomJs run options.
129
     *
130
     * @access public
131
     * @param  array                    $options
132
     * @return \JonnyW\PhantomJs\Client
133
     */
134 1
    public function setOptions(array $options)
135
    {
136 1
        $this->options = $options;
137
138 1
        return $this;
139
    }
140
141
    /**
142
     * Get PhantomJs run options.
143
     *
144
     * @access public
145
     * @return array
146
     */
147 56
    public function getOptions()
148
    {
149 56
        return (array) $this->options;
150
    }
151
152
    /**
153
     * Add single PhantomJs run option.
154
     *
155
     * @access public
156
     * @param  string                   $option
157
     * @return \JonnyW\PhantomJs\Client
158
     */
159 6
    public function addOption($option)
160
    {
161 6
        if (!in_array($option, $this->options)) {
162 4
            $this->options[] = $option;
163 4
        }
164
165 6
        return $this;
166
    }
167
168
    /**
169
     * Debug.
170
     *
171
     * @access public
172
     * @param  boolean                  $doDebug
173
     * @return \JonnyW\PhantomJs\Client
174
     */
175 4
    public function debug($doDebug)
176
    {
177 4
        $this->debug = $doDebug;
178
179 4
        return $this;
180
    }
181
182
    /**
183
     * Cache.
184
     *
185
     * @access public
186
     * @param  boolean                  $doCache
187
     * @return \JonnyW\PhantomJs\Client
188
     */
189 2
    public function cache($doCache)
190
    {
191 2
        $this->cache = $doCache;
192
193 2
        return $this;
194
    }
195
196
    /**
197
     * Log info.
198
     *
199
     * @access public
200
     * @param  string                   $info
201
     * @return \JonnyW\PhantomJs\Client
202
     */
203 49
    public function log($info)
204
    {
205 49
        $this->log = $info;
206
207 49
        return $this;
208
    }
209
210
    /**
211
     * Get log info.
212
     *
213
     * @access public
214
     * @return string
215
     */
216 11
    public function getLog()
217
    {
218 11
        return $this->log;
219
    }
220
221
    /**
222
     * Clear log info.
223
     *
224
     * @access public
225
     * @return \JonnyW\PhantomJs\Client
226
     */
227 1
    public function clearLog()
228
    {
229 1
        $this->log = '';
230
231 1
        return $this;
232
    }
233
234
    /**
235
     * Validate execuable file.
236
     *
237
     * @access private
238
     * @param  string                                                 $file
239
     * @return boolean
240
     * @throws \JonnyW\PhantomJs\Exception\InvalidExecutableException
241
     */
242 56
    private function validateExecutable($file)
243
    {
244 56
        if (!file_exists($file) || !is_executable($file)) {
245 2
            throw new InvalidExecutableException(sprintf('File does not exist or is not executable: %s', $file));
246
        }
247
248 54
        return true;
249
    }
250
}
251