Issues (53)

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)

1
<?php declare(strict_types=1);
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    XOOPS Project (https://xoops.org)
14
 * @license      GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
15
 * @author       XOOPS Development Team
16
 */
17
18
use XoopsModules\Xoopsheadline\{
19
    Common\Configurator,
20
    Helper,
21
    Utility
22
};
23
24
/** @var Helper $helper */
25
/** @var Utility $utility */
26
/** @var Configurator $configurator */
27
28
//require_once __DIR__ . '/setup.php';
29
30
/**
31
 * Prepares system prior to attempting to install module
32
 * @param \XoopsModule $module {@link XoopsModule}
33
 *
34
 * @return bool true if ready to install, false if not
35
 */
36
function xoops_module_pre_install_xoopsheadline(\XoopsModule $module): bool
37
{
38
    require_once \dirname(__DIR__) . '/preloads/autoloader.php';
39
40
    $utility      = new Utility();
41
    $xoopsSuccess = $utility::checkVerXoops($module);
42
    $phpSuccess   = $utility::checkVerPhp($module);
43
44
    if ($xoopsSuccess && $phpSuccess) {
45
        $moduleTables = &$module->getInfo('tables');
46
        foreach ($moduleTables as $table) {
47
            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
48
        }
49
    }
50
51
    return $xoopsSuccess && $phpSuccess;
52
}
53
54
/**
55
 * Performs tasks required during installation of the module
56
 * @param \XoopsModule $module {@link XoopsModule}
57
 *
58
 * @return bool true if installation successful, false if not
59
 */
60
function xoops_module_install_xoopsheadline(\XoopsModule $module): bool
0 ignored issues
show
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

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

60
function xoops_module_install_xoopsheadline(/** @scrutinizer ignore-unused */ \XoopsModule $module): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
{
62
    require_once \dirname(__DIR__, 3) . '/mainfile.php';
63
64
    $moduleDirName = \basename(\dirname(__DIR__));
65
    $helper        = Helper::getInstance();
66
    $utility       = new Utility();
67
68
    $configurator = new Configurator();
69
    // Load language files
70
    $helper->loadLanguage('admin');
71
    $helper->loadLanguage('modinfo');
72
73
    // default Permission Settings ----------------------
74
    global $xoopsModule;
75
    $moduleId = $xoopsModule->getVar('mid');
76
    // $moduleId2        = $helper->getModule()->mid();
77
    /** @var \XoopsGroupPermHandler $grouppermHandler */
78
    $grouppermHandler = xoops_getHandler('groupperm');
79
    // access rights ------------------------------------------
80
    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
0 ignored issues
show
XOOPS_GROUP_ADMIN of type string is incompatible with the type integer expected by parameter $gperm_groupid of XoopsGroupPermHandler::addRight(). ( Ignorable by Annotation )

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

80
    $grouppermHandler->addRight($moduleDirName . '_approve', 1, /** @scrutinizer ignore-type */ XOOPS_GROUP_ADMIN, $moduleId);
Loading history...
81
    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
82
    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
83
    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
84
    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
85
86
    //  ---  CREATE FOLDERS ---------------
87
    if (count($configurator->uploadFolders) > 0) {
88
        //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
89
        foreach (array_keys($configurator->uploadFolders) as $i) {
90
            $utility::createFolder($configurator->uploadFolders[$i]);
91
        }
92
    }
93
94
    //  ---  COPY blank.png FILES ---------------
95
    if (count($configurator->copyBlankFiles) > 0) {
96
        $file = \dirname(__DIR__) . '/assets/images/blank.png';
97
        foreach (array_keys($configurator->copyBlankFiles) as $i) {
98
            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
99
            $utility::copyFile($file, $dest);
100
        }
101
    }
102
    //delete .html entries from the tpl table
103
    $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
104
    $GLOBALS['xoopsDB']->queryF($sql);
105
106
    return true;
107
}
108