Issues (299)

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.

class/SmartobjectDbupdater.php (3 issues)

Severity
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Smartfaq;
4
5
/**
6
 * SmartobjectDbupdater class
7
 *
8
 * Class performing the database update for the module
9
 *
10
 * @author  marcan <[email protected]>
11
 * @link    https://www.smartfactory.ca The SmartFactory
12
 */
13
14
use XoopsModules\Smartfaq;
15
16
/**
17
 * Class SmartobjectDbupdater
18
 */
19
class SmartobjectDbupdater
20
{
21
    /**
22
     * SmartobjectDbupdater constructor.
23
     */
24
    public function __construct()
25
    {
26
    }
27
28
    /**
29
     * Use to execute a general query
30
     *
31
     * @param string $query   query that will be executed
32
     * @param string $goodmsg message displayed on success
33
     * @param string $badmsg  message displayed on error
34
     *
35
     * @return bool true if success, false if an error occurred
36
     */
37
    public function runQuery($query, $goodmsg, $badmsg)
38
    {
39
        global $xoopsDB;
40
        $ret = $xoopsDB->queryF($query);
41
        if (!$ret) {
42
            echo "&nbsp;&nbsp;$badmsg<br>";
43
44
            return false;
45
        }
46
        echo "&nbsp;&nbsp;$goodmsg<br>";
47
48
        return true;
49
    }
50
51
    /**
52
     * Use to rename a table
53
     *
54
     * @param string $from name of the table to rename
55
     * @param string $to   new name of the renamed table
56
     *
57
     * @return bool true if success, false if an error occurred
58
     */
59
    public function renameTable($from, $to)
60
    {
61
        global $xoopsDB;
62
63
        $from = $xoopsDB->prefix($from);
64
        $to   = $xoopsDB->prefix($to);
65
66
        $query = \sprintf('ALTER TABLE `%s` RENAME %s', $from, $to);
67
        $ret   = $xoopsDB->queryF($query);
68
        if (!$ret) {
69
            echo '&nbsp;&nbsp;' . \sprintf(\_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>';
70
71
            return false;
72
        }
73
        echo '&nbsp;&nbsp;' . \sprintf(\_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>';
74
75
        return true;
76
    }
77
78
    /**
79
     * Use to update a table
80
     *
81
     * @param Smartfaq\SmartDbTable $table {@link SmartDbTable} that will be updated
82
     *
83
     * @return bool true if success, false if an error occurred
84
     * @see DbTable
85
     */
86
    public function updateTable($table)
87
    {
88
        global $xoopsDB;
89
90
        $ret = true;
91
92
        // If table has a structure, create the table
93
        if ($table->getStructure()) {
94
            $ret = $table->createTable() && $ret;
95
        }
96
97
        // If table is flag for drop, drop it
98
        if ($table->getFlagForDrop()) {
99
            $ret = $table->dropTable() && $ret;
100
        }
101
102
        // If table has data, insert it
103
        if ($table->getData()) {
104
            $ret = $table->addData() && $ret;
105
        }
106
107
        // If table has new fields to be added, add them
108
        if ($table->getNewFields()) {
109
            $ret = $table->addNewFields() && $ret;
110
        }
111
112
        // If table has altered field, alter the table
113
        if ($table->getAlteredFields()) {
114
            $ret = $table->alterTable() && $ret;
115
        }
116
117
        // If table has updated field values, update the table
118
        if ($table->getUpdatedFields()) {
119
            $ret = $table->updateFieldsValues($table) && $ret;
0 ignored issues
show
The call to XoopsModules\Smartfaq\Sm...e::updateFieldsValues() has too many arguments starting with $table. ( Ignorable by Annotation )

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

119
            $ret = $table->/** @scrutinizer ignore-call */ updateFieldsValues($table) && $ret;

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
120
        }
121
122
        // If table has dropped field, alter the table
123
        if ($table->getDroppedFields()) {
124
            $ret = $table->dropFields($table) && $ret;
0 ignored issues
show
The call to XoopsModules\Smartfaq\SmartDbTable::dropFields() has too many arguments starting with $table. ( Ignorable by Annotation )

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

124
            $ret = $table->/** @scrutinizer ignore-call */ dropFields($table) && $ret;

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
125
        }
126
        //felix
127
        // If table has updated field values, update the table
128
        if ($table->getUpdatedWhere()) {
129
            $ret = $table->updateWhereValues($table) && $ret;
0 ignored issues
show
The call to XoopsModules\Smartfaq\Sm...le::updateWhereValues() has too many arguments starting with $table. ( Ignorable by Annotation )

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

129
            $ret = $table->/** @scrutinizer ignore-call */ updateWhereValues($table) && $ret;

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
130
        }
131
132
        return $ret;
133
    }
134
}
135