Issues (608)

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

1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    XOOPS Project https://xoops.org/
14
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15
 * @since
16
 * @author       XOOPS Development Team
17
 */
18
19
use XoopsModules\Oledrion;
20
use XoopsModules\Oledrion\Common;
21
22
if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->IsAdmin()) {
23
    exit('Restricted access' . PHP_EOL);
24
}
25
26
/**
27
 * @param string $tablename
28
 *
29
 * @return bool
30
 */
31
function tableExists($tablename)
32
{
33
    $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'");
34
35
    return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0);
36
}
37
38
/**
39
 * Prepares system prior to attempting to install module
40
 * @param \XoopsModule $module {@link XoopsModule}
41
 *
42
 * @return bool true if ready to install, false if not
43
 */
44
function xoops_module_pre_update_oledrion(\XoopsModule $module)
45
{
46
    /** @var Oledrion\Helper $helper */
47
    /** @var Oledrion\Utility $utility */
48
    $helper  = Oledrion\Helper::getInstance();
49
    $utility = new Oledrion\Utility();
50
51
    $xoopsSuccess = $utility::checkVerXoops($module);
52
    $phpSuccess   = $utility::checkVerPhp($module);
53
54
    return $xoopsSuccess && $phpSuccess;
55
}
56
57
/**
58
 * Performs tasks required during update of the module
59
 * @param \XoopsModule $module {@link XoopsModule}
60
 * @param null         $previousVersion
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $previousVersion is correct as it would always require null to be passed?
Loading history...
61
 *
62
 * @return bool true if update successful, false if not
63
 */
64
function xoops_module_update_oledrion(\XoopsModule $module, $previousVersion = null)
65
{
66
    $moduleDirName      = basename(dirname(__DIR__));
67
    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
68
69
    /** @var Oledrion\Helper $helper */
70
    /** @var Oledrion\Utility $utility */
71
    /** @var Common\Configurator $configurator */
72
    $helper       = Oledrion\Helper::getInstance();
73
    $utility      = new Oledrion\Utility();
74
    $configurator = new Common\Configurator();
75
76
    $helper->loadLanguage('common');
77
78
    if ($previousVersion < 240) {
79
        //delete old HTML templates
80
        if (count($configurator->templateFolders) > 0) {
81
            foreach ($configurator->templateFolders as $folder) {
82
                $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder);
83
                if (is_dir($templateFolder)) {
84
                    $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']);
85
                    foreach ($templateList as $k => $v) {
86
                        $fileInfo = new \SplFileInfo($templateFolder . $v);
87
                        if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) {
88
                            if (file_exists($templateFolder . $v)) {
89
                                if (false === @unlink($templateFolder . $v)) {
90
                                    throw new \RuntimeException('The file ' . $templateFolder . $v . ' could not be deleted.');
91
                                }
92
                            }
93
                        }
94
                    }
95
                }
96
            }
97
        }
98
99
        //  ---  DELETE OLD FILES ---------------
100
        if (count($configurator->oldFiles) > 0) {
101
            //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
102
            foreach (array_keys($configurator->oldFiles) as $i) {
103
                $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]);
104
                if (is_file($tempFile)) {
105
                    if (false === @unlink($tempFile)) {
106
                        throw new \RuntimeException('The file ' . $tempFile . ' could not be deleted.');
107
                    }
108
                }
109
            }
110
        }
111
112
        //  ---  DELETE OLD FOLDERS ---------------
113
        xoops_load('XoopsFile');
114
        if (count($configurator->oldFolders) > 0) {
115
            //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
116
            foreach (array_keys($configurator->oldFolders) as $i) {
117
                $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
118
                /** @var \XoopsObjectHandler $folderHandler */
119
                $folderHandler = \XoopsFile::getHandler('folder', $tempFolder);
120
                $folderHandler->delete($tempFolder);
121
            }
122
        }
123
124
        //  ---  CREATE FOLDERS ---------------
125
        if (count($configurator->uploadFolders) > 0) {
126
            //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
127
            foreach (array_keys($configurator->uploadFolders) as $i) {
128
                $utility::createFolder($configurator->uploadFolders[$i]);
129
            }
130
        }
131
132
        //  ---  COPY blank.png FILES ---------------
133
        if (count($configurator->copyBlankFiles) > 0) {
134
            $file = dirname(__DIR__) . '/assets/images/blank.png';
135
            foreach (array_keys($configurator->copyBlankFiles) as $i) {
136
                $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
137
                $utility::copyFile($file, $dest);
138
            }
139
        }
140
141
        //delete .html entries from the tpl table
142
        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
143
        $GLOBALS['xoopsDB']->queryF($sql);
144
145
        /** @var \XoopsGroupPermHandler $grouppermHandler */
146
        $grouppermHandler = xoops_getHandler('groupperm');
147
148
        return $grouppermHandler->deleteByModule($module->getVar('mid'), 'item_read');
149
    }
150
151
    return true;
152
}
153