Issues (58)

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/action.module.php (6 issues)

Severity
1
<?php
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
 * XOOPS XoopsPartners module
14
 *
15
 * @package      module\Xoopspartners\include
16
 * @author       Taiwen Jiang <[email protected]>
17
 * @author       zyspec <[email protected]>
18
 * @author       XOOPS Module Development Team
19
 * @copyright    {@link https://xoops.org 2001-2016 XOOPS Project}
20
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
21
 * @link         https://xoops.org XOOPS
22
 */
23
24
use XoopsModules\Xoopspartners;
25
use XoopsModules\Xoopspartners\Helper;
26
use XoopsModules\Xoopspartners\Utility;
27
28
/**
29
 * @internal {Make sure you PROTECT THIS FILE}
30
 */
31
if ((!defined('XOOPS_ROOT_PATH'))
32
    || !isset($GLOBALS['xoopsUser'])
33
    || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)
34
    || !$GLOBALS['xoopsUser']->isAdmin()) {
35
    exit('Restricted access' . PHP_EOL);
36
}
37
38
/**
39
 * Prepares system prior to attempting to install module
40
 * @param \XoopsModule $module {@link XoopsModule}
41
 *
42
 * @return bool true if ready to install, false if not
43
 */
44
function xoops_module_pre_install_xoopspartners(\XoopsModule $module)
45
{
46
    //check for minimum XOOPS version
47
    if (!Utility::checkVerXoops($module)) {
48
        return false;
49
    }
50
    // check for minimum PHP version
51
    if (!Utility::checkVerPhp($module)) {
52
        return false;
53
    }
54
55
    return true;
56
}
57
58
/**
59
 * Performs tasks required during installation of the module
60
 * @param \XoopsModule $module {@link XoopsModule}
61
 *
62
 * @return bool true if installation successful, false if not
63
 */
64
function xoops_module_install_xoopspartners(\XoopsModule $module)
65
{
66
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');
67
68
    //Create the "uploads" directory for the module
69
    $module_uploads = $GLOBALS['xoops']->path('/uploads/' . $module->dirname());
70
    if (!is_dir($module_uploads)) {
71
        if (!mkdir($module_uploads, 0777) && !is_dir($module_uploads)) {
72
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
73
        }
74
    }
75
    chmod($module_uploads, 0777);
76
    //now copy the index file to help prevent 'browsing' the directory
77
    copy($indexFile, $GLOBALS['xoops']->path('/uploads/' . $module->dirname() . '/index.html'));
78
79
    return true;
80
}
81
82
/**
83
 * Prepares system prior to attempting to update module
84
 * @param \XoopsModule $module {@link XoopsModule}
85
 *
86
 * @return bool true if successfully ready to update module, false if not
87
 */
88
function xoops_module_pre_update_xoopspartners(\XoopsModule $module)
89
{
90
    /** @var Helper $helper */
91
    /** @var Utility $utility */
92
    $moduleDirName = basename(dirname(__DIR__));
0 ignored issues
show
The assignment to $moduleDirName is dead and can be removed.
Loading history...
93
    $helper        = Helper::getInstance();
0 ignored issues
show
The assignment to $helper is dead and can be removed.
Loading history...
94
    $utility       = new Utility();
95
96
    $xoopsSuccess = $utility::checkVerXoops($module);
97
    $phpSuccess   = $utility::checkVerPhp($module);
98
99
    return $xoopsSuccess && $phpSuccess;
100
}
101
102
/**
103
 * Functions to upgrade from previous version of the module
104
 *
105
 * @param \XoopsModule $module       {@link XoopsModule}
106
 * @param int          $curr_version version number of module currently installed
107
 *
108
 * @return bool true if successfully updated module, false if not
109
 */
110
function xoops_module_update_xoopspartners(\XoopsModule $module, $curr_version = null)
0 ignored issues
show
The parameter $curr_version 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

110
function xoops_module_update_xoopspartners(\XoopsModule $module, /** @scrutinizer ignore-unused */ $curr_version = null)

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...
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

110
function xoops_module_update_xoopspartners(/** @scrutinizer ignore-unused */ \XoopsModule $module, $curr_version = null)

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...
111
{
112
    return true;
113
}
114
115
/**
116
 * Function to perform before module uninstall
117
 * @param \XoopsModule $module {@link XoopsModule}
118
 *
119
 * @return bool true if successfully executed, false if not
120
 */
121
function xoops_module_pre_uninstall_xoopspartners(\XoopsModule $module)
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

121
function xoops_module_pre_uninstall_xoopspartners(/** @scrutinizer ignore-unused */ \XoopsModule $module)

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...
122
{
123
    return true;
124
}
125
126
/**
127
 * Function to complete upon module uninstall
128
 * @param \XoopsModule $module {@link XoopsModule}
129
 *
130
 * @return bool true if successfully executed uninstall of module, false if not
131
 */
132
function xoops_module_uninstall_xoopspartners(\XoopsModule $module)
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

132
function xoops_module_uninstall_xoopspartners(/** @scrutinizer ignore-unused */ \XoopsModule $module)

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...
133
{
134
    return true;
135
}
136