Issues (167)

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/oninstall.php (2 issues)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * TDMDownload
7
 *
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright   Gregory Mage (Aka Mage)
16
 * @license     GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 * @author      Gregory Mage (Aka Mage)
18
 */
19
20
use XoopsModules\Tdmdownloads\Helper;
21
22
/**
23
 * Prepares system prior to attempting to install module
24
 * @param \XoopsModule $module {@link XoopsModule}
25
 *
26
 * @return bool true if ready to install, false if not
27
 */
28
function xoops_module_pre_install_tdmdownloads(\XoopsModule $module)
29
{
30
    require_once dirname(__DIR__, 3) . '/mainfile.php';
31
    //    require_once __DIR__ . '/common.php';
32
    $utility       = new \XoopsModules\Tdmdownloads\Utility();
33
    $xoopsSuccess0 = $utility::checkVerXoops($module);
0 ignored issues
show
The assignment to $xoopsSuccess0 is dead and can be removed.
Loading history...
34
    $xoopsSuccess  = $utility::checkVerXoops($module);
35
    $phpSuccess0   = $utility::checkVerPhp($module);
0 ignored issues
show
The assignment to $phpSuccess0 is dead and can be removed.
Loading history...
36
    $phpSuccess    = $utility::checkVerPhp($module);
37
    if ($xoopsSuccess && $phpSuccess) {
38
        $mod_tables = &$module->getInfo('tables');
39
        foreach ($mod_tables as $table) {
40
            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
41
        }
42
    }
43
    return $xoopsSuccess && $phpSuccess;
44
}
45
46
/**
47
 * @return bool
48
 */
49
function xoops_module_install_tdmdownloads()
50
{
51
    global $xoopsModule, $xoopsConfig, $xoopsDB;
52
    $moduleDirName = basename(dirname(__DIR__));
53
    $namemodule    = $moduleDirName;
54
    if (is_file(XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/language/' . $xoopsConfig['language'] . '/admin.php')) {
55
        require_once XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/language/' . $xoopsConfig['language'] . '/admin.php';
56
    } else {
57
        require_once XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/language/english/admin.php';
58
    }
59
    $fieldHandler = Helper::getInstance()->getHandler('Field');
60
    $obj          = $fieldHandler->create();
61
    $obj->setVar('title', _AM_TDMDOWNLOADS_FORMHOMEPAGE);
62
    $obj->setVar('img', 'homepage.png');
63
    $obj->setVar('weight', 1);
64
    $obj->setVar('search', 0);
65
    $obj->setVar('status', 1);
66
    $obj->setVar('status_def', 1);
67
    $fieldHandler->insert($obj);
68
    $obj = $fieldHandler->create();
69
    $obj->setVar('title', _AM_TDMDOWNLOADS_FORMVERSION);
70
    $obj->setVar('img', 'version.png');
71
    $obj->setVar('weight', 2);
72
    $obj->setVar('search', 0);
73
    $obj->setVar('status', 1);
74
    $obj->setVar('status_def', 1);
75
    $fieldHandler->insert($obj);
76
    $obj = $fieldHandler->create();
77
    $obj->setVar('title', _AM_TDMDOWNLOADS_FORMSIZE);
78
    $obj->setVar('img', 'size.png');
79
    $obj->setVar('weight', 3);
80
    $obj->setVar('search', 0);
81
    $obj->setVar('status', 1);
82
    $obj->setVar('status_def', 1);
83
    $fieldHandler->insert($obj);
84
    $obj = $fieldHandler->create();
85
    $obj->setVar('title', _AM_TDMDOWNLOADS_FORMPLATFORM);
86
    $obj->setVar('img', 'platform.png');
87
    $obj->setVar('weight', 4);
88
    $obj->setVar('search', 0);
89
    $obj->setVar('status', 1);
90
    $obj->setVar('status_def', 1);
91
    $fieldHandler->insert($obj);
92
    //File creation ".$namemodule."/
93
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '';
94
    if (!is_dir($dir)) {
95
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
96
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
97
        }
98
    }
99
    chmod($dir, 0777);
100
    //File creation ".$namemodule."/images/
101
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images';
102
    if (!is_dir($dir)) {
103
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
104
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
105
        }
106
    }
107
    chmod($dir, 0777);
108
    //File creation ".$namemodule."/images/cat
109
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/cats';
110
    if (!is_dir($dir)) {
111
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
112
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
113
        }
114
    }
115
    chmod($dir, 0777);
116
    //File creation ".$namemodule."/images/shots
117
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/shots';
118
    if (!is_dir($dir)) {
119
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
120
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
121
        }
122
    }
123
    chmod($dir, 0777);
124
    //File creation ".$namemodule."/images/field
125
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field';
126
    if (!is_dir($dir)) {
127
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
128
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
129
        }
130
    }
131
    chmod($dir, 0777);
132
    //File creation ".$namemodule."/downloads
133
    $dir = XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/downloads';
134
    if (!is_dir($dir)) {
135
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
136
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
137
        }
138
    }
139
    chmod($dir, 0777);
140
    //Copy index.html
141
    $indexFile = XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/include/index.php';
142
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/index.php');
143
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/index.php');
144
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/cats/index.php');
145
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/shots/index.php');
146
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/index.php');
147
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/downloads/index.php');
148
    //Copy blank.gif
149
    $blankFile = XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/assets/images/blank.gif';
150
    copy($blankFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/cats/blank.gif');
151
    copy($blankFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/shots/blank.gif');
152
    copy($blankFile, XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/blank.gif');
153
    //Copy images for fields
154
    copy(XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/assets/images/icons/16/homepage.png', XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/homepage.png');
155
    copy(XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/assets/images/icons/16/version.png', XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/version.png');
156
    copy(XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/assets/images/icons/16/size.png', XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/size.png');
157
    copy(XOOPS_ROOT_PATH . '/modules/' . $namemodule . '/assets/images/icons/16/platform.png', XOOPS_ROOT_PATH . '/uploads/' . $namemodule . '/images/field/platform.png');
158
    return true;
159
}
160