Issues (992)

Security Analysis    not enabled

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

class/pear/Console/Exception.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * Console GetoptPlus/Exception
5
 *
6
 * All rights reserved.
7
 * Redistribution and use in source and binary forms, with or without modification,
8
 * are permitted provided that the following conditions are met:
9
 * + Redistributions of source code must retain the above copyright notice,
10
 * this list of conditions and the following disclaimer.
11
 * + Redistributions in binary form must reproduce the above copyright notice,
12
 * this list of conditions and the following disclaimer in the documentation and/or
13
 * other materials provided with the distribution.
14
 * + The names of its contributors may not be used to endorse or promote
15
 * products derived from this software without specific prior written permission.
16
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 *
28
 * @category  Console
29
 * @package   Console_GetoptPlus
30
 * @author    Michel Corne <[email protected]>
31
 * @copyright 2008 Michel Corne
32
 * @license   http://www.opensource.org/licenses/bsd-license.php The BSD License
33
 * @version   SVN: $Id: Exception.php 47 2008-01-10 11:03:38Z mcorne $
34
 * @link      http://pear.php.net/package/Console_GetoptPlus
35
 */
36
require_once __DIR__ . '/PEAR/Exception.php';
37
38
/**
39
 * Handling of error messages and exceptions.
40
 *
41
 * @category  Console
42
 * @package   Console_GetoptPlus
43
 * @author    Michel Corne <[email protected]>
44
 * @copyright 2008 Michel Corne
45
 * @license   http://www.opensource.org/licenses/bsd-license.php The BSD License
46
 * @version   Release: @package_version@
47
 * @link      http://pear.php.net/package/Console_GetoptPlus
48
 * @see       PEAR_Exception
49
 */
50
class Console_GetoptPlus_Exception extends PEAR_Exception
0 ignored issues
show
The type PEAR_Exception was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
{
52
    /**
53
     * The error messages
54
     *
55
     * @var    array
56
     * @access private
57
     */
58
    private $messages = [// /
59
                         'unknow'       => [1, 'Console_Getopt: unknown error ID (%s)'],
60
                         // original Console_Getopt error messages
61
                         'ambigous'     => [10, 'Console_Getopt: option --%s is ambiguous'],
62
                         'mandatory'    => [11, 'Console_Getopt: option requires an argument --%s'],
63
                         'noargument'   => [12, 'Console_Getopt: option --%s doesn\'t allow an argument'],
64
                         'noargs'       => [13, 'Console_Getopt: Could not read cmd args (register_argc_argv=Off?)'],
65
                         'unrecognized' => [14, 'Console_Getopt: unrecognized option --%s'],
66
                         // additional Console_GetoptPlus_Getopt error messages
67
                         'duplicate'    => [20, 'Console_Getopt: duplicate option name definition --%s'],
68
                         'invalid'      => [21, 'Console_Getopt: invalid long option definition %s'],
69
                         'string'       => [22, 'Console_Getopt: short options definition must be a string'],
70
                         'syntax'       => [23, 'Console_Getopt: short options definition syntax error %s'],
71
                         // additional Console_GetoptPlus error messages
72
                         'missing'      => [30, 'Console_GetoptPlus: unknown option name #%s'],
73
                         'type'         => [31, 'Console_GetoptPlus: unknown option type %s'],
74
                         'convert'      => [32, 'Console_GetoptPlus: wrong option name conversion %s'],
75
    ];
76
77
    /**
78
     * Triggers the exception.
79
     *
80
     * @param mixed $exception   the exception ID and optional message part,
81
     *                           e.g. "string" or array("invalid", '--foo')
82
     * @throws \PEAR_Exception
83
     * @access public
84
     */
85
    public function __construct($exception)
86
    {
87
        // extracts the exception ID and message parameters
88
        $exception = (array)$exception;
89
        $id        = current($exception);
90
        // resets the exception ID if no corresponding message (programmatic error!)
91
        isset($this->messages[$id]) or $exception = [null, $id] and $id = 'unknow';
92
        // extracts the exception code and pattern
93
        [$code, $format] = $this->messages[$id];
94
        $exception[0] = $format;
95
        // completes the message, throws the exception
96
        $message = call_user_func_array('\sprintf', $exception);
97
        parent::__construct($message, $code);
98
    }
99
}
100