Issues (661)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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/myblocksadmin.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
// ------------------------------------------------------------------------- //
3
//                            myblocksadmin.php                              //
4
//                - XOOPS block admin for each modules -                     //
5
//                          GIJOE <http://www.peak.ne.jp/>                   //
6
// ------------------------------------------------------------------------- //
7
8
include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
9
include __DIR__ . '/admin_header.php';
10
//include_once XOOPS_ROOT_PATH."/modules/" . $xoopsModule->getVar("dirname") . "/class/admin.php";
11
12
include_once __DIR__ . '/mygrouppermform.php';
13
include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
14
include_once dirname(__DIR__) . '/include/gtickets.php';// GIJ
15
16
$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system';
17
18
// language files
19
$language = $xoopsConfig['language'];
20
if (!file_exists("{$xoops_system_path}/language/{$language}/admin/blocksadmin.php")) {
21
    $language = 'english';
22
}
23
24
// to prevent from notice that constants already defined
25
$error_reporting_level = error_reporting(0);
26
include_once "{$xoops_system_path}/constants.php";
27
include_once "{$xoops_system_path}/language/{$language}/admin.php";
28
include_once "{$xoops_system_path}/language/{$language}/admin/blocksadmin.php";
29
error_reporting($error_reporting_level);
30
31
$group_defs = file("{$xoops_system_path}/language/{$language}/admin/groups.php");
32
foreach ($group_defs as $def) {
33
    if (false !== strpos($def, '_AM_MYLINKS_ACCESSRIGHTS') || false !== strpos($def, '_AM_MYLINKS_ACTIVERIGHTS')) {
34
        eval($def);
35
    }
36
}
37
38
// check $xoopsModule
39
if (!is_object($xoopsModule)) {
40
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
41
}
42
43
// set target_module if specified by $_GET['dirname']
44
$moduleHandler = xoops_getHandler('module');
45
46
if (!empty($_GET['dirname'])) {
47
    $target_module = $moduleHandler->getByDirname($_GET['dirname']);
48
}/* else if( ! empty( $_GET['mid'] ) ) {
49
  $target_module = $moduleHandler->get( intval( $_GET['mid'] ) );
50
}*/
51
52
if (!empty($target_module) && is_object($target_module)) {
53
    // specified by dirname
54
    $target_mid     = $target_module->getVar('mid');
55
    $target_mname   = $target_module->getVar('name') . '&nbsp;' . sprintf('(%2.2f)', $target_module->getVar('version') / 100.0);
56
    $query4redirect = '?dirname=' . urlencode(strip_tags($_GET['dirname']));
57
} elseif (isset($_GET['mid']) && $_GET['mid'] == 0 || $xoopsModule->getVar('dirname') == 'blocksadmin') {
58
    $target_mid     = 0;
59
    $target_mname   = '';
60
    $query4redirect = '?mid=0';
61
} else {
62
    $target_mid     = $xoopsModule->getVar('mid');
63
    $target_mname   = $xoopsModule->getVar('name');
64
    $query4redirect = '';
65
}
66
67
// check access right (needs system_admin of BLOCK)
68
$syspermHandler = xoops_getHandler('groupperm');
69 View Code Duplication
if (!$syspermHandler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
70
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
71
}
72
73
// get blocks owned by the module (Imported from xoopsblock.php then modified)
74
//$block_arr =& XoopsBlock::getByModule( $target_mid );
75
$db        = XoopsDatabaseFactory::getDatabaseConnection();
76
$sql       = 'SELECT * FROM ' . $db->prefix('newblocks') . " WHERE mid='{$target_mid}' ORDER BY visible DESC,side,weight";
77
$result    = $db->query($sql);
78
$block_arr = array();
79
while ($myrow = $db->fetchArray($result)) {
80
    $block_arr[] = new XoopsBlock($myrow);
81
}
82
83
function list_groups()
84
{
85
    global $target_mid, $target_mname, $block_arr;
86
87
    $item_list = array();
88
    foreach (array_keys($block_arr) as $i) {
89
        $item_list[$block_arr[$i]->getVar('bid')] = $block_arr[$i]->getVar('title');
90
    }
91
92
    $form = new MyXoopsGroupPermForm(_AM_MYLINKS_AGDS, 1, 'block_read', '');
93
    if ($target_mid > 1) {
94
        $form->addAppendix('module_admin', $target_mid, $target_mname . ' ' . _AM_MYLINKS_ACTIVERIGHTS);
95
        $form->addAppendix('module_read', $target_mid, $target_mname . ' ' . _AM_MYLINKS_ACCESSRIGHTS);
96
    }
97
    foreach ($item_list as $item_id => $item_name) {
98
        $form->addItem($item_id, $item_name);
99
    }
100
    echo $form->render();
101
}
102
103
if (!empty($_POST['submit'])) {
104 View Code Duplication
    if (!$xoopsGTicket->check(true, 'myblocksadmin')) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
105
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
106
    }
107
108
    include 'mygroupperm.php';
109
    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/admin/myblocksadmin.php{$query4redirect}", 1, _MD_MYLINKS_DBUPDATED);
110
}
111
112
xoops_cp_header();
113
$indexAdmin = new ModuleAdmin();
114
echo $indexAdmin->addNavigation(basename(__FILE__));
115
116
if (file_exists('./mymenu.php')) {
117
    include './mymenu.php';
118
}
119
120
list_groups();
121
include __DIR__ . '/admin_footer.php';
122