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.

pedigree.php (1 issue)

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
 * animal module for xoops
14
 *
15
 * @package         XoopsModules\Pedigree
16
 * @copyright       {@link http://sourceforge.net/projects/thmod/ The TXMod XOOPS Project}
17
 * @copyright       {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
18
 * @license         https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
19
 * @author          XOOPS Module Development Team
20
 */
21
22
use Xmf\Request;
23
use XoopsModules\Pedigree;
24
25
require_once \dirname(__DIR__, 2) . '/mainfile.php';
26
require_once __DIR__ . '/header.php';
27
//xoops_cp_header();
28
$helper->loadLanguage('main');
29
30
//require_once __DIR__ . '/header.php';
31
32
// Include any common code for this module.
33
require_once $helper->path('include/common.php');
34
//require_once XOOPS_ROOT_PATH ."/modules/" . $xoopsModule->dirname() . "/include/css.php";
35
36
// This page uses smarty templates. Set "$xoopsOption['template_main']" before including header
37
$GLOBALS['xoopsOption']['template_main'] = 'pedigree_pedigree.tpl';
38
include $GLOBALS['xoops']->path('/header.php');
39
40
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
41
$GLOBALS['xoTheme']->addScript("browse.php?modules/{$moduleDirName}/assets/js/jquery.magnific-popup.min.js");
42
$GLOBALS['xoTheme']->addStylesheet("browse.php?modules/{$moduleDirName}/assets/css/style.css");
43
$GLOBALS['xoTheme']->addStylesheet("browse.php?modules/{$moduleDirName}/assets/css/magnific-popup.css");
44
45
require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
46
47
//
48
// Displays the "Main" tab of the module
49
//
50
$id = Request::getInt('pedid', 1, 'GET');
51
//$animal = new Pedigree\Animal($id);
52
//test to find out how many user fields there are.
53
//$fields      = $animal->getNumOfFields();
54
//$fieldsCount = count($fields);
55
56
$qarray = ['d', 'f', 'm', 'ff', 'mf', 'fm', 'mm', 'fff', 'ffm', 'fmf', 'fmm', 'mmf', 'mff', 'mfm', 'mmm'];
57
58
$querystring = 'SELECT ';
59
60
foreach ($qarray as $key) {
61
    $querystring .= $key . '.id as ' . $key . '_id, ';
62
    $querystring .= $key . '.pname as ' . $key . '_pname, ';
63
    $querystring .= $key . '.mother as ' . $key . '_mother, ';
64
    $querystring .= $key . '.father as ' . $key . '_father, ';
65
    $querystring .= $key . '.roft as ' . $key . '_roft, ';
66
    $querystring .= $key . '.foto as ' . $key . '_foto, ';
67
}
68
69
$querystring .= 'mmm.coi as mmm_coi FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' d
70
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' f ON d.father = f.id
71
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' m ON d.mother = m.id
72
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' ff ON f.father = ff.id
73
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' fff ON ff.father = fff.id
74
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' ffm ON ff.mother = ffm.id
75
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' mf ON m.father = mf.id
76
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' mff ON mf.father = mff.id
77
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' mfm ON mf.mother = mfm.id
78
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' fm ON f.mother = fm.id
79
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' fmf ON fm.father = fmf.id
80
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' fmm ON fm.mother = fmm.id
81
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' mm ON m.mother = mm.id
82
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . ' mmf ON mm.father = mmf.id
83
             LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry') . " mmm ON mm.mother = mmm.id
84
             WHERE d.id={$id}";
85
86
$result = $GLOBALS['xoopsDB']->query($querystring);
87
88
$dogs = []; // initialize dogs array
89
while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
90
    //create array for animal (and all parents)
91
    foreach ($qarray as $key) {
92
        $dogs[$key] = [
93
            'id'     => $row[$key . '_id'],
94
            'name'   => stripslashes($row[$key . '_pname']),
95
            'mother' => $row[$key . '_mother'],
96
            'father' => $row[$key . '_father'],
97
            'roft'   => $row[$key . '_roft'],
98
            'nhsb'   => '',
99
        ];
100
        if ((3 != mb_strlen($key) || (0 != $helper->getConfig('lastimage'))) && ('' !== $row[$key . '_foto'])) {
101
            //show image in last row of pedigree if image exists
102
            $dogs[$key]['photo']    = PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row[$key . '_foto'] . '_150.jpeg';
0 ignored issues
show
The constant PEDIGREE_UPLOAD_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
103
            $dogs[$key]['photoBig'] = PEDIGREE_UPLOAD_URL . '/images/' . $row[$key . '_foto'] . '.jpeg';
104
        }
105
106
        $dogs[$key]['overig'] = '';
107
        // $pedidata to hold viewable data to be shown in pedigree
108
        $pedidata = '';
109
110
        if (0 !== $dogs[$key]['id']) {
111
            //if exists create animal object
112
            $animal = new Pedigree\Animal($dogs[$key]['id']);
113
            $fields = $animal->getNumOfFields();
114
        }
115
        foreach ($fields as $i => $iValue) {
116
            $userField = new Pedigree\Field($fields[$i], $animal->getConfig());
117
            if ($userField->isActive() && $userField->inPedigree()) {
118
                $fieldType = $userField->getSetting('fieldtype');
119
                $fieldObj  = new $fieldType($userField, $animal);
120
                $pedidata  .= $fieldObj->showField() . '<br>';
121
            }
122
            $dogs[$key]['hd'] = $pedidata;
123
        }
124
    }
125
}
126
127
//add data to smarty template
128
$GLOBALS['xoopsTpl']->assign([
129
                                 'page_title' => stripslashes($row['d_pname']),
130
                                 'd'          => $dogs,  //assign dogs array
131
                                 //assign config options
132
                                 'male'       => "<img src=\"" . PEDIGREE_IMAGE_URL . "/male.gif\" alt=\"" . _MA_PEDIGREE_FLD_MALE . "\" title=\"" . _MA_PEDIGREE_FLD_MALE . "\">",
133
                                 'female'     => "<img src=\"" . PEDIGREE_IMAGE_URL . "/female.gif\" alt=\"" . _MA_PEDIGREE_FLD_FEMA . "\" title=\"" . _MA_PEDIGREE_FLD_FEMA . "\">",
134
                                 //assign extra display options
135
                                 'unknown'    => _MA_PEDIGREE_UNKNOWN,
136
                                 'SD'         => _MA_PEDIGREE_SD,
137
                                 'PA'         => _MA_PEDIGREE_PA,
138
                                 'GP'         => _MA_PEDIGREE_GP,
139
                                 'GGP'        => _MA_PEDIGREE_GGP,
140
                             ]);
141
142
require __DIR__ . '/footer.php';
143