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.

admin/vupload.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * XoopsTube - a multicategory video management module
4
 *
5
 * Based upon WF-Links
6
 *
7
 * File: admin/vupload.php
8
 *
9
 * @copyright        https://xoops.org/ XOOPS Project
10
 * @copyright        XOOPS_copyrights.txt
11
 * @copyright        http://www.impresscms.org/ The ImpressCMS Project
12
 * @license          GNU General Public License (GPL)
13
 *                   a copy of the GNU license is enclosed.
14
 * ----------------------------------------------------------------------------------------------------------
15
 * @package          WF-Links
16
 * @since            1.03
17
 * @author           John N
18
 * ----------------------------------------------------------------------------------------------------------
19
 *                   XoopsTube
20
 * @since            1.00
21
 * @author           McDonald
22
 */
23
24
use Xmf\Module\Admin;
25
use Xmf\Request;
26
use XoopsModules\Xoopstube\{
27
    Lists,
28
    Utility
29
};
30
31
require_once __DIR__ . '/admin_header.php';
32
33
//$op       = (isset($_REQUEST['op']) && !empty($_REQUEST['op'])) ? $_REQUEST['op'] : '';
34
//$rootpath = (isset($_GET['rootpath'])) ? (int) $_GET['rootpath'] : 0;
35
36
$op       = Request::getCmd('op', Request::getCmd('op', '', 'POST'), 'GET');
37
$rootpath = Request::getInt('rootpath', 0, 'GET');
38
39
switch (mb_strtolower($op)) {
40
    case 'vupload':
41
        if ('' !== $_FILES['uploadfile']['name']) {
42
            if (file_exists(XOOPS_ROOT_PATH . '/' . Request::getString('uploadpath', '', 'POST') . '/' . $_FILES['uploadfile']['name'])) {
43
                redirect_header('vupload.php', 2, _AM_XOOPSTUBE_VUPLOAD_VIDEOEXIST);
44
            }
45
            $allowed_mimetypes = 'media/aac, media/flv, media/mp3, media/mp4';
46
            Utility::uploadFiles($_FILES, Request::getString('uploadpath', '', 'POST'), $allowed_mimetypes, 'vupload.php', 1, 0);
47
            redirect_header('vupload.php', 2, _AM_XOOPSTUBE_VUPLOAD_VIDEOUPLOAD);
48
        } else {
49
            redirect_header('vupload.php', 2, _AM_XOOPSTUBE_VUPLOAD_NOVIDEOEXIST);
50
        }
51
        break;
52
    case 'delfile':
53
        if (1 == Request::getInt('confirm', '', 'POST')) { //isset($_POST['confirm']) && $_POST['confirm'] == 1) {
0 ignored issues
show
'' of type string is incompatible with the type integer expected by parameter $default of Xmf\Request::getInt(). ( Ignorable by Annotation )

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

53
        if (1 == Request::getInt('confirm', /** @scrutinizer ignore-type */ '', 'POST')) { //isset($_POST['confirm']) && $_POST['confirm'] == 1) {
Loading history...
54
            $filetodelete = XOOPS_ROOT_PATH . '/' . Request::getString('uploadpath', '', 'POST') . '/' . Request::getString('videofile', '', 'POST');
55
            if (file_exists($filetodelete)) {
56
                chmod($filetodelete, 0666);
57
                if (@unlink($filetodelete)) {
58
                    redirect_header('vupload.php', 1, _AM_XOOPSTUBE_VUPLOAD_FILEDELETED);
59
                } else {
60
                    redirect_header('vupload.php', 1, _AM_XOOPSTUBE_VUPLOAD_FILEERRORDELETE);
61
                }
62
            }
63
        } else {
64
            //            if (empty($_POST['videofile'])) {
65
            if (!Request::hasVar('videofile', 'POST')) {
66
                redirect_header('vupload.php', 1, _AM_XOOPSTUBE_VUPLOAD_NOFILEERROR);
67
            }
68
            xoops_cp_header();
69
            xoops_confirm(
70
                [
71
                    'op'         => 'delfile',
72
                    'uploadpath' => Request::getString('uploadpath', '', 'POST'),
73
                    'videofile'  => Request::getString('videofile', '', 'POST'),
74
                    'confirm'    => 1,
75
                ],
76
                'vupload.php',
77
                _AM_XOOPSTUBE_VUPLOAD_DELETEFILE . '<br><br>' . Request::getString('videofile', '', 'POST'),
78
                _AM_XOOPSTUBE_BDELETE
79
            );
80
        }
81
        break;
82
    case 'default':
83
    default:
84
        $displayimage = '';
85
        xoops_cp_header();
86
        $adminObject = Admin::getInstance();
87
        $adminObject->displayNavigation(basename(__FILE__));
88
89
        $dirarray  = [1 => $GLOBALS['xoopsModuleConfig']['videodir']];
90
        $namearray = [1 => _AM_XOOPSTUBE_VUPLOAD_CATVIDEO];
91
        $listarray = [1 => _AM_XOOPSTUBE_VUPLOAD_FCATVIDEO];
92
93
        //renderAdminMenu( _AM_XOOPSTUBE_VUPLOADS );
94
95
        if ($rootpath > 0) {
96
            echo '<div><b>&nbsp;' . _AM_XOOPSTUBE_VUPLOAD_FUPLOADPATH . '</b> ' . XOOPS_ROOT_PATH . '/' . $dirarray[$rootpath] . '</div>';
97
            echo '<div><b>&nbsp;' . _AM_XOOPSTUBE_VUPLOAD_FUPLOADURL . '</b> ' . XOOPS_URL . '/' . $dirarray[$rootpath] . '</div><br>';
98
        }
99
        $pathlist = isset($listarray[$rootpath]) ? $namearray[$rootpath] : '';
100
        $namelist = isset($listarray[$rootpath]) ? $namearray[$rootpath] : '';
101
102
        $iform = new \XoopsThemeForm(_AM_XOOPSTUBE_VUPLOAD_FUPLOADVIDEOTO . $pathlist, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
103
        $iform->setExtra('enctype="multipart/form-data"');
104
        ob_start();
105
        $iform->addElement(new \XoopsFormHidden('dir', $rootpath));
106
        Utility::getDirSelectOption($namelist, $dirarray, $namearray);
107
        $iform->addElement(new \XoopsFormLabel(_AM_XOOPSTUBE_VUPLOAD_FOLDERSELECTION, ob_get_clean()));
108
109
    if ($rootpath > 0) {
110
            $file_array       = Lists:: getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $dirarray[$rootpath], $type = 'media');
111
            $indexfile_select = new \XoopsFormSelect('', 'videofile', '');
112
            $indexfile_select->addOptionArray($file_array);
113
            $indexfile_select->setExtra("onchange='showImgSelected(\"media\", \"videofile\", \"" . $dirarray[$rootpath] . '", "", "' . XOOPS_URL . "\")'");
114
            $indexfile_tray = new \XoopsFormElementTray(_AM_XOOPSTUBE_VUPLOAD_FSHOWSELECTEDFILE, '&nbsp;');
115
            $indexfile_tray->addElement($indexfile_select);
116
            if (!empty($imgurl)) {
117
                $indexfile_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/' . $dirarray[$rootpath] . '/' . $videofile . '" name="image" id="image" alt="">'));
118
            } else {
119
                $indexfile_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/uploads/blank.gif" name="image" id="image" alt="">'));
120
            }
121
            $iform->addElement($indexfile_tray);
122
123
            $file_tray = new \XoopsFormFile(_AM_XOOPSTUBE_VUPLOAD_FUPLOADVIDEO, 'uploadfile', 0);
124
            $file_tray->setDescription('<span style="font-size: small;">' . _AM_XOOPSTUBE_VUPLOAD_FSHOWSELECTEDFILEDSC . '</span>');
125
            $iform->addElement($file_tray);
126
            $iform->addElement(new \XoopsFormHidden('uploadpath', $dirarray[$rootpath]));
127
            $iform->addElement(new \XoopsFormHidden('rootnumber', $rootpath));
128
129
            $dup_tray = new \XoopsFormElementTray('', '');
130
            $dup_tray->addElement(new \XoopsFormHidden('op', 'vupload'));
131
            $butt_dup = new \XoopsFormButton('', '', _AM_XOOPSTUBE_BUPLOAD, 'submit');
132
            $butt_dup->setExtra('onclick="this.form.elements.op.value=\'vupload\'"');
133
            $dup_tray->addElement($butt_dup);
134
135
            $butt_dupct = new \XoopsFormButton('', '', _AM_XOOPSTUBE_BDELETEVIDEO, 'submit');
136
            $butt_dupct->setExtra('onclick="this.form.elements.op.value=\'delfile\'"');
137
            $dup_tray->addElement($butt_dupct);
138
            $iform->addElement($dup_tray);
139
        }
140
        $iform->display();
141
}
142
require_once __DIR__ . '/admin_footer.php';
143