Issues (330)

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

1
<?php
2
3
/**
4
 * Module: Lexikon - glossary module
5
 * Author: hsalazar
6
 * Licence: GNU
7
 */
8
defined('XOOPS_ROOT_PATH') || exit('Restricted access');
9
10
/**
11
 * @return array
12
 */
13
function b_lxentries_random_show()
14
{
15
    global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule;
16
    $myts = \MyTextSanitizer::getInstance();
17
18
    /** @var \XoopsModuleHandler $moduleHandler */
19
    $moduleHandler = xoops_getHandler('module');
20
    $lexikon       = $moduleHandler->getByDirname('lexikon');
21
22
    if (!isset($lxConfig)) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $lxConfig seems to never exist and therefore isset should always be false.
Loading history...
23
        /** @var \XoopsConfigHandler $configHandler */
24
        $configHandler = xoops_getHandler('config');
25
        $lxConfig      = $configHandler->getConfigsByCat(0, $lexikon->getVar('mid'));
26
    }
27
    $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
28
    /** @var \XoopsGroupPermHandler $grouppermHandler */
29
    $grouppermHandler = xoops_getHandler('groupperm');
30
    $module_id        = $lexikon->getVar('mid');
31
    $allowed_cats     = $grouppermHandler->getItemIds('lexikon_view', $groups, $module_id);
32
    $catids           = implode(',', $allowed_cats);
33
    $catperms         = " AND categoryID IN ($catids) ";
34
35
    $adminlinks     = '';
36
    $block          = [];
37
    $block['title'] = _MB_LEXIKON_RANDOMTITLE;
38
39
    [$numrows] = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(entryID) FROM ' . $xoopsDB->prefix('lxentries') . " WHERE offline= '0' AND block = '1' " . $catperms . ' '));
40
41
    if ($numrows > 1) {
42
        --$numrows;
43
        $entrynumber = random_int(0, $numrows);
44
    } else {
45
        $entrynumber = 0;
46
    }
47
48
    $result = $xoopsDB->query('SELECT entryID, categoryID, term, definition FROM ' . $xoopsDB->prefix('lxentries') . " WHERE offline = '0' AND block = '1' " . $catperms . " LIMIT $entrynumber, 1");
49
50
    while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
51
        //$entryID = (int)($entryID);
52
        $entryID = (int)$myrow['entryID'];
53
        $term    = ucfirst($myts->displayTarea($myrow['term']));
54
55
        if (XOOPS_USE_MULTIBYTES) {
56
            $deftemp    = xoops_substr($myrow['definition'], 0, $lxConfig['rndlength'] - 1);
57
            $definition = $myts->displayTarea($deftemp, 1, 1, 1, 1, 1);
58
        }
59
60
        $categoryID = $myrow['categoryID'];
61
        $result_cat = $xoopsDB->query('SELECT categoryID, name FROM ' . $xoopsDB->prefix('lxcategories') . " WHERE categoryID = $categoryID");
62
        [$categoryID, $name] = $xoopsDB->fetchRow($result_cat);
63
        $categoryname = $myts->displayTarea($name);
64
65
        //TODO switch to central icons repository
66
67
        if ($xoopsUser) {
68
            if ($xoopsUser->isAdmin()) {
69
                $adminlinks = '<a href="'
70
                              . XOOPS_URL
71
                              . '/modules/'
72
                              . $lexikon->dirname()
73
                              . '/admin/entry.php?op=mod&entryID='
74
                              . $entryID
75
                              . '" target="_blank"><img src="'
76
                              . XOOPS_URL
77
                              . '/modules/'
78
                              . $lexikon->dirname()
79
                              . '/assets/images/edit.gif" alt="'
80
                              . _MB_LEXIKON_EDITTERM
81
                              . '" width="16" height="16" ></a>&nbsp;<a href="'
82
                              . XOOPS_URL
83
                              . '/modules/'
84
                              . $lexikon->dirname()
85
                              . '/admin/entry.php?op=del&entryID='
86
                              . $entryID
87
                              . '" target="_self"><img src="'
88
                              . XOOPS_URL
89
                              . '/modules/'
90
                              . $lexikon->dirname()
91
                              . '/assets/images/delete.gif" alt="'
92
                              . _MB_LEXIKON_DELTERM
93
                              . '" width="16" height="16" ></a>&nbsp;';
94
            }
95
        }
96
        $userlinks = '<a href="'
97
                     . XOOPS_URL
98
                     . '/modules/'
99
                     . $lexikon->dirname()
100
                     . '/print.php?entryID='
101
                     . $entryID
102
                     . '" target="_blank"><img src="'
103
                     . XOOPS_URL
104
                     . '/modules/'
105
                     . $lexikon->dirname()
106
                     . '/assets/images/print.gif" alt="'
107
                     . _MB_LEXIKON_PRINTTERM
108
                     . '" width="16" height="16" ></a>&nbsp;<a href="mailto:?subject='
109
                     . sprintf(_MB_LEXIKON_INTENTRY, $xoopsConfig['sitename'])
110
                     . '&amp;body='
111
                     . sprintf(_MB_LEXIKON_INTENTRYFOUND, $xoopsConfig['sitename'])
112
                     . ':&nbsp;'
113
                     . XOOPS_URL
114
                     . '/modules/'
115
                     . $lexikon->dirname()
116
                     . '/entry.php?entryID='
117
                     . $entryID
118
                     . '" target="_blank"><img src="'
119
                     . XOOPS_URL
120
                     . '/modules/'
121
                     . $lexikon->dirname()
122
                     . '/assets/images/friend.gif" alt="'
123
                     . _MB_LEXIKON_SENDTOFRIEND
124
                     . '" width="16" height="16" ></a>&nbsp;';
125
126
        if (1 == $lxConfig['multicats']) {
127
            $block['content'] = '<div style="font-size: 12px; font-weight: bold; background-color: #ccc; padding: 4px; margin: 0;"><a href="' . XOOPS_URL . '/modules/' . $lexikon->dirname() . "/category.php?categoryID=$categoryID\">$categoryname</a></div>";
128
            $block['content'] .= "<div style=\"padding: 4px 0 0 0; color: #456;\"><h5 style=\"margin: 0;\">$adminlinks $userlinks <a href=\"" . XOOPS_URL . '/modules/' . $lexikon->dirname() . "/entry.php?entryID=$entryID\">$term</a></h5>$definition</div>";
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $definition does not seem to be defined for all execution paths leading up to this point.
Loading history...
129
        } else {
130
            $block['content'] = "<div style=\"padding: 4px; color: #456;\"><h5 style=\"margin: 0;\">$adminlinks $userlinks <a style=\"margin: 0;\" href=\"" . XOOPS_URL . '/modules/' . $lexikon->dirname() . "/entry.php?entryID=$entryID\">$term</a></h5>$definition</div>";
131
        }
132
    }
133
134
    $block['content'] .= '<div style="text-align: right; font-size: x-small;"><a href="' . XOOPS_URL . '/modules/' . $lexikon->dirname() . '/index.php">' . _MB_LEXIKON_SEEMORE . '</a></div>';
135
136
    return $block;
137
}
138