Issues (314)

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/SplClassLoader.php (1 issue)

1
<?php
2
3
namespace XoopsModules\Modulebuilder;
4
5
/*
6
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
12
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
13
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
14
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
16
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
 *
18
 * This software consists of voluntary contributions made by many individuals
19
 * and is licensed under the MIT license. For more information, see
20
 * <http://www.doctrine-project.org>.
21
 */
22
23
/**
24
 * SplClassLoader implementation that implements the technical interoperability
25
 * standards for PHP 5.3 namespaces and class names.
26
 *
27
 * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1
28
 *
29
 *     // Example which loads classes for the Doctrine Common package in the
30
 *     // Doctrine\Common namespace.
31
 *     $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
32
 *     $classLoader->register();
33
 *
34
 * @license http://www.opensource.org/licenses/mit-license.html  MIT License
35
 * @author  Jonathan H. Wage <[email protected]>
36
 * @author  Roman S. Borschel <[email protected]>
37
 * @author  Matthew Weier O'Phinney <[email protected]>
38
 * @author  Kris Wallsmith <[email protected]>
39
 * @author  Fabien Potencier <[email protected]>
40
 */
41
class SplClassLoader
42
{
43
    private $_fileExtension      = '.php';
44
    private $_namespace;
45
    private $_includePath;
46
    private $_namespaceSeparator = '\\';
47
48
    /**
49
     * Creates a new <tt>SplClassLoader</tt> that loads classes of the
50
     * specified namespace.
51
     *
52
     * @param string $ns The namespace to use
53
     * @param null   $includePath
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $includePath is correct as it would always require null to be passed?
Loading history...
54
     */
55
    public function __construct($ns = null, $includePath = null)
56
    {
57
        $this->_namespace   = $ns;
58
        $this->_includePath = $includePath;
59
    }
60
61
    /**
62
     * Sets the namespace separator used by classes in the namespace of this class loader.
63
     *
64
     * @param string $sep The separator to use
65
     */
66
    public function setNamespaceSeparator($sep)
67
    {
68
        $this->_namespaceSeparator = $sep;
69
    }
70
71
    /**
72
     * Gets the namespace seperator used by classes in the namespace of this class loader.
73
     */
74
    public function getNamespaceSeparator()
75
    {
76
        return $this->_namespaceSeparator;
77
    }
78
79
    /**
80
     * Sets the base include path for all class files in the namespace of this class loader.
81
     *
82
     * @param string $includePath
83
     */
84
    public function setIncludePath($includePath)
85
    {
86
        $this->_includePath = $includePath;
87
    }
88
89
    /**
90
     * Gets the base include path for all class files in the namespace of this class loader.
91
     *
92
     * @return string $includePath
93
     */
94
    public function getIncludePath()
95
    {
96
        return $this->_includePath;
97
    }
98
99
    /**
100
     * Sets the file extension of class files in the namespace of this class loader.
101
     *
102
     * @param string $fileExtension
103
     */
104
    public function setFileExtension($fileExtension)
105
    {
106
        $this->_fileExtension = $fileExtension;
107
    }
108
109
    /**
110
     * Gets the file extension of class files in the namespace of this class loader.
111
     *
112
     * @return string $fileExtension
113
     */
114
    public function getFileExtension()
115
    {
116
        return $this->_fileExtension;
117
    }
118
119
    /**
120
     * Installs this class loader on the SPL autoload stack.
121
     */
122
    public function register()
123
    {
124
        spl_autoload_register([$this, 'loadClass']);
125
    }
126
127
    /**
128
     * Uninstalls this class loader from the SPL autoloader stack.
129
     */
130
    public function unregister()
131
    {
132
        spl_autoload_unregister([$this, 'loadClass']);
133
    }
134
135
    /**
136
     * Loads the given class or interface.
137
     *
138
     * @param string $className The name of the class to load
139
     */
140
    public function loadClass($className)
141
    {
142
        if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === mb_substr($className, 0, mb_strlen($this->_namespace . $this->_namespaceSeparator))) {
143
            $fileName  = '';
144
            $namespace = '';
145
            if (false !== ($lastNsPos = \mb_strrpos($className, $this->_namespaceSeparator))) {
146
                $namespace .= mb_substr($className, 0, $lastNsPos);
147
                $className = mb_substr($className, $lastNsPos + 1);
148
                $fileName  = \str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
149
            }
150
            $fileName .= \str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
151
152
            require (null !== $this->_includePath ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
153
        }
154
    }
155
}
156