Issues (432)

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/AudioController.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Suico;
4
5
use Criteria;
6
use Exception;
7
8
/*
9
 You may not change or alter any portion of this comment or credits
10
 of supporting developers from this source code or any supporting source code
11
 which is considered copyrighted (c) material of the original comment or credit authors.
12
13
 This program is distributed in the hope that it will be useful,
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
*/
17
/**
18
 * @category        Module
19
 * @copyright       {@link https://xoops.org/ XOOPS Project}
20
 * @license         GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
21
 * @author          Marcello Brandão aka  Suico, Mamba, LioMJ  <https://xoops.org>
22
 */
23
require_once XOOPS_ROOT_PATH . '/kernel/object.php';
24
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
25
require_once XOOPS_ROOT_PATH . '/class/criteria.php';
26
require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
27
28
/**
29
 * Class AudioController
30
 */
31
class AudioController extends Controller
32
{
33
    /**
34
     * Fetch audios
35
     * @param object $criteria
36
     * @return array of video objects
37
     */
38
    public function getAudio(
39
        $criteria
40
    ) {
41
        return $this->audioFactory->getObjects($criteria);
42
    }
43
44
    /**
45
     * Assign Audio Content to Template
46
     * @param int   $countAudios
47
     * @param array $audios
48
     * @return bool|array
49
     * @throws Exception
50
     * @throws Exception
51
     */
52
    public function assignAudioContent(
53
        $countAudios,
54
        $audios
55
    ) {
56
        if (0 === $countAudios) {
57
            return false;
58
        }
59
        //audio info
60
        /**
61
         * Lets populate an array with the data from the audio
62
         */
63
        $i           = 0;
64
        $audiosArray = [];
65
        foreach ($audios as $audio) {
66
            $audiosArray[$i]['filename']     = $audio->getVar('filename', 's');
67
            $audiosArray[$i]['title']        = $audio->getVar('title', 's');
68
            $audiosArray[$i]['id']           = $audio->getVar('audio_id', 's');
69
            $audiosArray[$i]['author']       = $audio->getVar('author', 's');
70
            $audiosArray[$i]['date_created'] = \formatTimestamp($audio->getVar('date_created', 's'));
71
            $audiosArray[$i]['date_updated'] = \formatTimestamp($audio->getVar('date_updated', 's'));
72
            $audio_path                      = XOOPS_ROOT_PATH . '/uploads/suico/audio/' . $audio->getVar('filename', 's');
73
            // echo $audio_path;
74
            $mp3filemetainfo                = new Id3v1($audio_path, true);
75
            $mp3filemetainfoarray           = [];
76
            $mp3filemetainfoarray['Title']  = $mp3filemetainfo->getTitle();
77
            $mp3filemetainfoarray['Artist'] = $mp3filemetainfo->getArtist();
78
            $mp3filemetainfoarray['Album']  = $mp3filemetainfo->getAlbum();
79
            $mp3filemetainfoarray['Year']   = $mp3filemetainfo->getYear();
80
            $audiosArray[$i]['meta']        = $mp3filemetainfoarray;
81
            $i++;
82
        }
83
84
        return $audiosArray;
85
    }
86
87
    /**
88
     * Create a page navbar for videos
89
     * @param     $countAudios
90
     * @param int $audiosPerPage the number of videos in a page
91
     * @param int $start         at which position of the array we start
92
     * @param int $interval      how many pages between the first link and the next one
93
     * @return string|null
94
     * @return string|null
95
     */
96
    public function getAudiosNavBar(
97
        $countAudios,
98
        $audiosPerPage,
99
        $start,
100
        $interval
101
    ) {
102
        $pageNav = new \XoopsPageNav($countAudios, $audiosPerPage, $start, 'start', 'uid=' . $this->uidOwner);
103
104
        return $pageNav->renderImageNav($interval);
105
    }
106
107
    /**
108
     * @return bool|void
109
     */
110
    public function checkPrivilege()
111
    {
112
        if (0 === $this->helper->getConfig('enable_audio')) {
113
            \redirect_header('index.php?uid=' . $this->owner->getVar('uid'), 3, \_MD_SUICO_AUDIO_ENABLED_NOT);
114
        }
115
        $criteria = new Criteria('config_uid', $this->owner->getVar('uid'));
0 ignored issues
show
It seems like $this->owner->getVar('uid') can also be of type array and array; however, parameter $value of Criteria::__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

115
        $criteria = new Criteria('config_uid', /** @scrutinizer ignore-type */ $this->owner->getVar('uid'));
Loading history...
116
        if (1 === $this->configsFactory->getCount($criteria)) {
117
            $configs = $this->configsFactory->getObjects($criteria);
118
            $config  = $configs[0]->getVar('audio');
119
            if (!$this->checkPrivilegeLevel($config)) {
120
                \redirect_header('index.php?uid=' . $this->owner->getVar('uid'), 10, \_MD_SUICO_NOPRIVILEGE);
121
            }
122
        }
123
124
        return true;
125
    }
126
}
127