Issues (130)

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.

include/notification.inc.php (1 issue)

1
<?php
2
3
// $Id$
4
//  ------------------------------------------------------------------------ //
5
//                XOOPS - PHP Content Management System                      //
6
//                    Copyright (c) 2000 XOOPS.org                           //
7
//                       <https://xoops.org>                             //
8
//  ------------------------------------------------------------------------ //
9
//  This program is free software; you can redistribute it and/or modify     //
10
//  it under the terms of the GNU General Public License as published by     //
11
//  the Free Software Foundation; either version 2 of the License, or        //
12
//  (at your option) any later version.                                      //
13
//                                                                           //
14
//  You may not change or alter any portion of this comment or credits       //
15
//  of supporting developers from this source code or any supporting         //
16
//  source code which is considered copyrighted (c) material of the          //
17
//  original comment or credit authors.                                      //
18
//                                                                           //
19
//  This program is distributed in the hope that it will be useful,          //
20
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
21
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
22
//  GNU General Public License for more details.                             //
23
//                                                                           //
24
//  You should have received a copy of the GNU General Public License        //
25
//  along with this program; if not, write to the Free Software              //
26
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
27
//  ------------------------------------------------------------------------ //
28
29
/**
30
 * Required file for supporting notification feature
31
 *
32
 * @package    chess
33
 * @subpackage notification
34
 */
35
36
/**#@+
37
 */
38
// Needed since module language constants are used here.
39
// The language file gets automatically included within this module,
40
// but not when viewing the notifications page via notifications.php.
41
global $xoopsConfig;
42
if (file_exists(XOOPS_ROOT_PATH . "/modules/chess/language/{$xoopsConfig['language']}/main.php")) {
43
    require_once XOOPS_ROOT_PATH . "/modules/chess/language/{$xoopsConfig['language']}/main.php";
44
} else {
45
    require_once XOOPS_ROOT_PATH . '/modules/chess/language/english/main.php';
46
}
47
/**#@-*/
48
49
/**
50
 * Get name and URL of notification item.
51
 *
52
 * @param string $category Notification category
53
 * @param int    $item_id  ID of item for which notification is being made
54
 * @return array  Array containing two elements:
55
 *                         - Name of item
56
 *                         - URL of item
57
 */
58
function chess_notify_item_info($category, $item_id)
59
{
60
    if ('global' == $category) {
61
        $item['name'] = 'Chess';
62
63
        $item['url'] = XOOPS_URL . '/modules/chess/';
64
65
        return $item;
66
    } elseif ('game' == $category) {
67
        global $xoopsDB;
68
69
        $table = $xoopsDB->prefix('chess_games');
70
71
        $result = $xoopsDB->query(
72
            trim(
73
                "
74
            SELECT white_uid, black_uid, UNIX_TIMESTAMP(start_date) AS start_date
75
            FROM   $table
76
            WHERE  game_id = '$item_id'
77
        "
78
            )
79
        );
80
81
        $gamedata = $xoopsDB->fetchArray($result);
82
83
        $xoopsDB->freeRecordSet($result);
84
85
        if (false !== $gamedata) {
86
            // get mapping of user IDs to usernames
87
88
            $criteria = new \Criteria('uid', "({$gamedata['white_uid']}, {$gamedata['black_uid']})", 'IN');
89
90
            $memberHandler = xoops_getHandler('member');
91
92
            $usernames = $memberHandler->getUserList($criteria);
0 ignored issues
show
The method getUserList() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

92
            /** @scrutinizer ignore-call */ 
93
            $usernames = $memberHandler->getUserList($criteria);
Loading history...
93
94
            $username_white = $usernames[$gamedata['white_uid']] ?? _MD_CHESS_NA;
95
96
            $username_black = $usernames[$gamedata['black_uid']] ?? _MD_CHESS_NA;
97
98
            $date = $gamedata['start_date'] ? date('Y.m.d', $gamedata['start_date']) : _MD_CHESS_NA;
99
        } else {
100
            $username_white = _MD_CHESS_NA;
101
102
            $username_black = _MD_CHESS_NA;
103
104
            $date = _MD_CHESS_NA;
105
        }
106
107
        $item['name'] = "$username_white " . _MD_CHESS_LABEL_VS . " $username_black ($date)";
108
109
        $item['url'] = XOOPS_URL . '/modules/chess/game.php?game_id=' . $item_id;
110
111
        return $item;
112
    }
113
}
114