Issues (80)

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

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Rssfit\Plugins;
6
7
/*
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 */
16
17
/**
18
 * @copyright    XOOPS Project (https://xoops.org)
19
 * @license      GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
20
 * @package      RSSFit - Extendable XML news feed generator
21
 * @author       NS Tai (aka tuff) <http://www.brandycoke.com>
22
 * @author       XOOPS Development Team
23
 */
24
25
/*
26
* This file is a dummy for making a RSSFit plug-in, follow the following steps
27
* if you really want to do so.
28
* Step 0:   Stop here if you are not sure what you are doing, it's no fun at all
29
* Step 1:   Clone this file and rename as something like rssfit.[mod_dir].php
30
* Step 2:   Replace the text "RssfitSample" with "Rssfit[mod_dir]" at line 59 and
31
*           line 65, i.e. "RssfitNews" for the module "News"
32
* Step 3:   Modify the word in line 60 from 'sample' to [mod_dir]
33
* Step 4:   Modify the function "grabEntries" to satisfy your needs
34
* Step 5:   Move your new plug-in file to the RSSFit plugins folder,
35
*           i.e. your-xoops-root/modules/rssfit/plugins
36
* Step 6:   Install your plug-in by pointing your browser to
37
*           your-xoops-url/modules/rssfit/admin/?do=plugins
38
* Step 7:   Finally, tell us about yourself and this file by modifying the
39
*           "About this RSSFit plug-in" section which is located... somewhere.
40
*
41
* [mod_dir]: Name of the driectory of your module, i.e. 'news'
42
*
43
* About this RSSFit plug-in
44
* Author: John Doe <http://www.your.site>
45
* Requirements (or Tested with):
46
*  Module: Blah <http://www.where.to.find.it>
47
*  Version: 1.0
48
*  RSSFit verision: 1.2 / 1.5
49
*  XOOPS version: 2.0.13.2 / 2.2.3
50
*/
51
52
use XoopsModules\Rssfit\{
53
    AbstractPlugin
54
};
55
56
use XoopsModules\Sample\Helper as PluginHelper;
0 ignored issues
show
The type XoopsModules\Sample\Helper was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
57
58
if (!\defined('RSSFIT_ROOT_PATH')) {
59
    exit();
60
}
61
62
/**
63
 * Class Sample
64
 * @package XoopsModules\Rssfit\Plugins
65
 */
66
final class Sample extends AbstractPlugin
67
{
68
    public function __construct() {
69
        if (\class_exists(PluginHelper::class)) {
70
            $this->helper = PluginHelper::getInstance();
71
            $this->dirname = $this->helper->dirname();
72
        }
73
    }
74
75
    public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
76
    {
77
        $myts = \MyTextSanitizer::getInstance();
78
        $ret  = null;
79
        $i    = 0;
80
        //  The following example code grabs the latest entries from the module MyLinks
81
        $sql    = 'SELECT l.lid, l.cid, l.title, l.date, t.description FROM ' . $xoopsDB->prefix('mylinks_links') . ' l, ' . $xoopsDB->prefix('mylinks_text') . ' t WHERE l.status > 0 AND l.lid = t.lid ORDER BY date DESC';
82
        $result = $xoopsDB->query($sql, $this->grab, 0);
83
        if ($result instanceof \mysqli_result) {
84
            $ret = [];
85
            while (false !== ($row = $xoopsDB->fetchArray($result))) {
86
                $link = XOOPS_URL . '/modules/' . $this->dirname . '/singlelink.php?cid=' . $row['cid'] . '&amp;lid=' . $row['lid'];
87
                /*
88
                * Required elements of an RSS item
89
                */
90
                //  1. Title of an item
91
                $ret[$i]['title'] = $row['title'];
92
                //  2. URL of an item
93
                $ret[$i]['link'] = $link;
94
                //  3. Item modification date, must be in Unix time format
95
                $ret[$i]['timestamp'] = $row['date'];
96
                //  4. The item synopsis, or description, whatever
97
                $ret[$i]['description'] = $myts->displayTarea($row['description']);
98
                /*
99
                * Optional elements of an RSS item
100
                */
101
                //  5. The item synopsis, or description, whatever
102
                $ret[$i]['guid'] = $link;
103
                //  6. A string + domain that identifies a categorization taxonomy
104
                $ret[$i]['category'] = $this->modname;
105
                $ret[$i]['domain']   = XOOPS_URL . '/modules/' . $this->dirname . '/';
106
                //  7. extra tags examples
107
                $ret[$i]['extras'] = [];
108
                //  7a. without attribute
109
                $ret[$i]['extras']['author'] = ['content' => '[email protected]'];
110
                //  7b. with attributes
111
                $ret[$i]['extras']['enclosure']['attributes'] = ['url' => 'url-to-any-file', 'length' => 1024000, 'type' => 'audio/mpeg'];
112
                $i++;
113
            }
114
        }
115
        return $ret;
116
    }
117
}
118