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.

class/Entries.php (5 issues)

1
<?php
2
3
namespace XoopsModules\Lexikon;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * Module: lexikon
17
 *
18
 * @category        Module
19
 * @package         lexikon
20
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
21
 * @copyright       {@link https://xoops.org/ XOOPS Project}
22
 * @license         GPL 2.0 or later
23
 * @link            https://xoops.org/
24
 * @since           1.0.0
25
 */
26
27
use Xmf\Module\Helper\Permission;
28
use XoopsModules\Lexikon;
29
30
require_once \dirname(__DIR__) . '/include/common.php';
31
32
$moduleDirName = \basename(\dirname(__DIR__));
33
34
$permHelper = new \Xmf\Module\Helper\Permission($moduleDirName);
35
36
/**
37
 * Class LexikonEntries
38
 */
39
class Entries extends \XoopsObject
40
{
41
    /**
42
     * Constructor
43
     *
44
     * @param null
45
     */
46
    public function __construct()
47
    {
48
        parent::__construct();
49
        $this->initVar('entryID', \XOBJ_DTYPE_INT);
50
        $this->initVar('categoryID', \XOBJ_DTYPE_INT);
51
        $this->initVar('term', \XOBJ_DTYPE_TXTBOX);
52
        $this->initVar('init', \XOBJ_DTYPE_TXTBOX);
53
        $this->initVar('definition', \XOBJ_DTYPE_OTHER);
54
        $this->initVar('ref', \XOBJ_DTYPE_OTHER);
55
        $this->initVar('url', \XOBJ_DTYPE_TXTBOX);
56
        $this->initVar('uid', \XOBJ_DTYPE_INT);
57
        $this->initVar('submit', \XOBJ_DTYPE_INT);
58
        $this->initVar('datesub', \XOBJ_DTYPE_INT, \time(), false);
59
        $this->initVar('counter', \XOBJ_DTYPE_INT);
60
        $this->initVar('html', \XOBJ_DTYPE_INT);
61
        $this->initVar('smiley', \XOBJ_DTYPE_INT);
62
        $this->initVar('xcodes', \XOBJ_DTYPE_INT);
63
        $this->initVar('breaks', \XOBJ_DTYPE_INT);
64
        $this->initVar('block', \XOBJ_DTYPE_INT);
65
        $this->initVar('offline', \XOBJ_DTYPE_INT);
66
        $this->initVar('notifypub', \XOBJ_DTYPE_INT);
67
        $this->initVar('request', \XOBJ_DTYPE_INT);
68
        $this->initVar('comments', \XOBJ_DTYPE_INT);
69
        //        $this->initVar('item_tag', XOBJ_DTYPE_OTHER);
70
    }
71
72
    /**
73
     * Get form
74
     *
75
     * @param null
76
     * @return Form\EntriesForm
77
     */
78
    public function getForm()
79
    {
80
        //        require_once XOOPS_ROOT_PATH . '/modules/lexikon/class/form/entries.php';
81
82
        $form = new Form\EntriesForm($this);
83
84
        return $form;
85
    }
86
87
    /**
88
     * @return \XoopsThemeForm
89
     */
90
    public function getFormFilter()
91
    {
92
        global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig;
93
94
        $helper = Helper::getInstance();
95
96
        $grouppermHandler = \xoops_getHandler('groupperm');
97
        $groups           = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
98
        $action = $_SERVER['REQUEST_URI'];
0 ignored issues
show
The assignment to $action is dead and can be removed.
Loading history...
99
100
        // Get Theme Form
101
        \xoops_load('XoopsFormLoader');
102
        $form = new \XoopsThemeForm(_MD_LEXIKON_LOOKON, 'form', 'search.php', 'post', true);
103
        $form->setExtra('enctype="multipart/form-data"');
104
        // Form select search type
105
        $searchTypeSelect = new \XoopsFormSelect(\_MD_LEXIKON_LOOKON, 'type', $type);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $type seems to be never defined.
Loading history...
106
        $searchTypeSelect->addOption('1', _MD_LEXIKON_TERMS);
107
        $searchTypeSelect->addOption('2', _MD_LEXIKON_DEFINS);
108
        $searchTypeSelect->addOption('3', _MD_LEXIKON_TERMSDEFS);
109
        $form->addElement($searchTypeSelect);
110
        // form select cats
111
        if (1 == $helper->getConfig('multicats')) {
112
            $resultcat  = $xoopsDB->query('SELECT categoryID, name FROM ' . $xoopsDB->prefix('lxcategories') . ' ORDER BY categoryID');
113
            $searchCatSelect = new \XoopsFormSelect(\_MD_LEXIKON_LOOKON, 'categoryID', $categoryID);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $categoryID seems to be never defined.
Loading history...
114
            $searchCatSelect->addOption(0, _MD_LEXIKON_ALLOFTHEM);
115
            while (list($categoryID, $name) = $xoopsDB->fetchRow($resultcat)) {
116
                if ($grouppermHandler->checkRight('lexikon_view', (int)$categoryID, $groups, $xoopsModule->getVar('mid'))) {
0 ignored issues
show
The method checkRight() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsGroupPermHandler or XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

116
                if ($grouppermHandler->/** @scrutinizer ignore-call */ checkRight('lexikon_view', (int)$categoryID, $groups, $xoopsModule->getVar('mid'))) {
Loading history...
117
                    $searchCatSelect->addOption($categoryID, $categoryID . ' : ' . $name);
118
                }
119
            }
120
            $form->addElement($searchCatSelect);
121
        }
122
        // Form Text term
123
        $form->addElement(new \XoopsFormText(\_MD_LEXIKON_TERM, 'term', 30, 255, $term), true);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $term seems to be never defined.
Loading history...
124
        // To Save
125
        $form->addElement(new \XoopsFormHidden('op', 'save'));
126
        $form->addElement(new \XoopsFormButton('', 'submit', \_MD_LEXIKON_SEARCH, 'submit'));
127
128
        return $form;
129
    }
130
131
    /**
132
     * @return array|null
133
     */
134
    public function getGroupsRead()
135
    {
136
        global $permHelper;
137
        //return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_read', entryID);
138
        return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('entryID'));
139
    }
140
141
    /**
142
     * @return array|null
143
     */
144
    public function getGroupsSubmit()
145
    {
146
        global $permHelper;
147
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_submit', entryID);
148
        return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('entryID'));
149
    }
150
151
    /**
152
     * @return array|null
153
     */
154
    public function getGroupsModeration()
155
    {
156
        global $permHelper;
157
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('entries_moderation', entryID);
158
        return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('entryID'));
159
    }
160
}
161