Issues (62)

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.

include/install_function.php (2 issues)

1
<?php declare(strict_types=1);
2
3
/**
4
 * ****************************************************************************
5
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
6
 * ****************************************************************************
7
 *  XHTTPERROR - MODULE FOR XOOPS
8
 *  Copyright (c) 2007 - 2012
9
 *  Rota Lucio ( http://luciorota.altervista.org/xoops/ )
10
 *
11
 *  You may not change or alter any portion of this comment or credits
12
 *  of supporting developers from this source code or any supporting
13
 *  source code which is considered copyrighted (c) material of the
14
 *  original comment or credit authors.
15
 *
16
 *  This program is distributed in the hope that it will be useful,
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *  GNU General Public License for more details.
20
 *  ---------------------------------------------------------------------------
21
 * @copyright  Rota Lucio ( http://luciorota.altervista.org/xoops/ )
22
 * @license    GNU General Public License v3.0
23
 * @package    xhttperror
24
 * @author     Rota Lucio ( [email protected] )
25
 *
26
 *  $Rev$:     Revision of last commit
27
 *  $Author$:  Author of last commit
28
 *  $Date$:    Date of last commit
29
 * ****************************************************************************
30
 */
31
32
use XoopsModules\Xhttperror\{
33
    Helper
34
};
35
/** @var Helper $helper */
36
37
defined('DS') || define('DS', DIRECTORY_SEPARATOR);
38
39
/**
40
 * @return bool
41
 */
42
function xoops_module_pre_install_xhttperror(\XoopsModule $module)
0 ignored issues
show
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

42
function xoops_module_pre_install_xhttperror(/** @scrutinizer ignore-unused */ \XoopsModule $module)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
43
{
44
    // Check if this XOOPS version is supported
45
    $minSupportedVersion = explode('.', '2.5.10');
46
    $currentVersion      = explode('.', mb_substr(XOOPS_VERSION, 6));
47
    if ($currentVersion[0] > $minSupportedVersion[0]) {
48
        return true;
49
    } elseif ($currentVersion[0] == $minSupportedVersion[0]) {
50
        if ($currentVersion[1] > $minSupportedVersion[1]) {
51
            return true;
52
        } elseif ($currentVersion[1] == $minSupportedVersion[1]) {
53
            if ($currentVersion[2] > $minSupportedVersion[2]) {
54
                return true;
55
            } elseif ($currentVersion[2] == $minSupportedVersion[2]) {
56
                return true;
57
            }
58
        }
59
    }
60
61
    return false;
62
}
63
64
/**
65
 * @return bool|string
66
 */
67
function xoops_module_install_xhttperror(\XoopsObject $module)
68
{
69
    xoops_loadLanguage('modinfo', $module->getVar('dirname'));
0 ignored issues
show
It seems like $module->getVar('dirname') can also be of type array and array; however, parameter $domain of xoops_loadLanguage() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

69
    xoops_loadLanguage('modinfo', /** @scrutinizer ignore-type */ $module->getVar('dirname'));
Loading history...
70
    require_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/include/functions.php';
71
72
    $ret = true;
73
    $msg = '';
74
    // load classes
75
    $helper       = Helper::getInstance();
76
    $errorHandler = $helper->getHandler('Error');
77
    $error        = $errorHandler->create();
78
    $error->setVar('error_title', 'Error 404 - Document Not Found');
79
    $error->setVar('error_statuscode', '404');
80
    $error->setVar(
81
        'error_text',
82
        '<p style="font-weight: bold; text-align: center">The page you requested could not be found.</p><p>You may not be able to find the requested page because:</p><ul><li>The page no longer exists.</li><li>The address/page name was mis-typed.</li><li>You followed an incorrect, or out of date link on another site.</li><li>You followed an out of date search engine listing, or personal bookmark/favourite.</li></ul><p>Please try visiting the <a href="/">home page</a>, or use the search function below to find the page you were after.</p>'
83
    );
84
    $error->setVar('error_showme', true);
85
    $error->setVar('error_redirect', false);
86
    $error->setVar('error_redirect_time', 3);
87
    $error->setVar('error_redirect_uri', XOOPS_URL);
88
    if (!$errorHandler->insert($error)) {
89
        $msg = $msg . $error->getHtmlErrors();
90
    }
91
    unset($error);
92
    $error = $errorHandler->create();
93
    $error->setVar('error_title', 'Error 500 - Server error');
94
    $error->setVar('error_statuscode', '500');
95
    $error->setVar('error_text', '<p style="font-weight: bold; text-align: center;">The server encountered an internal error and was unable to complete your request.</p>');
96
    $error->setVar('error_showme', true);
97
    $error->setVar('error_redirect', false);
98
    $error->setVar('error_redirect_time', 3);
99
    $error->setVar('error_redirect_uri', XOOPS_URL);
100
    if (!$errorHandler->insert($error)) {
101
        $msg = $msg . $error->getHtmlErrors();
102
    }
103
    unset($error);
104
    $error = $errorHandler->create();
105
    $error->setVar('error_title', 'Error 403 - Forbidden');
106
    $error->setVar('error_statuscode', '403');
107
    $error->setVar('error_text', '<p style="font-weight: bold; text-align: center;">You do not have permission to access the requested directory/file.</p>');
108
    $error->setVar('error_showme', true);
109
    $error->setVar('error_redirect', false);
110
    $error->setVar('error_redirect_time', 3);
111
    $error->setVar('error_redirect_uri', XOOPS_URL);
112
    if (!$errorHandler->insert($error)) {
113
        $msg = $msg . $error->getHtmlErrors();
114
    }
115
    unset($error);
116
    if (empty($msg)) {
117
        return $ret;
118
    }
119
120
    return $msg;
121
}
122