Issues (340)

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/vars.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
/**
4
 * NewBB,  the forum module for XOOPS project
5
 *
6
 * @copyright      XOOPS Project (https://xoops.org)
7
 * @license        GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
8
 * @author         Taiwen Jiang (phppp or D.J.) <[email protected]>
9
 * @since          4.00
10
 */
11
12
use Xmf\IPAddress;
13
14
require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.ini.php');
15
require_once __DIR__ . '/functions.session.php';
16
17
// NewBB cookie structure
18
/* NewBB cookie storage
19
    Long term cookie: (configurable, generally one month)
20
        LV - Last Visit
21
        M - Menu mode
22
        V - View mode
23
        G - Toggle
24
    Short term cookie: (same as session life time)
25
        ST - Stored Topic IDs for mark
26
        LP - Last Post
27
        LF - Forum Last view
28
        LT - Topic Last read
29
        LVT - Last Visit Temp
30
*/
31
32
/* -- Cookie settings -- */
33
$forumCookie['domain'] = '';
34
$forumCookie['path']   = '/';
35
$forumCookie['secure'] = false;
36
$forumCookie['expire'] = time() + 3600 * 24 * 30; // one month
37
$forumCookie['prefix'] = 'newbb_' . (is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : '0IP' . IPAddress::fromRequest()->asReadable()); // irmtfan IP for anons - use $GLOBALS["xoopsUser"]
38
39
// set LastVisitTemp cookie, which only gets the time from the LastVisit cookie if it does not exist yet
40
// otherwise, it gets the time from the LastVisitTemp cookie
41
$last_visit = newbbGetSession('LV');
42
$last_visit = $last_visit ?: newbbGetCookie('LV');
43
$last_visit = $last_visit ?: time();
44
45
// update LastVisit cookie.
46
newbbSetCookie('LV', time(), $forumCookie['expire']); // set cookie life time to one month
47
newbbSetSession('LV', $last_visit);
0 ignored issues
show
It seems like $last_visit can also be of type true; however, parameter $string of newbbSetSession() does only seem to accept array<mixed,mixed>|string, maybe add an additional type check? ( Ignorable by Annotation )

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

47
newbbSetSession('LV', /** @scrutinizer ignore-type */ $last_visit);
Loading history...
48
49
// include customized variables
50
if (is_object($GLOBALS['xoopsModule']) && 'newbb' === $GLOBALS['xoopsModule']->getVar('dirname', 'n')) {
51
    $GLOBALS['xoopsModuleConfig'] = newbbLoadConfig();
52
}
53