Issues (90)

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/updateblock.inc.php (3 issues)

1
<?php declare(strict_types=1);
2
/*
3
 You may not change or alter any portion of this comment or credits of
4
 supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit
6
 authors.
7
8
 This program is distributed in the hope that it will be useful, but
9
 WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
13
/**
14
 * Module: Waiting
15
 *
16
 * @category        Module
17
 * @author          XOOPS Module Development Team
18
 * @copyright       {@link https://xoops.org 2001-2016 XOOPS Project}
19
 * @license         {@link https://www.fsf.org/copyleft/gpl.html GNU public license}
20
 * @link            https://xoops.org XOOPS
21
 */
22
if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
23
    exit('Restricted Access - ' . basename($_SERVER['SCRIPT_NAME']) . PHP_EOL);
24
}
25
/**
26
 * Waiting Block installation update
27
 * @param \XoopsModule $module  {@see XoopsModule}
28
 * @param int          $version currently installed module version
29
 *
30
 * @return bool success
31
 */
32
function xoops_module_update_waiting($module, $version)
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

32
function xoops_module_update_waiting(/** @scrutinizer ignore-unused */ $module, $version)

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...
The parameter $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

32
function xoops_module_update_waiting($module, /** @scrutinizer ignore-unused */ $version)

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...
33
{
34
    return true;  // force return - following code is really only needed for XOOPS < 2.3
35
    // Keep Block option values when update (by nobunobu)
36
    $mid = $module->mid();
0 ignored issues
show
$mid = $module->mid() is not reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
37
    if ($mid) {
38
        /** @var \XoopsConfigHandler $configHandler */
39
        $configHandler       = xoops_getHandler('config');
40
        $waitingModuleConfig = $configHandler->getConfigsByCat(0, $mid);
41
42
        $count = count($waitingModuleConfig['blocks']);
43
44
        /** @var \XoopsBlockHandler $blockHandler */
45
        $blockHandler = xoops_getHandler('block');
46
        $criteria     = new \CriteriaCompo();
47
        $criteria->add(new \Criteria('mid', $mid));
48
        $criteria->add(new \Criteria('block_type', 'D'));
49
        $criteria->add(new \Criteria('func_num', $count, '>'));
50
        $blockObjs = $blockHandler->getAll($criteria);
51
52
        foreach ($blockObjs as $blockObj) {
53
            $local_msgs[] = "Non Defined Block <b>{$fblock['name']}</b> will be deleted";
54
            $success      = $blockHandler->delete($blockObj); // remove the invalid block
55
        }
56
57
        $fieldsArray = ['func_num', 'name', 'options'];
58
        $criteria    = new \CriteriaCompo();
59
        $criteria->add(new \Criteria('mid', $mid));
60
        //        $criteria->add(new \Criteria('func_num', $i));
61
        $criteria->add(new \Criteria('show_func'), addslashes($waitingModuleConfig['blocks'][$i]['show_func']));
62
        $criteria->add(new \Criteria('func_file', addslashes($waitingModuleConfig['blocks'][$i]['file'])));
63
        $fblockObjs = $blockHandler->getObjects($criteria);
64
        foreach ($fblockObjs as $fblockObj) {
65
            if (!empty($fblockObj->options())) {
66
                $old_vals = explode('|', $fblockObj->getVar('options'));
67
                $def_vals = explode('|', $modversion['blocks'][$fblockObj->getVar('func_num')]['options']);
68
                if (count($old_vals) == count($def_vals)) {
69
                    $modversion['blocks'][$fblock->getVar('func_num')]['options'] = $fblockObj->getVar('options');
70
                    $local_msgs[]                                                 = "Option's values of the block <b>" . $fblockObj->getVar('name') . '</b> will be kept. (value = <b>' . $fblockObj->getVar('options') . '</b>)';
71
                } elseif (count($old_vals) < count($def_vals)) {
72
                    $def_vals                                                        = array_merge($old_vals, $def_vals); //merges prev. values with new - older are preserved
73
                    $modversion['blocks'][$fblockObj->getVar('func_num')]['options'] = implode('|', $def_vals);
74
                    $local_msgs[]                                                    = "Option's values of the block "
75
                                                                                       . '<b>'
76
                                                                                       . $fblockObj->getVar('name')
77
                                                                                       . '</b> '
78
                                                                                       . 'will be kept and new option(s) are added. (value = '
79
                                                                                       . '<b>'
80
                                                                                       . $waitingModuleConfig['blocks'][$fblockObj->getVar('options')]
81
                                                                                       . '</b>)';
82
                } else {
83
                    $local_msgs[] = "Option's values of the block " . '<b>' . $fblockObj->getVar('name') . '</b> ' . 'will be reset to the default, because of some decrease of options. (value = ' . '<b>' . $waitingModuleConfig['blocks'][$fblockObj->getVar('func_num')]['options'] . '</b>)';
84
                }
85
            }
86
        }
87
    }
88
89
    global $msgs, $myblocksadmin_parsed_updateblock;
90
    if (!empty($msgs) && empty($myblocksadmin_parsed_updateblock)) {
91
        $msgs                             = array_merge($msgs, $local_msgs);
92
        $myblocksadmin_parsed_updateblock = true;
93
    }
94
95
    return true;  //@todo: for now force success - eventually send 'actual' results
96
}
97