Issues (80)

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 (2 issues)

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