Issues (273)

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.

admin/modifications.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Module: WF-Links
4
 * Version: v1.0.3
5
 * Release Date: 21 June 2005
6
 * Developer: John N
7
 * Team: WF-Projects
8
 * Licence: GNU
9
 */
10
11
use Xmf\Request;
12
use XoopsModules\Wflinks;
13
14
require_once __DIR__ . '/admin_header.php';
15
16
/** @var Wflinks\Helper $helper */
17
$helper = Wflinks\Helper::getInstance();
18
19
global $mytree;
20
xoops_load('XoopsUserUtility');
21
$op        = \Xmf\Request::getString('op', '');
22
$requestid = \Xmf\Request::getInt('requestid', 0);
23
24
switch (mb_strtolower($op)) {
25
    case 'listmodreqshow':
26
27
        xoops_cp_header();
28
29
        $sql       = 'SELECT modifysubmitter, requestid, lid, cid, title, url, description, screenshot, forumid, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat FROM '
30
                     . $xoopsDB->prefix('wflinks_mod')
31
                     . ' WHERE requestid='
32
                     . $requestid;
33
        $mod_array = $xoopsDB->fetchArray($xoopsDB->query($sql));
34
        unset($sql);
35
36
        $sql        = 'SELECT submitter, lid, cid, title, url, description, screenshot, forumid, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat FROM '
37
                      . $xoopsDB->prefix('wflinks_links')
38
                      . ' WHERE lid='
39
                      . $mod_array['lid'];
40
        $orig_array = $xoopsDB->fetchArray($xoopsDB->query($sql));
41
        unset($sql);
42
43
        $orig_user      = new \XoopsUser($orig_array['submitter']);
44
        $submittername  = \XoopsUserUtility::getUnameFromId($orig_array['submitter']);
45
        $submitteremail = $orig_user::getUnameFromId('email');
0 ignored issues
show
'email' of type string is incompatible with the type integer expected by parameter $userid of XoopsUser::getUnameFromId(). ( Ignorable by Annotation )

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

45
        $submitteremail = $orig_user::getUnameFromId(/** @scrutinizer ignore-type */ 'email');
Loading history...
46
47
        echo '<div><b>' . _AM_WFL_MOD_MODPOSTER . "</b> $submittername</div>";
48
        $not_allowed = ['lid', 'submitter', 'requestid', 'modifysubmitter'];
49
        $sform       = new \XoopsThemeForm(_AM_WFL_MOD_ORIGINAL, 'storyform', 'index.php');
50
        foreach ($orig_array as $key => $content) {
51
            if (in_array($key, $not_allowed)) {
52
                continue;
53
            }
54
            $lang_def = constant('_AM_WFL_MOD_' . mb_strtoupper($key));
55
56
            if ('cid' === $key) {
57
                $sql     = 'SELECT title FROM ' . $xoopsDB->prefix('wflinks_cat') . ' WHERE cid=' . $content;
58
                $row     = $xoopsDB->fetchArray($xoopsDB->query($sql));
59
                $content = $row['title'];
60
            }
61
            if ('forumid' === $key) {
62
                $content = '';
63
                /** @var \XoopsModuleHandler $moduleHandler */
64
                $moduleHandler    = xoops_getHandler('module');
65
                $xoopsforumModule = $moduleHandler->getByDirname('newbb');
66
                $sql              = 'SELECT title FROM ' . $xoopsDB->prefix('bb_categories') . ' WHERE cid=' . $content;
67
                if ($xoopsforumModule && $content > 0) {
68
                    $content = "<a href='" . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $content . "'>Forumid</a>";
69
                }
70
            }
71
            if ('screenshot' === $key) {
72
                $content = '';
73
                if ($content > 0) {
74
                    $content = "<img src='" . XOOPS_URL . '/' . $helper->getConfig('screenshots') . '/' . $logourl . "' width='" . $helper->getConfig('shotwidth') . "' alt=''>";
75
                }
76
            }
77
            if ('country' === $key) {
78
                $content = Wflinks\Utility::getCountryName($mod_array['country']);
79
            }
80
            $sform->addElement(new \XoopsFormLabel($lang_def, $content));
81
        }
82
        $sform->display();
83
84
        $orig_user      = new \XoopsUser($mod_array['modifysubmitter']);
85
        $submittername  = \XoopsUserUtility::getUnameFromId($mod_array['modifysubmitter']);
86
        $submitteremail = $orig_user::getUnameFromId('email');
87
88
        echo '<div><b>' . _AM_WFL_MOD_MODIFYSUBMITTER . "</b> $submittername</div>";
89
        $sform = new \XoopsThemeForm(_AM_WFL_MOD_PROPOSED, 'storyform', 'modifications.php');
90
        foreach ($mod_array as $key => $content) {
91
            if (in_array($key, $not_allowed)) {
92
                continue;
93
            }
94
            $lang_def = constant('_AM_WFL_MOD_' . mb_strtoupper($key));
95
96
            if ('cid' === $key) {
97
                $sql     = 'SELECT title FROM ' . $xoopsDB->prefix('wflinks_cat') . ' WHERE cid=' . $content;
98
                $row     = $xoopsDB->fetchArray($xoopsDB->query($sql));
99
                $content = $row['title'];
100
            }
101
            if ('forumid' === $key) {
102
                $content = '';
103
                /** @var \XoopsModuleHandler $moduleHandler */
104
                $moduleHandler    = xoops_getHandler('module');
105
                $xoopsforumModule = $moduleHandler->getByDirname('newbb');
106
                $sql              = 'SELECT title FROM ' . $xoopsDB->prefix('bb_categories') . ' WHERE cid=' . $content;
107
                $content          = '';
108
                if ($xoopsforumModule && $content > 0) {
109
                    $content = "<a href='" . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $content . "'>Forumid</a>";
110
                }
111
            }
112
            if ('screenshot' === $key) {
113
                $content = '';
114
                if ($content > 0) {
115
                    $content = "<img src='" . XOOPS_URL . '/' . $helper->getConfig('screenshots') . '/' . $logourl . "' width='" . $helper->getConfig('shotwidth') . "' alt=''>";
116
                }
117
            }
118
            if ('country' === $key) {
119
                $content = Wflinks\Utility::getCountryName($mod_array['country']);
120
            }
121
            $sform->addElement(new \XoopsFormLabel($lang_def, $content));
122
        }
123
        $buttonTray = new \XoopsFormElementTray('', '');
124
        $buttonTray->addElement(new \XoopsFormHidden('requestid', $requestid));
125
        $buttonTray->addElement(new \XoopsFormHidden('lid', $mod_array['requestid']));
126
        $hidden = new \XoopsFormHidden('op', 'changemodreq');
127
        $buttonTray->addElement($hidden);
128
        if ($mod_array) {
129
            $butt_dup = new \XoopsFormButton('', '', _AM_WFL_BAPPROVE, 'submit');
130
            $butt_dup->setExtra('onclick="this.form.elements.op.value=\'changemodreq\'"');
131
            $buttonTray->addElement($butt_dup);
132
        }
133
        $butt_dupct2 = new \XoopsFormButton('', '', _AM_WFL_BIGNORE, 'submit');
134
        $butt_dupct2->setExtra('onclick="this.form.elements.op.value=\'ignoremodreq\'"');
135
        $buttonTray->addElement($butt_dupct2);
136
        $sform->addElement($buttonTray);
137
        $sform->display();
138
        xoops_cp_footer();
139
        break;
140
    case 'changemodreq':
141
        $sql        = 'SELECT * FROM ' . $xoopsDB->prefix('wflinks_mod') . ' WHERE requestid=' . $requestid;
142
        $link_array = $xoopsDB->fetchArray($xoopsDB->query($sql));
143
144
        $lid         = $link_array['lid'];
145
        $cid         = $link_array['cid'];
146
        $title       = $link_array['title'];
147
        $url         = $link_array['url'];
148
        $publisher   = $xoopsUser->uname();
149
        $screenshot  = $link_array['screenshot'];
150
        $description = $link_array['description'];
151
        $submitter   = $link_array['modifysubmitter'];
152
        $country     = $link_array['country'];
153
        $keywords    = $link_array['keywords'];
154
        $item_tag    = $link_array['item_tag'];
155
        $googlemap   = $link_array['googlemap'];
156
        $yahoomap    = $link_array['yahoomap'];
157
        $multimap    = $link_array['multimap'];
158
        $street1     = $link_array['street1'];
159
        $street2     = $link_array['street2'];
160
        $town        = $link_array['town'];
161
        $state       = $link_array['state'];
162
        $zip         = $link_array['zip'];
163
        $tel         = $link_array['tel'];
164
        $fax         = $link_array['fax'];
165
        $voip        = $link_array['voip'];
166
        $mobile      = $link_array['mobile'];
167
        $email       = $link_array['email'];
168
        $vat         = $link_array['vat'];
169
        $updated     = time();
170
171
        $xoopsDB->query(
172
            'UPDATE '
173
            . $xoopsDB->prefix('wflinks_links')
174
            . " SET cid = $cid, title='$title', url='$url', submitter='$submitter', screenshot='$screenshot', publisher='$publisher', status='2', updated='$updated', description='$description', country='$country', keywords='$keywords', item_tag='$item_tag', googlemap='$googlemap', yahoomap='$yahoomap', multimap='$multimap', street1='$street1', street2='$street2', town='$town', state='$state',  zip='$zip', tel='$tel', fax='$fax', voip='$voip', mobile='$mobile', email='$email', vat='$vat' WHERE lid = "
175
            . $lid
176
        );
177
        $sql    = 'DELETE FROM ' . $xoopsDB->prefix('wflinks_mod') . ' WHERE requestid=' . $requestid;
178
        $result = $xoopsDB->query($sql);
179
        redirect_header('index.php', 1, _AM_WFL_MOD_REQUPDATED);
180
        break;
181
    case 'ignoremodreq':
182
        $sql = sprintf('DELETE FROM ' . $xoopsDB->prefix('wflinks_mod') . ' WHERE requestid=' . $requestid);
183
        $xoopsDB->query($sql);
184
        redirect_header('index.php', 1, _AM_WFL_MOD_REQDELETED);
185
        break;
186
    case 'main':
187
    default:
188
189
        $start            = Request::getInt('start', 0, 'GET');
190
        $mytree           = new Wflinks\Tree($xoopsDB->prefix('wflinks_mod'), 'requestid', 0);
191
        $sql              = 'SELECT * FROM ' . $xoopsDB->prefix('wflinks_mod') . ' ORDER BY requestdate DESC';
192
        $result           = $xoopsDB->query($sql, $helper->getConfig('admin_perpage'), $start);
193
        $totalmodrequests = $xoopsDB->getRowsNum($xoopsDB->query($sql));
194
195
        xoops_cp_header();
196
197
        echo "<fieldset><legend style='font-weight: bold; color: #0A3760;'>" . _AM_WFL_MOD_MODREQUESTSINFO . "</legend>\n";
198
        echo "<div style='padding: 8px;'>" . _AM_WFL_MOD_TOTMODREQUESTS . " <b>$totalmodrequests<></div>\n";
199
        echo "</fieldset><br>\n";
200
201
        echo "<table width='100%' cellspacing='1' class='outer'>\n";
202
        echo "<tr class='center;'>\n";
203
        echo '<th>' . _AM_WFL_MOD_MODID . "</th>\n";
204
        echo "<th style='text-align: left;'>" . _AM_WFL_MOD_MODTITLE . "</th>\n";
205
        echo '<th>' . _AM_WFL_MOD_MODIFYSUBMIT . "</th>\n";
206
        echo '<th>' . _AM_WFL_MOD_DATE . "</th>\n";
207
        echo '<th>' . _AM_WFL_MINDEX_ACTION . "</th>\n";
208
        echo "</tr>\n";
209
        if ($totalmodrequests > 0) {
210
            while (false !== ($link_arr = $xoopsDB->fetchArray($result))) {
211
                $path        = $mytree->getNicePathFromId($link_arr['requestid'], 'title', 'modifications.php?op=listmodreqshow&requestid');
212
                $path        = str_replace('/', '', $path);
213
                $path        = str_replace(':', '', trim($path));
214
                $title       = trim($path);
215
                $submitter   = \XoopsUserUtility::getUnameFromId($link_arr['modifysubmitter']);
216
                $requestdate = formatTimestamp($link_arr['requestdate'], $helper->getConfig('dateformatadmin'));
217
218
                echo "<tr class='center;'>\n";
219
                echo "<td class='head'>" . $link_arr['requestid'] . "</td>\n";
220
                echo "<td class='even' style='text-align: left;'>" . $title . "</td>\n";
221
                echo "<td class='even'>" . $submitter . "</td>\n";
222
                echo "<td class='even'>" . $requestdate . "</td>\n";
223
                echo "<td class='even'> <a href='modifications.php?op=listmodreqshow&amp;requestid=" . $link_arr['requestid'] . "'>" . $imageArray['view'] . "</a></td>\n";
224
                echo "</tr>\n";
225
            }
226
        } else {
227
            echo "<tr class='center;'><td class='head' colspan='7'>" . _AM_WFL_MOD_NOMODREQUEST . '</td></tr>';
228
        }
229
        echo "</table>\n";
230
231
        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
232
        //        $page = ( $totalmodrequests > $helper->getConfig('admin_perpage') ) ? _AM_WFL_MINDEX_PAGE : '';
233
        $pagenav = new \XoopsPageNav($totalmodrequests, $helper->getConfig('admin_perpage'), $start, 'start');
234
        echo "<div style='text-align: right; padding: 8px;'>" . $pagenav->renderNav() . '</div>';
235
        require_once __DIR__ . '/admin_footer.php';
236
}
237