Issues (992)

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/install_function.php (3 issues)

1
<?php
2
3
/**
4
 * ExtGallery functions
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
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 *
13
 * @copyright   {@link https://xoops.org/ XOOPS Project}
14
 * @license     GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
15
 * @author      Zoullou (http://www.zoullou.net)
16
 * @package     ExtGallery
17
 * @param $module
18
 * @return bool
19
 */
20
function xoops_module_pre_install_extgallery(\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

20
function xoops_module_pre_install_extgallery(/** @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...
21
{
22
    // Check if this XOOPS version is supported
23
    $minSupportedVersion = explode('.', '2.5.0');
24
    $currentVersion      = explode('.', mb_substr(XOOPS_VERSION, 6));
25
26
    if ($currentVersion[0] > $minSupportedVersion[0]) {
27
        return true;
28
    } elseif ($currentVersion[0] == $minSupportedVersion[0]) {
29
        if ($currentVersion[1] > $minSupportedVersion[1]) {
30
            return true;
31
        } elseif ($currentVersion[1] == $minSupportedVersion[1]) {
32
            if ($currentVersion[2] > $minSupportedVersion[2]) {
33
                return true;
34
            } elseif ($currentVersion[2] == $minSupportedVersion[2]) {
35
                return true;
36
            }
37
        }
38
    }
39
40
    return false;
41
}
42
43
/**
44
 * @param \XoopsModule $module
45
 *
46
 * @return bool
47
 */
48
function xoops_module_install_extgallery(\XoopsModule $module)
49
{
50
    $module_id = $module->getVar('mid');
51
    /** @var \XoopsGroupPermHandler $grouppermHandler */
52
    $grouppermHandler = xoops_getHandler('groupperm');
53
    /** @var \XoopsModuleHandler $moduleHandler */
54
    /** @var \XoopsConfigHandler $configHandler */
55
    $configHandler = xoops_getHandler('config');
0 ignored issues
show
The assignment to $configHandler is dead and can be removed.
Loading history...
56
57
    /**
58
     * Default public category permission mask
59
     */
60
61
    // Access right
62
    $grouppermHandler->addRight('extgallery_public_mask', 1, XOOPS_GROUP_ADMIN, $module_id);
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

62
    $grouppermHandler->addRight('extgallery_public_mask', 1, /** @scrutinizer ignore-type */ XOOPS_GROUP_ADMIN, $module_id);
Loading history...
63
    $grouppermHandler->addRight('extgallery_public_mask', 1, XOOPS_GROUP_USERS, $module_id);
64
    $grouppermHandler->addRight('extgallery_public_mask', 1, XOOPS_GROUP_ANONYMOUS, $module_id);
65
66
    // Public rate
67
    $grouppermHandler->addRight('extgallery_public_mask', 2, XOOPS_GROUP_ADMIN, $module_id);
68
    $grouppermHandler->addRight('extgallery_public_mask', 2, XOOPS_GROUP_USERS, $module_id);
69
70
    // Public eCard
71
    $grouppermHandler->addRight('extgallery_public_mask', 4, XOOPS_GROUP_ADMIN, $module_id);
72
    $grouppermHandler->addRight('extgallery_public_mask', 4, XOOPS_GROUP_USERS, $module_id);
73
74
    // Public download
75
    $grouppermHandler->addRight('extgallery_public_mask', 8, XOOPS_GROUP_ADMIN, $module_id);
76
    $grouppermHandler->addRight('extgallery_public_mask', 8, XOOPS_GROUP_USERS, $module_id);
77
78
    // Public upload
79
    $grouppermHandler->addRight('extgallery_public_mask', 16, XOOPS_GROUP_ADMIN, $module_id);
80
81
    // Public autoapprove
82
    $grouppermHandler->addRight('extgallery_public_mask', 32, XOOPS_GROUP_ADMIN, $module_id);
83
84
    // Public display
85
    $grouppermHandler->addRight('extgallery_public_mask', 128, XOOPS_GROUP_ADMIN, $module_id);
86
    $grouppermHandler->addRight('extgallery_public_mask', 128, XOOPS_GROUP_USERS, $module_id);
87
    $grouppermHandler->addRight('extgallery_public_mask', 128, XOOPS_GROUP_ANONYMOUS, $module_id);
88
89
    /**
90
     * Default User's category permission
91
     */
92
93
    // Private gallery
94
95
    // Private rate
96
    $grouppermHandler->addRight('extgallery_private', 2, XOOPS_GROUP_ADMIN, $module_id);
97
    $grouppermHandler->addRight('extgallery_private', 2, XOOPS_GROUP_USERS, $module_id);
98
99
    // Private eCard
100
    $grouppermHandler->addRight('extgallery_private', 4, XOOPS_GROUP_ADMIN, $module_id);
101
    $grouppermHandler->addRight('extgallery_private', 4, XOOPS_GROUP_USERS, $module_id);
102
103
    // Private download
104
    $grouppermHandler->addRight('extgallery_private', 8, XOOPS_GROUP_ADMIN, $module_id);
105
    $grouppermHandler->addRight('extgallery_private', 8, XOOPS_GROUP_USERS, $module_id);
106
107
    // Private autoapprove
108
    $grouppermHandler->addRight('extgallery_private', 16, XOOPS_GROUP_ADMIN, $module_id);
109
110
    // Create eXtGallery main upload directory
111
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery';
112
    if (!is_dir($dir)) {
113
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
114
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
115
        }
116
    }
117
    chmod($dir, 0777);
118
    // Create directory for photo in public album
119
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo';
120
    if (!is_dir($dir)) {
121
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
122
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
123
        }
124
    }
125
    chmod($dir, 0777);
126
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/original';
127
    if (!is_dir($dir)) {
128
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
129
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
130
        }
131
    }
132
    chmod($dir, 0777);
133
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/large';
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
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/medium';
141
    if (!is_dir($dir)) {
142
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
143
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
144
        }
145
    }
146
    chmod($dir, 0777);
147
    $dir = XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/thumb';
148
    if (!is_dir($dir)) {
149
        if (!mkdir($dir, 0777) && !is_dir($dir)) {
150
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
151
        }
152
    }
153
    chmod($dir, 0777);
154
    // Create directory for photo in user's album
155
    //mkdir(XOOPS_ROOT_PATH."/uploads/extgallery/user-photo");
156
157
    // Copy index.html files on uploads folders
158
    $indexFile = XOOPS_ROOT_PATH . '/modules/extgallery/include/index.html';
159
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/index.html');
160
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/index.html');
161
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/original/index.html');
162
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/large/index.html');
163
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/medium/index.html');
164
    copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extgallery/public-photo/thumb/index.html');
165
166
    return true;
167
}
168