Issues (132)

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.

admin/sec.php (2 issues)

Labels
Severity
1
<?php
2
### =============================================================
3
### Mastop InfoDigital - Paixão por Internet
4
### =============================================================
5
### Arquivo para Manipulação de Seções
6
### =============================================================
7
### Developer: Fernando Santos (topet05), [email protected]
8
### Copyright: Mastop InfoDigital © 2003-2007
9
### -------------------------------------------------------------
10
### www.mastop.com.br
11
### =============================================================
12
###
13
### =============================================================
14
use Xmf\Request;
15
16
require_once __DIR__ . '/admin_header.php';
17
xoops_cp_header();
18
19
/** @var \XoopsModules\Mastopgo2\Helper $helper */
20
$helper = \XoopsModules\Mastopgo2\Helper::getInstance();
21
22
$op = Request::getString('op', 'listar', 'GET');
23
if (isset($_GET)) {
24
    foreach ($_GET as $k => $v) {
25
        ${$k} = $v;
26
    }
27
}
28
29
if (isset($_POST)) {
30
    foreach ($_POST as $k => $v) {
31
        ${$k} = $v;
32
    }
33
}
34
35
switch ($op) {
36
    case 'section_editar':
37
        //      mgo_adm_menu();
38
        $sec_10_id  = !empty($sec_10_id) ? $sec_10_id : 0;
39
//        $sec_classe = mgo_getClass(MGO_MOD_TABELA0, $sec_10_id);
40
        $sec_classe =  new \XoopsModules\Mastopgo2\Section($sec_10_id);
0 ignored issues
show
It seems like $sec_10_id can also be of type integer; however, parameter $id of XoopsModules\Mastopgo2\Section::__construct() does only seem to accept null, maybe add an additional type check? ( Ignorable by Annotation )

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

40
        $sec_classe =  new \XoopsModules\Mastopgo2\Section(/** @scrutinizer ignore-type */ $sec_10_id);
Loading history...
41
        if (empty($sec_10_id) || '' === $sec_classe->getVar('sec_10_id')) {
42
            redirect_header(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=listar', 3, MGO_ADM_404);
43
        }
44
        $form['titulo'] = MGO_ADM_SEC_EDIT;
45
        $form['op']     = 'salvar';
46
        require_once XOOPS_ROOT_PATH . '/modules/' . MGO_MOD_DIR . '/include/sec.form.inc.php';
47
        $sec_form->display();
48
        break;
49
    case 'section_deletar':
50
        //      mgo_adm_menu();
51
        $sec_10_id  = !empty($sec_10_id) ? $sec_10_id : 0;
52
//        $sec_classe = mgo_getClass(MGO_MOD_TABELA0, $sec_10_id);
53
        $sec_classe =  new \XoopsModules\Mastopgo2\Section($sec_10_id);
54
        if (empty($sec_10_id) || '' === $sec_classe->getVar('sec_10_id')) {
55
            redirect_header(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=listar', 3, MGO_ADM_404);
56
        }
57
        xoops_confirm(['op' => 'section_deletar_ok', 'sec_10_id' => $sec_10_id], 'sec.php', sprintf(MGO_ADM_SEC_CONFIRMA_DEL, $sec_10_id, $sec_classe->getVar('sec_30_nome')));
0 ignored issues
show
It seems like $sec_classe->getVar('sec_30_nome') can also be of type array and array; however, parameter $args of sprintf() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

57
        xoops_confirm(['op' => 'section_deletar_ok', 'sec_10_id' => $sec_10_id], 'sec.php', sprintf(MGO_ADM_SEC_CONFIRMA_DEL, $sec_10_id, /** @scrutinizer ignore-type */ $sec_classe->getVar('sec_30_nome')));
Loading history...
58
        break;
59
    case 'section_deletar_ok':
60
        $sec_10_id  = !empty($sec_10_id) ? $sec_10_id : 0;
61
//        $sec_classe = mgo_getClass(MGO_MOD_TABELA0, $sec_10_id);
62
        $sec_classe =  new \XoopsModules\Mastopgo2\Section($sec_10_id);
63
//        $go2_classe = mgo_getClass(MGO_MOD_TABELA1);
64
        $go2_classe =  new \XoopsModules\Mastopgo2\Go2();
65
        if (empty($sec_10_id) || '' === $sec_classe->getVar('sec_10_id')) {
66
            redirect_header(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?listar', 3, MGO_ADM_404);
67
        }
68
        $go2_classe->deletaTodos(new \Criteria('sec_10_id', $sec_10_id));
69
        $sec_classe->delete();
70
        redirect_header(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=listar', 3, MGO_ADM_SUCESS_DEL);
71
        break;
72
    case 'novo':
73
        //mgo_adm_menu();
74
//        $sec_classe     = mgo_getClass(MGO_MOD_TABELA0);
75
        $sec_classe =  new \XoopsModules\Mastopgo2\Section();
76
        $form['titulo'] = MGO_ADM_SEC_NEW;
77
        $form['op']     = 'salvar';
78
        require_once XOOPS_ROOT_PATH . '/modules/' . MGO_MOD_DIR . '/include/sec.form.inc.php';
79
        $sec_form->display();
80
        break;
81
    case 'salvar':
82
        if (empty($sec_10_id)) {
83
//            $sec_classe = mgo_getClass(MGO_MOD_TABELA0);
84
            $sec_classe =  new \XoopsModules\Mastopgo2\Section();
85
        } else {
86
//            $sec_classe = mgo_getClass(MGO_MOD_TABELA0, $sec_10_id);
87
            $sec_classe =  new \XoopsModules\Mastopgo2\Section($sec_10_id);
88
        }
89
        $sec_classe->setVar('sec_30_nome', $sec_30_nome);
90
        if (0 !== $sec_classe->getVar('sec_10_id')) {
91
            $msg = 'UPD';
92
        } else {
93
            $msg = 'ADD';
94
        }
95
        $erro = '';
96
        if (!$sec_classe->store()) {
97
            ob_start();
98
            xoops_error(MGO_ADM_DB_ERRO);
99
            $erro .= ob_get_clean();
100
        } else {
101
            redirect_header(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=listar', 3, constant('MGO_ADM_SUCESS_' . $msg));
102
        }
103
104
    // no break
105
    case 'listar':
106
    default:
107
        $adminObject->displayNavigation(basename(__FILE__));
108
109
        echo !empty($erro) ? $erro . '<br>' : '';
110
//        $sec_classe = mgo_getClass(MGO_MOD_TABELA0);
111
//        $sec_classe = $helper->getHandler('Section');
112
        $sec_classe =  new \XoopsModules\Mastopgo2\Section();
113
        $sec_10_id  = empty($sec_10_id) ? null : $sec_10_id;
114
        // Opções
115
        $c['op']     = 'listar';
116
        $c['form']   = 0; // 0 para exibir os registros em modo visualização, 1 em modo edição
117
        $c['checks'] = 0;
118
        $c['print']  = 0;
119
120
        $c['nome'][1]    = 'sec_10_id';
121
        $c['rotulo'][1]  = MGO_ADM_ID;
122
        $c['tipo'][1]    = 'text';
123
        $c['tamanho'][1] = 5;
124
        $c['show'][1]    = '$reg->getVar($reg->id)';
125
126
        $c['nome'][2]   = 'sec_30_nome';
127
        $c['rotulo'][2] = MGO_ADM_NOME;
128
        $c['tipo'][2]   = 'text';
129
130
        $c['nome'][3]   = 'destaques';
131
        $c['rotulo'][3] = MGO_ADM_GO2;
132
        $c['tipo'][3]   = 'none';
133
        $c['show'][3]   = '($reg->contaDestaques() > 0) ? $reg->contaDestaques()." <a href=\''
134
                          . XOOPS_URL
135
                          . '/modules/'
136
                          . MGO_MOD_DIR
137
                          . '/admin/go2.php?op=listar_dstac&sec_10_id=".$reg->getVar($reg->id)."'
138
                          . '\' title=\''
139
                          . MGO_ADM_GO2
140
                          . '\'><img src='
141
                          . $pathIcon16
142
                          . '/search.png align=\'absmiddle\' alt=\''
143
                          . MGO_ADM_GO2
144
                          . '\'></a>": 0;';
145
        $c['nosort'][3] = 1;
146
147
        $c['botoes'][1]['link']   = XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=section_editar';
148
        $c['botoes'][1]['imagem'] = $pathIcon16 . '/edit.png';
149
        $c['botoes'][1]['texto']  = _EDIT;
150
151
        $c['botoes'][2]['link']   = XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php?op=section_deletar';
152
        $c['botoes'][2]['imagem'] = $pathIcon16 . '/delete.png';
153
        $c['botoes'][2]['texto']  = _DELETE;
154
155
        // Tradução
156
        $c['lang']['titulo'] = MGO_ADM_SEC_TITULO;
157
        echo $sec_classe->administracao(XOOPS_URL . '/modules/' . MGO_MOD_DIR . '/admin/sec.php', $c);
158
159
        $sec_classe =  new \XoopsModules\Mastopgo2\Section($sec_10_id);
160
161
//        $sec_classe     = mgo_getClass(MGO_MOD_TABELA0, $sec_10_id);
162
        $form['titulo'] = (empty($sec_10_id) ? MGO_ADM_SEC_NEW : MGO_ADM_SEC_EDIT);
163
        $form['op']     = 'salvar';
164
165
        require_once XOOPS_ROOT_PATH . '/modules/' . MGO_MOD_DIR . '/include/sec.form.inc.php';
166
        $sec_form->display();
167
        break;
168
}
169
require_once __DIR__ . '/admin_footer.php';
170