Issues (57)

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/countdown-block.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
use XoopsModules\Countdown;
6
use XoopsModules\Countdown\Helper;
7
use XoopsModules\Countdown\Constants;
8
9
include_once XOOPS_ROOT_PATH . '/modules/countdown/include/common.php';
10
11
function showCountdown($options)
12
{
13
    /** @var Helper $helper */
14
    if (!class_exists(Helper::class)) {
15
        return false;
16
    }
17
18
    $helper = Helper::getInstance();
19
    $helper->loadLanguage('main');
20
21
    $myts = \MyTextSanitizer::getInstance();
22
23
    $block             = [];
24
    $block['event_id'] = $options[0];
25
    $selected_id       = $block['event_id'];
26
27
    $sql    = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("countdown_events") . " WHERE event_id=$selected_id";
28
    $result = $GLOBALS['xoopsDB']->query($sql);
29
30
    while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) {
31
        $block['id']           = $row['event_id'];
32
        $block['uid']          = $row['event_uid'];
33
        $block['submitter']    = \XoopsUser::getUnameFromId($row['event_uid']);
34
        $block['name']         = $row['event_name'];
35
        $block['description']  = $row['event_description'];
36
        $block['categoryid']   = $row['event_categoryid'];
37
        $categoryid            = $row['event_categoryid'];
38
        $categoryHandler       = $helper->getHandler('category');
39
        $categoryObj           = $categoryHandler->get($categoryid);
40
        $block['categoryname'] = $categoryObj->getVar('category_title');
41
        $categoryname          = $categoryObj->getVar('category_title');
42
        $block['logo']         = $row['event_logo'];
43
        $block['date']         = date(_DATESTRING, strtotime($row['event_date']));
44
        $block['dateiso']      = $row['event_date'];
45
        $block['usertime']     = formatTimeStamp(time(), 'mysql');
46
        $block['date_created'] = formatTimestamp($row['date_created']);
47
        $date_created          = formatTimestamp($row['date_created']);
48
        $block['date_updated'] = formatTimestamp($row['date_updated']);
49
        $date_updated          = formatTimestamp($row['date_updated']);
50
51
        if ($date_created == $date_updated) {
52
            $block['info'] = sprintf(_MB_COUNTDOWN_POSTEDBY, \XoopsUser::getUnameFromId($row['event_uid']), formatTimestamp($row['date_created'], 'M d Y'), $categoryname);
0 ignored issues
show
It seems like $categoryname can also be of type array and array; however, parameter $values of sprintf() does only seem to accept double|integer|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

52
            $block['info'] = sprintf(_MB_COUNTDOWN_POSTEDBY, \XoopsUser::getUnameFromId($row['event_uid']), formatTimestamp($row['date_created'], 'M d Y'), /** @scrutinizer ignore-type */ $categoryname);
Loading history...
53
        } else {
54
            $block['info'] = sprintf(_MB_COUNTDOWN_POSTEDBY, \XoopsUser::getUnameFromId($row['event_uid']), formatTimestamp($row['date_updated'], 'M d Y'), $categoryname);
55
        }
56
    }
57
    $block['displayinfo']      = $options[1];
58
    $block['displayeventlogo'] = $options[2];
59
    return $block;
60
}
61
62
function editCountdown($options)
63
{
64
    $form = _MB_COUNTDOWN_EVENTTODISPLAY . '&nbsp;';;
65
    $form .= "<input type='hidden' name='options[0]' value='" . $options[0] . "'>&nbsp;";
66
    $form .= "<select name='options[0]'>";
67
    $form .= "<option>" . _MB_COUNTDOWN_EVENTTODISPLAY . "</option>";
68
69
    $sql       = "SELECT c.category_title,c.category_id,e.event_id,e.event_name,event_categoryid FROM " . $GLOBALS['xoopsDB']->prefix("countdown_events") . " AS e JOIN " . $GLOBALS['xoopsDB']->prefix("countdown_categories") . " AS c WHERE category_id=event_categoryid";
70
    $result    = $GLOBALS['xoopsDB']->query($sql);
71
    $totaldata = $GLOBALS['xoopsDB']->getRowsNum($result);
72
    if ($totaldata > 0) {
73
        while ($myrow = $GLOBALS['xoopsDB']->fetchArray($result)) {
74
            $event[$myrow['category_title']][] = $myrow;
75
        }
76
        foreach ($event as $key => $values) {
77
            $form .= '<optgroup label="' . $key . '">';
78
            foreach ($values as $value) {
79
                if ($options[0] == $value['event_id']) {
80
                    $form .= '<option value="' . $options[0] . '" selected>' . $value['event_name'] . '</option>';
81
                } else {
82
                    $form .= '<option value="' . $value['event_id'] . '">' . $value['event_name'] . '</option>';
83
                }
84
            }
85
            $form .= "</optgroup>";
86
        }
87
    } else {
88
    }
89
    $form .= "</select><br>";
90
91
    $form .= _MB_COUNTDOWN_DISPLAYEVENTDESCRIPTION . '&nbsp;';
92
    if (1 == $options[1]) {
93
        $chk = " checked";
94
    }
95
    $form .= "<input type='radio' name='options[1]' value='1'" . $chk . ' >&nbsp;' . _YES . '';
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $chk does not seem to be defined for all execution paths leading up to this point.
Loading history...
96
    $chk  = '';
97
    if (0 == $options[1]) {
98
        $chk = " checked";
99
    }
100
    $form .= "&nbsp;<input type='radio' name='options[1]' value='0'" . $chk . ' >' . _NO . '<br>';
101
102
    $form .= _MB_COUNTDOWN_DISPLAYEVENTLOGO . '&nbsp;';
103
    if (1 == $options[2]) {
104
        $chk = " checked";
105
    }
106
    $form .= "<input type='radio' name='options[2]' value='1'" . $chk . ' >&nbsp;' . _YES . '';
107
    $chk  = '';
108
    if (0 == $options[2]) {
109
        $chk = " checked";
110
    }
111
    $form .= "&nbsp;<input type='radio' name='options[2]' value='0'" . $chk . ' >' . _NO . '<br>';
112
113
    $form .= _MB_COUNTDOWN_DISPLAYINFO . '&nbsp;';
114
    if (1 == $options[3]) {
115
        $chk = " checked";
116
    }
117
    $form .= "<input type='radio' name='options[3]' value='1'" . $chk . ' >&nbsp;' . _YES . '';
118
    $chk  = '';
119
    if (0 == $options[3]) {
120
        $chk = " checked";
121
    }
122
    $form .= "&nbsp;<input type='radio' name='options[3]' value='0'" . $chk . ' >' . _NO . '<br>';
123
    return $form;
124
}
125
126
?>
127