Issues (51)

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/action.module.php (4 issues)

1
<?php
2
3
use XoopsModules\About;
4
use XoopsModules\About\Helper;
5
use XoopsModules\About\Utility;
6
7
    /** @var Helper $helper */
8
    /** @var Utility $utility */
9
10
defined('XOOPS_ROOT_PATH') || exit('Restricted access');
11
12
/**
13
 * Prepares system prior to attempting to install module
14
 *
15
 * @param \XoopsModule $module
16
 *
17
 * @return bool       true if ready to install, false if not
18
 */
19
function xoops_module_pre_install_about(\XoopsModule $module)
20
{
21
    require_once dirname(__DIR__) . '/preloads/autoloader.php';
22
    $utility      = new Utility();
23
    $xoopsSuccess = $utility::checkVerXoops($module);
24
    $phpSuccess   = $utility::checkVerPhp($module);
25
26
    if ($xoopsSuccess && $phpSuccess) {
27
        $moduleTables = &$module->getInfo('tables');
28
        foreach ($moduleTables as $table) {
29
            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
30
        }
31
    }
32
33
    return $xoopsSuccess && $phpSuccess;
34
}
35
36
/**
37
 * @param \XoopsModule $module
38
 * @return bool        true if install successful, false if not
39
 */
40
function xoops_module_install_about(\XoopsModule $module)
41
{
42
    $success   = true;
43
    $data_file = XOOPS_ROOT_PATH . '/modules/about/sql/mysql.about.sql';
44
    $GLOBALS['xoopsDB']->queryF('SET NAMES utf8');
45
    if (!$GLOBALS['xoopsDB']->queryFromFile($data_file)) {
46
        $module->setErrors('Pre-set data was not installed');
47
        // preset info not set, but don't 'fail' install because of this
48
        //$success = false;
49
    }
50
51
    // Delete files from previous version (if they exist)
52
    // this is only executed if this version copied over old version without running module update
53
    $oldFiles = [
54
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/include/xoopsformloader.php',
55
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/include/blockform.php',
56
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/class/utilities.php',
57
    ];
58
    foreach ($oldFiles as $file) {
59
        if (is_file($file)) {
60
            $delOk = unlink($file);
61
            if (!$delOk) {
62
                $module->setErrors(sprintf(_AM_ABOUT_ERROR_BAD_REMOVE, $file));
63
            } else {
64
                $module->setErrors(sprintf(_AM_ABOUT_DELETED, $file));
65
            }
66
            $success = $success && $delOk;
67
        }
68
    }
69
    // Create uploads folder
70
    $dirOk = mkdir(XOOPS_UPLOAD_PATH . '/' . $module->dirname());
71
    if (!$dirOk) {
72
        $module->setErrors(_AM_ABOUT_ERROR_BAD_UPLOAD_DIR);
73
    }
74
75
    return $dirOk && $success;
76
}
77
78
/**
79
 * Prepares system prior to attempting to install module
80
 *
81
 * @param \XoopsModule $module
82
 *
83
 * @return bool       true if ready to install, false if not
84
 */
85
function xoops_module_pre_update_about(\XoopsModule $module)
86
{
87
    $moduleDirName = basename(dirname(__DIR__));
0 ignored issues
show
The assignment to $moduleDirName is dead and can be removed.
Loading history...
88
    $helper  = Helper::getInstance();
0 ignored issues
show
The assignment to $helper is dead and can be removed.
Loading history...
89
    $utility = new Utility();
90
91
    $xoopsSuccess = $utility::checkVerXoops($module);
92
    $phpSuccess   = $utility::checkVerPhp($module);
93
94
    return $xoopsSuccess && $phpSuccess;
95
}
96
97
/**
98
 * @param XoopsModule $module
99
 * @param null        $prev_version
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $prev_version is correct as it would always require null to be passed?
Loading history...
100
 * @return bool        true if update successful, false if not
101
 */
102
function xoops_module_update_about(\XoopsModule $module, $prev_version = null)
0 ignored issues
show
The parameter $prev_version 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

102
function xoops_module_update_about(\XoopsModule $module, /** @scrutinizer ignore-unused */ $prev_version = null)

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...
103
{
104
    $success = true;
105
    // Delete files from previous version (if they exist)
106
    $oldFiles = [
107
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/include/xoopsformloader.php',
108
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/include/blockform.php',
109
        XOOPS_ROOT_PATH . '/modules/' . $module->dirname() . '/class/utilities.php',
110
    ];
111
    foreach ($oldFiles as $file) {
112
        if (is_file($file)) {
113
            if (!$delOk = unlink($file)) {
114
                $module->setErrors(sprintf(_AM_ABOUT_ERROR_BAD_REMOVE, $file));
115
            }
116
            $success = $success && $delOk;
117
        }
118
    }
119
120
    // Delete files from previous version (if they exist)
121
    // this is only executed if this version copied over old version without running module update
122
    $oldFiles = [
123
        XOOPS_PATH . '/modules/' . $module->dirname() . '/include/xoopsformloader.php',
124
        XOOPS_PATH . '/modules/' . $module->dirname() . '/include/blockform.php',
125
    ];
126
    foreach ($oldFiles as $file) {
127
        if (is_file($file)) {
128
            if (!$delOk = unlink($file)) {
129
                $module->setErrors(sprintf(_AM_ABOUT_ERROR_BAD_REMOVE, $file));
130
            }
131
            $success = $success && $delOk;
132
        }
133
    }
134
135
    // Create uploads folder if it doesn't exist
136
    $dirOk = true;
137
    if (!is_dir(XOOPS_UPLOAD_PATH . '/' . $module->dirname())) {
138
        // File doesn't exist so try and create it
139
        $dirOk = mkdir(XOOPS_UPLOAD_PATH . '/' . $module->dirname());
140
        if (!$dirOk) {
141
            $module->setErrors(_AM_ABOUT_ERROR_BAD_UPLOAD_DIR);
142
        }
143
    }
144
145
    return $dirOk && $success;
146
}
147
148
/**
149
 * Function to complete upon module uninstall
150
 *
151
 * @param \XoopsModule $module
152
 *
153
 * @return bool       true if successfully executed uninstall of module, false if not
154
 */
155
function xoops_module_uninstall_about(\XoopsModule $module)
156
{
157
    $moduleDirName = $module->dirname();
158
    $helper  = Helper::getInstance();
159
    $utility = new Utility();
160
161
    $success = true;
162
    $helper->loadLanguage('admin');
163
164
    //------------------------------------------------------------------
165
    // Remove module uploads folder (and all subfolders) if they exist
166
    //------------------------------------------------------------------
167
168
    $old_directories = [XOOPS_UPLOAD_PATH . "/{$moduleDirName}"];
169
    foreach ($old_directories as $old_dir) {
170
        $dirInfo = new \SplFileInfo($old_dir);
171
        if ($dirInfo->isDir()) {
172
            // The directory exists so delete it
173
            if (!$utility::rrmdir($old_dir)) {
174
                $module->setErrors(sprintf(_AM_ABOUT_ERROR_BAD_DEL_PATH, $old_dir));
175
                $success = false;
176
            }
177
        }
178
        unset($dirInfo);
179
    }
180
181
    return $success;
182
}
183