Issues (36)

Security Analysis    no request data  

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.

class/Entries.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Gbook;
6
7
/**
8
 * ****************************************************************************
9
 *  GBOOK - MODULE FOR XOOPS
10
 *  Copyright (c) 2007 - 2012
11
 *  Ingo H. de Boer (http://www.winshell.org)
12
 *
13
 *  This program is free software; you can redistribute it and/or modify
14
 *  it under the terms of the GNU General Public License as published by
15
 *  the Free Software Foundation; either version 2 of the License, or
16
 *  (at your option) any later version.
17
 *
18
 *  You may not change or alter any portion of this comment or credits
19
 *  of supporting developers from this source code or any supporting
20
 *  source code which is considered copyrighted (c) material of the
21
 *  original comment or credit authors.
22
 *
23
 *  This program is distributed in the hope that it will be useful,
24
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 *  GNU General Public License for more details.
27
 *  ---------------------------------------------------------------------------
28
 *
29
 * @copyright       Ingo H. de Boer (http://www.winshell.org)
30
 * @license         GNU General Public License (GPL)
31
 * @package         GBook
32
 * @author          Ingo H. de Boer ([email protected])
33
 *
34
 * ****************************************************************************
35
 */
36
37
use Xmf\Request;
38
use XoopsFormButton;
39
use XoopsFormHidden;
40
use XoopsFormText;
41
use XoopsModules\Gbook;
42
use XoopsObject;
43
use XoopsThemeForm;
44
45
46
47
48
49
/**
50
 * @package   kernel
51
 * @copyright copyright &copy; 2000 XOOPS.org
52
 */
53
class Entries extends XoopsObject
54
{
55
    /**
56
     * Constructor
57
     */
58
    public function __construct()
59
    {
60
        $this->initVar('id', \XOBJ_DTYPE_INT, null, true);
61
        $this->initVar('name', \XOBJ_DTYPE_TXTBOX);
62
        $this->initVar('email', \XOBJ_DTYPE_TXTBOX);
63
        $this->initVar('url', \XOBJ_DTYPE_TXTBOX);
64
        $this->initVar('message', \XOBJ_DTYPE_TXTAREA);
65
        $this->initVar('note', \XOBJ_DTYPE_TXTAREA);
66
        $this->initVar('time', \XOBJ_DTYPE_INT);
67
        $this->initVar('date', \XOBJ_DTYPE_TXTBOX);
68
        $this->initVar('ip', \XOBJ_DTYPE_TXTBOX);
69
        $this->initVar('admin', \XOBJ_DTYPE_TXTBOX);
70
71
        $this->initVar('dohtml', \XOBJ_DTYPE_INT, 1, false);
72
        $this->initVar('dosmiley', \XOBJ_DTYPE_INT, 1, false);
73
        $this->initVar('doxcode', \XOBJ_DTYPE_INT, 1, false);
74
        $this->initVar('doimage', \XOBJ_DTYPE_INT, 1, false);
75
        $this->initVar('dobr', \XOBJ_DTYPE_INT, 1, false);
76
    }
77
78
    /**
79
     * Get {@link XoopsThemeForm} for adding/editing categories
80
     *
81
     * @param mixed $action URL to submit to or false for $_SERVER['REQUEST_URI']
82
     *
83
     * @return \XoopsThemeForm
84
     */
85
    public function getForm($action = false): XoopsThemeForm
86
    {
87
        if (false === $action) {
88
            $action = Request::getString('REQUEST_URI', '', 'SERVER');
89
        }
90
        $title = _AM_GBOOK_ENTRY_EDIT;
91
        $helper  = Gbook\Helper::getInstance();
92
        $utility = new Gbook\Utility();
93
94
        require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
95
96
        $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
97
98
        $form->addElement(new XoopsFormText(_AM_GBOOK_NAME, 'name', 35, 255, $this->getVar('name')));
0 ignored issues
show
It seems like $this->getVar('name') can also be of type array and array; however, parameter $value of XoopsFormText::__construct() 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

98
        $form->addElement(new XoopsFormText(_AM_GBOOK_NAME, 'name', 35, 255, /** @scrutinizer ignore-type */ $this->getVar('name')));
Loading history...
99
        $form->addElement(new XoopsFormText(_AM_GBOOK_EMAIL, 'email', 35, 255, $this->getVar('email')));
100
        $form->addElement(new XoopsFormText(_AM_GBOOK_URL, 'url', 35, 255, $this->getVar('url')));
101
102
        //set Editor options
103
        $options['name']   = 'message';
0 ignored issues
show
Comprehensibility Best Practice introduced by
$options was never initialized. Although not strictly required by PHP, it is generally a good practice to add $options = array(); before regardless.
Loading history...
104
        $options['value']  = $this->getVar('message', 'e');
105
        $options['rows']   = 25;
106
        $options['cols']   = '100%';
107
        $options['width']  = '100%';
108
        $options['height'] = '400px';
109
110
        $messageEditor = $utility::getEditor($helper, $options);
111
        $form->addElement($messageEditor);
112
113
        $options['name']  = 'note';
114
        $options['value'] = $this->getVar('note', 'e');
115
116
        $noteEditor = $utility::getEditor($helper, $options);
117
        $form->addElement($noteEditor);
118
119
        $form->addElement(new XoopsFormHidden('op', 'save'));
120
        $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
121
122
        return $form;
123
    }
124
}
125