Issues (267)

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.

newlist.php (3 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * Module: XoopsTube
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
 * PHP version 5
11
 *
12
 * @category        Module
13
 * @package         Xoopstube
14
 * @author          XOOPS Development Team
15
 * @copyright       2001-2016 XOOPS Project (https://xoops.org)
16
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
17
 * @since           1.0.6
18
 * @link            https://xoops.org/
19
 */
20
21
use Xmf\Request;
22
use XoopsModules\Xoopstube\{
23
    Utility,
24
    Tree
25
};
26
27
$GLOBALS['xoopsOption']['template_main'] = 'xoopstube_newlistindex.tpl';
28
require_once __DIR__ . '/header.php';
29
30
31
//require_once XOOPS_ROOT_PATH . '/header.php';
32
$xoTheme->addStylesheet('modules/' . $moduleDirName . '/assets/css/xtubestyle.css');
33
34
global $xoopsModule;
35
36
$catarray['imageheader'] = Utility::renderImageHeader();
37
$xoopsTpl->assign('catarray', $catarray);
38
if (!isset($_GET['newvideoshowdays'])) {
39
    redirect_header('newlist.php?newvideoshowdays=7', 1, '');
40
}
41
42
if (Request::hasVar('newvideoshowdays', 'GET')) {
43
    $newvideoshowdays = Request::getInt('newvideoshowdays', 7, 'GET');
44
    if (7 !== $newvideoshowdays) {
45
        if (14 !== $newvideoshowdays) {
46
            if (30 !== $newvideoshowdays) {
47
                redirect_header('newlist.php?newvideoshowdays=7', 5, _MD_XOOPSTUBE_STOPIT . '<br><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/security.png">');
48
            }
49
        }
50
    }
51
    $currentTime       = time();
52
    $timestamp30daysAgo       = ($currentTime - (86400 * 30));
53
    $timestamp7daysAgo  = ($currentTime - (86400 * 7));
54
    $allmonthvideos = 0;
55
    $allweekvideos  = 0;
56
    $result         = $GLOBALS['xoopsDB']->query(
57
        'SELECT lid, cid, published, updated FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE (published >= ' . $timestamp30daysAgo . ' AND published <= ' . $currentTime . ') OR updated >= ' . $timestamp30daysAgo . ' AND (expired = 0 OR expired > ' . $currentTime . ') AND offline = 0'
58
    );
59
60
    while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
61
        $published = ($myrow['updated'] > 0) ? $myrow['updated'] : $myrow['published'];
62
        ++$allmonthvideos;
63
        if ($published > $timestamp7daysAgo) {
64
            ++$allweekvideos;
65
        }
66
    }
67
    $xoopsTpl->assign('allweekvideos', $allweekvideos);
68
    $xoopsTpl->assign('allmonthvideos', $allmonthvideos);
69
70
    // List Last VARIABLE Days of videos
71
    //  $newvideoshowdays = cleanRequestVars($_REQUEST, 'newvideoshowdays', 7 );
72
    $newvideoshowdays = (int)Request::getInt('newvideoshowdays', 7, 'GET');
73
    $xoopsTpl->assign('newvideoshowdays', $newvideoshowdays);
74
75
    $dailyvideos = [];
76
    for ($i = 0; $i < $newvideoshowdays; ++$i) {
77
        $key                                 = $newvideoshowdays - $i - 1;
78
        $time                                = $currentTime - (86400 * $key);
79
        $dailyvideos[$key]['newvideodayRaw'] = $time;
80
        $dailyvideos[$key]['newvideoView']   = Utility::getTimestamp(formatTimestamp($time, $GLOBALS['xoopsModuleConfig']['dateformat']));
81
        $dailyvideos[$key]['totalvideos']    = 0;
82
    }
83
}
84
85
$timestamp30daysAgo = ($currentTime - (86400 * ($newvideoshowdays - 1)));
86
$sql =     'SELECT lid, cid, published, updated FROM '
87
           . $GLOBALS['xoopsDB']->prefix('xoopstube_videos')
88
           . ' WHERE (published > '
89
           . $timestamp30daysAgo
90
           . ' AND published <= '
91
           . $currentTime
92
           . ') OR (updated >= '
93
           . $timestamp30daysAgo
94
           . ' AND updated <= '
95
           . $currentTime
96
           . ') AND (expired = 0 OR expired > '
97
           . $currentTime
98
           . ') AND offline = 0';
99
100
$result   = $GLOBALS['xoopsDB']->query($sql);
101
102
while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
103
//    $published = ($myrow['updated'] > 0) ? date($GLOBALS['xoopsModuleConfig']['dateformat'], $myrow['updated']) : date($GLOBALS['xoopsModuleConfig']['dateformat'], $myrow['published']);
104
    $published = ($myrow['updated'] > 0) ? $myrow['updated'] : $myrow['published'];
105
    $d         = date('j', $published);
106
    $m         = date('m', $published);
107
    $y         = date('Y', $published);
108
    $key       = (int)($currentTime - mktime(0, 0, 0, $m, $d, $y) / 86400);
0 ignored issues
show
$d of type string is incompatible with the type integer expected by parameter $day of mktime(). ( Ignorable by Annotation )

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

108
    $key       = (int)($currentTime - mktime(0, 0, 0, $m, /** @scrutinizer ignore-type */ $d, $y) / 86400);
Loading history...
$m of type string is incompatible with the type integer expected by parameter $month of mktime(). ( Ignorable by Annotation )

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

108
    $key       = (int)($currentTime - mktime(0, 0, 0, /** @scrutinizer ignore-type */ $m, $d, $y) / 86400);
Loading history...
$y of type string is incompatible with the type integer expected by parameter $year of mktime(). ( Ignorable by Annotation )

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

108
    $key       = (int)($currentTime - mktime(0, 0, 0, $m, $d, /** @scrutinizer ignore-type */ $y) / 86400);
Loading history...
109
110
    $key2 = $published; //mb
111
112
    if (isset($dailyvideos[$key])) {
113
        $dailyvideos[$key]['totalvideos']++;
114
    }
115
}
116
ksort($dailyvideos);
117
reset($dailyvideos);
118
$xoopsTpl->assign('dailyvideos', $dailyvideos);
119
120
$xoopsTpl->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName);
121
122
unset($dailyvideos);
123
124
$mytree = new Tree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid');
125
$sql    = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos');
126
$sql    .= ' WHERE (published > 0 AND published <= ' . $currentTime . ')
127
         OR (updated > 0 AND updated <= ' . $currentTime . ')
128
         AND (expired = 0 OR expired > ' . $currentTime . ')
129
         AND offline = 0
130
         ORDER BY ' . $GLOBALS['xoopsModuleConfig']['linkxorder'];
131
$result = $GLOBALS['xoopsDB']->query($sql, 10, 0);
132
while (false !== ($videoArray = $GLOBALS['xoopsDB']->fetchArray($result))) {
133
    require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/videoloadinfo.php';
134
}
135
136
$xoopsTpl->assign('back', '<a href="javascript:history.go(-1)"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/back.png"></a>');
137
$xoopsTpl->assign('module_dir', $xoopsModule->getVar('dirname'));
138
require_once XOOPS_ROOT_PATH . '/footer.php';
139