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.

blocks/waiting_waiting.php (2 issues)

Severity
1
<?php declare(strict_types=1);
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
 * Module: Waiting
14
 *
15
 * @category        Module
16
 * @author          Kazumi Ono (AKA onokazu)
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://www.myweb.ne.jp/
21
 * @link            https://xoops.org XOOPS
22
 * @since           2.00
23
 */
24
25
use XoopsModules\Waiting\Helper;
26
27
/** @var Helper $helper */
28
29
// EXTENSIBLE "waiting block" by plugins in both waiting and modules
30
31
/**
32
 * @param $options
33
 * @return array
34
 */
35
function b_waiting_waiting_show($options)
36
{
37
    $userLang = $GLOBALS['xoopsConfig']['language'];
38
39
    $sql_cache_min  = empty($options[1]) ? 0 : (int)$options[1];
40
    $sql_cache_file = XOOPS_CACHE_PATH . '/waiting_touch';
41
42
    // SQL cache check (you have to use this cache with block's cache by system)
43
    if (is_file($sql_cache_file)) {
44
        $sql_cache_mtime = filemtime($sql_cache_file);
45
        if (time() < $sql_cache_mtime + $sql_cache_min * 60) {
46
            return [];
47
        }
48
49
        unlink($sql_cache_file);
50
    }
51
52
    require_once \dirname(__DIR__) . '/include/functions.php';
53
54
    $helper = Helper::getInstance();
55
    // read language files for plugins
56
    $helper->loadLanguage('plugins');
57
58
    $plugins_path = XOOPS_ROOT_PATH . '/modules/waiting/plugins';
0 ignored issues
show
The assignment to $plugins_path is dead and can be removed.
Loading history...
59
    /** @var \XoopsMySQLDatabase $xoopsDB */
60
    $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
0 ignored issues
show
The assignment to $xoopsDB is dead and can be removed.
Loading history...
61
    /** @var \XoopsModuleHandler $moduleHandler */
62
    $moduleHandler = xoops_getHandler('module');
63
    $block         = [];
64
65
    // get module's list installed
66
    $mod_lists = $moduleHandler->getList(new \Criteria(''), true);
67
    foreach ($mod_lists as $dirname => $name) {
68
        $plugin_info = waiting_get_plugin_info($dirname, $userLang);
69
        if (empty($plugin_info) || empty($plugin_info['plugin_path'])) {
70
            continue;
71
        }
72
73
        if (!empty($plugin_info['langfile_path'])) {
74
            require_once $plugin_info['langfile_path'];
75
        }
76
        require_once $plugin_info['plugin_path'];
77
78
        // call the plugin
79
        if (function_exists(@$plugin_info['func'])) {
80
            // get the list of waitings
81
            $_tmp = call_user_func($plugin_info['func'], $dirname);
82
            if (isset($_tmp['lang_linkname'])) {
83
                if (@$_tmp['pendingnum'] > 0//                    || $options[0] > 0
84
                ) {
85
                    $block['modules'][$dirname]['pending'][] = $_tmp;
86
                }
87
                unset($_tmp);
88
            } else {
89
                // Judging the plugin returns multiple items
90
                // if lang_linkname does not exist
91
                if (is_array($_tmp)) {
92
                    foreach ($_tmp as $_one) {
93
                        if (isset($_one['pendingnum']) && (int)$_one['pendingnum'] > 0   //                        || (int)$options[0] > 0
94
                        ) {
95
                            $block['modules'][$dirname]['pending'][] = $_one;
96
                        }
97
                    }
98
                }
99
            }
100
        }
101
102
        // for older compatibilities
103
        // Hacked by GIJOE
104
105
        //        $i = 0;
106
        //        while (1) {
107
        //            $function_name = "b_waiting_{$dirname}_$i";
108
        //            if (function_exists($function_name)) {
109
        //                $_tmp = call_user_func($function_name);
110
        //                ++$i;
111
        //                if ((int)$_tmp['pendingnum'] > 0 || $options[0] > 0) {
112
        //                    $block['modules'][$dirname]['pending'][] = $_tmp;
113
        //                }
114
        //                unset($_tmp);
115
        //            } else {
116
        //                break;
117
        //            }
118
        //        }
119
120
        // End of Hack
121
122
        // if(count($block["modules"][$dirname]) > 0){
123
        if (!empty($block['modules'][$dirname])) {
124
            $block['modules'][$dirname]['name'] = $name;
125
        }
126
    }
127
    //    print_r($block);
128
    //    var_dump($block);
129
130
    // SQL cache touch (you have to use this cache with block's cache by system)
131
    if (empty($block) && $sql_cache_min > 0) {
132
        $fp = fopen($sql_cache_file, 'wb');
133
        fclose($fp);
134
    }
135
136
    return $block;
137
}
138
139
/**
140
 * @param $options
141
 * @return string
142
 */
143
function b_waiting_waiting_edit($options)
144
{
145
    $mod_url = XOOPS_URL . '/modules/waiting';
146
147
    $sql_cache_min = empty($options[1]) ? 0 : (int)$options[1];
148
149
    $form = _MB_WAITING_NOWAITING_DISPLAY . ":&nbsp;<input type='radio' name='options[0]' value='1'";
150
    if (1 == $options[0]) {
151
        $form .= ' checked';
152
    }
153
    $form .= '>&nbsp;' . _YES . "<input type='radio' name='options[0]' value='0'";
154
    if (0 == $options[0]) {
155
        $form .= ' checked';
156
    }
157
    $form .= '>&nbsp;' . _NO . "<br>\n";
158
    $form .= sprintf(_MINUTES, _MB_WAITING_SQL_CACHE . ":&nbsp;<input type='text' name='options[1]' value='{$sql_cache_min}' size='2'>");
159
    $form .= "<br>\n<br>\n<a href='{$mod_url}/admin/index.php'><img src='{$mod_url}/assets/images/folder16.gif'>" . _MB_WAITING_LINKTOPLUGINCHECK . '</a>';
160
161
    return $form;
162
}
163