Issues (119)

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/Common/VersionChecks.php (4 issues)

Labels
Severity
1
<?php namespace XoopsModules\Cardealer\Common;
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
13
/**
14
 * Module: cardealer
15
 *
16
 * @category        Module
17
 * @package         cardealer
18
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
19
 * @copyright       {@link https://xoops.org/ XOOPS Project}
20
 * @license         GPL 2.0 or later
21
 * @link            https://xoops.org/
22
 * @since           1.0.0
23
 */
24
trait VersionChecks
25
{
26
    /**
27
     *
28
     * Verifies XOOPS version meets minimum requirements for this module
29
     * @static
30
     * @param \XoopsModule $module
31
     *
32
     * @param null|string  $requiredVer
33
     * @return bool true if meets requirements, false if not
34
     */
35
    public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null)
36
    {
37
        $moduleDirName      = basename(dirname(dirname(__DIR__)));
38
        $moduleDirNameUpper = strtoupper($moduleDirName);
39
        if (null === $module) {
40
            $module = \XoopsModule::getByDirname($moduleDirName);
41
        }
42
        xoops_loadLanguage('admin', $moduleDirName);
43
44
        //check for minimum XOOPS version
45
        $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string
46
        if (null === $requiredVer) {
47
            $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string
0 ignored issues
show
Are you sure $module->getInfo('min_xoops') of type array|string can be used in concatenation? ( Ignorable by Annotation )

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

47
            $requiredVer = '' . /** @scrutinizer ignore-type */ $module->getInfo('min_xoops'); //making sure it's a string
Loading history...
48
        }
49
        $success = true;
50
51
        if (version_compare($currentVer, $requiredVer, '<')) {
52
            $success = false;
53
            $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer));
54
        }
55
56
        return $success;
57
    }
58
59
    /**
60
     *
61
     * Verifies PHP version meets minimum requirements for this module
62
     * @static
63
     * @param \XoopsModule $module
64
     *
65
     * @return bool true if meets requirements, false if not
66
     */
67
    public static function checkVerPhp(\XoopsModule $module)
68
    {
69
        $moduleDirName      = basename(dirname(dirname(__DIR__)));
70
        $moduleDirNameUpper = strtoupper($moduleDirName);
71
        xoops_loadLanguage('admin', $module->dirname());
0 ignored issues
show
It seems like $module->dirname() can also be of type array and array; however, parameter $domain of xoops_loadLanguage() 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

71
        xoops_loadLanguage('admin', /** @scrutinizer ignore-type */ $module->dirname());
Loading history...
72
        // check for minimum PHP version
73
        $success = true;
74
        $verNum  = PHP_VERSION;
75
        $reqVer  = $module->getInfo('min_php');
76
        if (false !== $reqVer && '' !== $reqVer) {
77
            if (version_compare($verNum, $reqVer, '<')) {
0 ignored issues
show
It seems like $reqVer can also be of type array; however, parameter $version2 of version_compare() 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

77
            if (version_compare($verNum, /** @scrutinizer ignore-type */ $reqVer, '<')) {
Loading history...
78
                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum));
0 ignored issues
show
It seems like $reqVer can also be of type 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

78
                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), /** @scrutinizer ignore-type */ $reqVer, $verNum));
Loading history...
79
                $success = false;
80
            }
81
        }
82
83
        return $success;
84
    }
85
}
86