Issues (1210)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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/utility.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Class MyalbumUtil
5
 */
6
class ApcalUtility extends XoopsObject
7
{
8
    /**
9
     * Function responsible for checking if a directory exists, we can also write in and create an index.html file
10
     *
11
     * @param string $folder The full path of the directory to check
12
     *
13
     * @return void
14
     */
15
    public static function createFolder($folder)
16
    {
17
        //        try {
18
//            if (!mkdir($folder) && !is_dir($folder)) {
19
//                throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
20
//            } else {
21
//                file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
22
//            }
23
//        }
24
//        catch (Exception $e) {
25
//            echo 'Caught exception: ', $e->getMessage(), "\n", '<br/>';
26
//        }
27
        try {
28
            if (!file_exists($folder)) {
29
                if (!mkdir($folder) && !is_dir($folder)) {
30
                    throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
31
                } else {
32
                    file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
33
                }
34
            }
35
        } catch (Exception $e) {
36
            echo 'Caught exception: ', $e->getMessage(), "\n", '<br/>';
37
        }
38
    }
39
40
    /**
41
     * @param $file
42
     * @param $folder
43
     * @return bool
44
     */
45
    public static function copyFile($file, $folder)
46
    {
47
        return copy($file, $folder);
48
        //        try {
49
        //            if (!is_dir($folder)) {
50
        //                throw new \RuntimeException(sprintf('Unable to copy file as: %s ', $folder));
51
        //            } else {
52
        //                return copy($file, $folder);
53
        //            }
54
        //        } catch (Exception $e) {
55
        //            echo 'Caught exception: ', $e->getMessage(), "\n", "<br/>";
56
        //        }
57
        //        return false;
58
    }
59
60
    /**
61
     * @param $src
62
     * @param $dst
63
     */
64
    public static function recurseCopy($src, $dst)
65
    {
66
        $dir = opendir($src);
67
        //    @mkdir($dst);
68
        while (false !== ($file = readdir($dir))) {
69
            if (($file !== '.') && ($file !== '..')) {
70
                if (is_dir($src . '/' . $file)) {
71
                    self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
72
                } else {
73
                    copy($src . '/' . $file, $dst . '/' . $file);
74
                }
75
            }
76
        }
77
        closedir($dir);
78
    }
79
80
    /**
81
     *
82
     * Verifies XOOPS version meets minimum requirements for this module
83
     * @static
84
     * @param XoopsModule $module
85
     *
86
     * @return bool true if meets requirements, false if not
87
     */
88 View Code Duplication
    public static function checkVerXoops(XoopsModule $module)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
89
    {
90
        xoops_loadLanguage('admin', $module->dirname());
91
        // check for minimum PHP version
92
        $success = true;
93
        $verNum  = PHP_VERSION;
94
        $reqVer  = $module->getInfo('min_php');
95
        if ((false !== $reqVer) && ('' !== $reqVer)) {
96
            if (version_compare($verNum, (string)$reqVer, '<')) {
97
                $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_PHP, $reqVer, $verNum));
98
                $success = false;
99
            }
100
        }
101
        return $success;
102
    }
103
104
    /**
105
     *
106
     * Verifies PHP version meets minimum requirements for this module
107
     * @static
108
     * @param XoopsModule $module
109
     *
110
     * @return bool true if meets requirements, false if not
111
     */
112 View Code Duplication
    public static function checkVerPhp(XoopsModule $module)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
113
    {
114
        xoops_loadLanguage('admin', $module->dirname());
115
        // check for minimum PHP version
116
        $success = true;
117
        $verNum  = PHP_VERSION;
118
        $reqVer  = $module->getInfo('min_php');
119
        if (false !== $reqVer && '' !== $reqVer) {
120
            if (version_compare($verNum, $reqVer, '<')) {
121
                $module->setErrors(sprintf(_AM_APCAL_ERROR_BAD_PHP, $reqVer, $verNum));
122
                $success = false;
123
            }
124
        }
125
126
        return $success;
127
    }
128
}
129