Issues (807)

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/pedigree_trash.php (1 issue)

Labels
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
 * Module: Pedigree
14
 *
15
 * @package         Xoopsmodules\Pedigree
16
 * @copyright       2011-2018 XOOPS Project (https://xoops.org)
17
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
18
 * @author          XOOPS Module Dev Team (https://xoops.org)
19
 */
20
21
use Xmf\Request;
22
use Xmf\Module\Admin;
23
use XoopsModules\Pedigree\{
24
    Helper
25
};
26
/** @var \XoopsThemeForm $form */
27
/** @var \Xmf\Module\Admin $adminObject */
28
        
29
require_once __DIR__ . '/admin_header.php';
30
31
xoops_cp_header();
32
33
$trashHandler = Helper::getInstance()->getHandler('Trash');
34
35
$op = Request::getCmd('op', 'list');
36
switch ($op) {
37
    case 'list':
38
    default:
39
        $adminObject->displayNavigation(basename(__FILE__));
40
        $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_TRASH, 'pedigree_trash.php?op=new_pedigree_trash', 'add');
41
        //$adminObject->displayButton('left');
42
        $criteria = new \CriteriaCompo();
43
        $criteria->setSort('id');
44
        $criteria->setOrder('ASC');
45
        $numRows          = $trashHandler->getCount();
46
        $pedigreeTrashArr = $trashHandler->getAll($criteria);
47
48
        //Table view
49
        if ($numRows > 0) {
50
            echo "<table cellspacing='1' class='outer width100'>
51
                <thead>
52
                <tr>
53
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_PNAME . "</th>
54
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ID_OWNER . "</th>
55
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ID_BREEDER . "</th>
56
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_USER . "</th>
57
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ROFT . "</th>
58
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_MOTHER . "</th>
59
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_FATHER . "</th>
60
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_FOTO . "</th>
61
                    <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_COI . "</th>
62
                    <th class='txtcenter' width='10%'>" . _AM_PEDIGREE_FORMACTION . '</th>
63
                </tr>
64
                </thead>
65
                <tbody>';
66
67
            $class = 'odd';
68
69
            foreach ($pedigreeTrashArr as $tId => $trashObj) {
70
                if (0 == $trashObj->getVar('pedigree_trash_pid')) {
71
                    echo "<tr class='{$class}'>";
72
                    $class = ('even' === $class) ? 'odd' : 'even';
73
                    echo "<td class='txtcenter'>" . $trashObj->getVar('pname') . '</td>';
74
                    echo "<td class='txtcenter'>" . $trashObj->getVar('id_owner') . '</td>';
75
                    echo "<td class='txtcenter'>" . $trashObj->getVar('id_breeder') . '</td>';
76
                    echo "<td class='txtcenter'>" . $trashObj->getVar('user') . '</td>';
77
                    echo "<td class='txtcenter'>" . $trashObj->getVar('roft') . '</td>';
78
                    echo "<td class='txtcenter'>" . $trashObj->getVar('mother') . '</td>';
79
                    echo "<td class='txtcenter'>" . $trashObj->getVar('father') . '</td>';
80
                    echo "<td class='txtcenter'>" . $trashObj->getVar('foto') . '</td>';
81
                    echo "<td class='txtcenter'>" . $trashObj->getVar('coi') . '</td>';
82
                    echo "<td class'txtcenter width10'>
83
                        <a href='pedigree_trash.php?op=edit_pedigree_trash&id=" . $tId . "'><img src='{$pathIcon16}/edit.png' alt='" . _EDIT . "' title='" . _EDIT . "'></a>
84
                        <a href='pedigree_trash.php?op=delete_pedigree_trash&id=" . $tId . "'><img src='{$pathIcon16}/delete.png' alt='" . _DELETE . "' title='" . _DELETE . "'></a>
85
                        </td>";
86
                    echo '</tr>';
87
                }
88
            }
89
            echo '</tbody>
90
                  </table>
91
                  <br><br>';
92
        }
93
94
        break;
95
96
    case 'new_pedigree_trash':
97
        $adminObject->displayNavigation(basename(__FILE__));
98
        $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TRASHLIST, 'pedigree_trash.php?op=list', 'list');
99
        $adminObject->displayButton('left');
100
101
        /** @var Pedigree\Trash $trashObj */
102
        $trashObj = $trashHandler->create();
103
        /** @var \XoopsThemeForm $form */
104
        $form     = $trashObj->getForm();
105
        $form->display();
106
        break;
107
108
    case 'save_pedigree_trash':
109
        if (!$GLOBALS['xoopsSecurity']->check()) {
110
            $helper->redirect('admin/pedigree_trash.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
111
        }
112
        $tId      = Request::getInt('id', null, 'POST');
113
        $trashObj = $trashHandler->get($tId); // gets object or creates one if tId is empty
114
        /*
115
        if (isset($_REQUEST['id'])) {
116
            $obj = $trashHandler->get($_REQUEST['id']);
117
        } else {
118
            $obj = $trashHandler->create();
119
        }
120
        */
121
122
        $trashObj->setVar('pname', Request::getString('pname', '', 'POST')); //Form pname
123
        $trashObj->setVar('id_owner', Request::getInt('id_owner', 0, 'POST')); //Form id_owner
124
        $trashObj->setVar('id_breeder', Request::getInt('id_breeder', 0, 'POST')); //Form id_breeder
125
        $trashObj->setVar('user', Request::getString('user', '', 'POST')); //Form user
126
        $trashObj->setVar('roft', Request::getString('roft', '', 'POST')); //Form roft
127
        $trashObj->setVar('mother', Request::getInt('mother', 0, 'POST')); //Form mother
128
        $trashObj->setVar('father', Request::getInt('father', 0, 'POST')); //Form father
129
        $trashObj->setVar('foto', Request::getString('foto', '', 'POST')); //Form foto
130
        $trashObj->setVar('coi', Request::getString('coi', '', 'POST')); //Form coi
131
132
        if ($trashHandler->insert($trashObj)) {
133
            $helper->redirect('admin/pedigree_trash.php?op=list', 2, _AM_PEDIGREE_FORMOK);
134
        }
135
136
        echo $trashObj->getHtmlErrors();
137
        $form = $trashObj->getForm();
0 ignored issues
show
The method getForm() does not exist on XoopsObject. It seems like you code against a sub-type of XoopsObject such as XoopsModules\Pedigree\Temp or SystemSmilies or XoopsModules\Pedigree\Owner or SystemBanner or SystemBannerclient or XoopsModules\Pedigree\Registry or XoopsModules\Pedigree\Tree or XoopsModules\Pedigree\Trash or XoopsModules\Pedigree\Fields or ProfileCategory or SystemUserrank or SystemGroup or SystemBlock or SystemAvatar or SystemUsers. ( Ignorable by Annotation )

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

137
        /** @scrutinizer ignore-call */ 
138
        $form = $trashObj->getForm();
Loading history...
138
        $form->display();
139
        break;
140
141
    case 'edit_pedigree_trash':
142
        $adminObject->displayNavigation(basename(__FILE__));
143
        $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_TRASH, 'pedigree_trash.php?op=new_pedigree_trash', 'add');
144
        $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TRASHLIST, 'pedigree_trash.php?op=list', 'list');
145
        $adminObject->displayButton('left');
146
        $obj  = $trashHandler->get($_REQUEST['id']);
147
        $form = $obj->getForm();
148
        $form->display();
149
        break;
150
151
    case 'delete_pedigree_trash':
152
        $tId = Request::getInt('id', 0);
153
        if (!$tId) {
154
            $helper->redirect('admin/pedigree_trash.php', 3, _AM_PEDIGREE_ERR_INVALID);
155
        }
156
        $trashObj = $trashHandler->get($tId);
157
        if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
158
            if (!$GLOBALS['xoopsSecurity']->check()) {
159
                $helper->redirect('admin/pedigree_trash.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
160
            }
161
            if ($trashHandler->delete($obj)) {
162
                $helper->redirect('admin/pedigree_trash.php', 3, _AM_PEDIGREE_FORMDELOK);
163
            } else {
164
                echo $obj->getHtmlErrors();
165
            }
166
        } else {
167
            xoops_confirm(['ok' => 1, 'id' => $tId, 'op' => 'delete_pedigree_trash'], $_SERVER['REQUEST_URI'], sprintf(_AM_PEDIGREE_FORMSUREDEL, $obj->getVar('pedigree_trash')));
168
        }
169
        break;
170
}
171
require_once __DIR__ . '/admin_footer.php';
172