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.

blocks/wflinks_top.php (3 issues)

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
 * @param mixed $cid
10
 * @param mixed $permType
11
 * @param mixed $redirect
12
 */
13
14
// checkBlockgroups()
15
//
16
// @param integer $cid
17
// @param string $permType
18
// @param boolean $redirect
19
// @return
20
/**
21
 * @param int    $cid
22
 * @param string $permType
23
 * @param bool   $redirect
24
 *
25
 * @return bool
26
 */
27
function checkBlockgroups($cid = 0, $permType = 'WFLinkCatPerm', $redirect = false)
28
{
29
    $moduleDirName = basename(dirname(__DIR__));
30
    global $xoopsUser;
31
32
    $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
33
    /** @var \XoopsGroupPermHandler $grouppermHandler */
34
    $grouppermHandler = xoops_getHandler('groupperm');
35
36
    /** @var \XoopsModuleHandler $moduleHandler */
37
    $moduleHandler = xoops_getHandler('module');
38
    $module        = $moduleHandler->getByDirname($moduleDirName);
39
40
    if (!$grouppermHandler->checkRight($permType, $cid, $groups, $module->getVar('mid'))) {
41
        if (false === $redirect) {
42
            return false;
43
        }
44
45
        redirect_header('index.php', 3, _NOPERM);
46
    }
47
    unset($module);
48
49
    return true;
50
}
51
52
// Function: b_mylinks_top_show
53
// Input   : $options[0] = date for the most recent links
54
//                 hits for the most popular links
55
//           $options[1] = How many links are displayes
56
//           $options[2] = Length of title
57
//           $options[3] = Date format
58
//           $block['content'] = The optional above content
59
// Output  : Returns the most recent or most popular links
60
/**
61
 * @param $options
62
 *
63
 * @return array
64
 */
65
function b_wflinks_top_show($options)
66
{
67
    $moduleDirName = basename(dirname(__DIR__));
68
    global $xoopsDB;
69
70
    $block = [];
71
    $time  = time();
72
    /** @var \XoopsModuleHandler $moduleHandler */
73
    $moduleHandler = xoops_getHandler('module');
74
    $wflModule     = $moduleHandler->getByDirname($moduleDirName);
75
    /* @var \XoopsConfigHandler $configHandler */
76
    /** @var \XoopsConfigHandler $configHandler */
77
    $configHandler   = xoops_getHandler('config');
78
    $wflModuleConfig = $configHandler->getConfigsByCat(0, $wflModule->getVar('mid'));
0 ignored issues
show
The assignment to $wflModuleConfig is dead and can be removed.
Loading history...
79
    $myts            = MyTextSanitizer:: getInstance();
0 ignored issues
show
The assignment to $myts is dead and can be removed.
Loading history...
80
81
    $result = $xoopsDB->query('SELECT lid, cid, title, published, hits FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published > 0 AND published <= ' . $time . ' AND (expired = 0 OR expired > ' . $time . ') AND offline = 0 ORDER BY ' . $options[0] . ' DESC', $options[1], 0);
82
    while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
83
        if (0 == $myrow['cid'] || false === checkBlockgroups($myrow['cid'])) {
84
            continue;
85
        }
86
        $linkload = [];
87
        $title    = htmlspecialchars($myrow['title'], ENT_QUOTES | ENT_HTML5);
88
        if (!XOOPS_USE_MULTIBYTES) {
89
            if (mb_strlen($myrow['title']) >= $options[2]) {
90
                $title = mb_substr($myrow['title'], 0, $options[2] - 1) . '...';
91
            }
92
        }
93
        $linkload['id']    = (int)$myrow['lid'];
94
        $linkload['cid']   = (int)$myrow['cid'];
95
        $linkload['title'] = $title;
96
        if ('published' === $options[0]) {
97
            $linkload['date'] = formatTimestamp($myrow['published'], $options[3]);
98
        } elseif ('hits' === $options[0]) {
99
            $linkload['hits'] = $myrow['hits'];
100
        }
101
        $linkload['dirname'] = $wflModule->getVar('dirname');
102
        $block['links'][]    = $linkload;
103
    }
104
    unset($_block_check_array);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $_block_check_array seems to be never defined.
Loading history...
105
106
    return $block;
107
}
108
109
// b_wflinks_top_edit()
110
//
111
// @param $options
112
// @return
113
/**
114
 * @param $options
115
 *
116
 * @return string
117
 */
118
function b_wflinks_top_edit($options)
119
{
120
    $form = '' . _MB_WFL_DISP . '&nbsp;';
121
    $form .= "<input type='hidden' name='options[]' value='";
122
    if ('published' === $options[0]) {
123
        $form .= "published'";
124
    } else {
125
        $form .= "hits'";
126
    }
127
    $form .= '>';
128
    $form .= "<input type='text' name='options[]' value='" . $options[1] . "'>&nbsp;" . _MB_WFL_FILES . '';
129
    $form .= '&nbsp;<br>' . _MB_WFL_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_WFL_LENGTH . '';
130
    $form .= '&nbsp;<br>' . _MB_WFL_DATEFORMAT . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_WFL_DATEFORMATMANUAL;
131
132
    return $form;
133
}
134