Issues (116)

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/Plugin/CommentsPlugin.php (2 issues)

1
<?php
2
3
namespace XoopsModules\Xooghost\Plugin;
4
5
/**
6
 * Xooghost module
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
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright       XOOPS Project (https://xoops.org)
16
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 * @package         Xooghost
18
 * @since           2.6.0
19
 * @author          Laurent JEN (Aka DuGris)
20
 */
21
22
/**
23
 * Class XooghostCommentsPlugin
24
 */
25
class CommentsPlugin extends \Xoops\Module\Plugin\PluginAbstract implements \CommentsPluginInterface
26
{
27
    /**
28
     * @return string
29
     */
30
    public function itemName()
31
    {
32
        return 'ghost_id';
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function pageName()
39
    {
40
        return 'page_comment.php';
41
    }
42
43
    /**
44
     * @return array
45
     */
46
    public function extraParams()
47
    {
48
        return [];
49
    }
50
51
    /**
52
     * This method will be executed upon successful post of an approved comment.
53
     * This includes comment posts by administrators, and change of comment status from 'pending' to 'active' state.
54
     * An CommentsComment object that has been approved will be passed as the first and only parameter.
55
     * This should be useful for example notifying the item submitter of a comment post.
56
     *
57
     * @param \CommentsComment $comment
58
     */
59
    public function approve(\CommentsComment $comment)
60
    {
61
        //Where are you looking at?
62
    }
63
64
    /**
65
     * This method will be executed whenever the total number of 'active' comments for an item is changed.
66
     *
67
     * @param int $item_id   The unique ID of an item
68
     * @param int $total_num The total number of active comments
69
     */
70
    public function update($item_id, $total_num)
71
    {
72
        $db = \Xoops::getInstance()->db();
73
        $sql = 'UPDATE ' . $db->prefix('xooghost') . ' SET xooghost_comments = ' . (int)($total_num) . ' WHERE xooghost_id = ' . (int)($item_id);
74
        $db->query($sql);
75
    }
76
77
    /**
78
     * This method will be executed whenever a new comment form is displayed.
79
     * You can set a default title for the comment and a header to be displayed on top of the form
80
     * ex: return array(
81
     *      'title' => 'My Article Title',
82
     *      'text' => 'Content of the article');
83
     *      'timestamp' => time(); //Date of the article in unix format
84
     *      'uid' => Id of the article author
85
     *
86
     * @param int $item_id The unique ID of an item
87
     *
88
     * @return array
89
     */
90
    public function itemInfo($item_id)
91
    {
92
        $ret = [];
93
94
        $helper = \XoopsModules\Xooghost\Helper::getInstance();
95
        $pageHandler = $helper->getHandler('Page');
96
        $page = $page = $pageHandler->get($item_id);
0 ignored issues
show
The assignment to $page is dead and can be removed.
Loading history...
97
98
        $ret['text'] = $page->getVar('xooghost_content');
0 ignored issues
show
The method getVar() does not exist on null. ( Ignorable by Annotation )

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

98
        /** @scrutinizer ignore-call */ 
99
        $ret['text'] = $page->getVar('xooghost_content');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
99
        $ret['title'] = $page->getVar('xooghost_title');
100
        $ret['uid'] = $page->getVar('xooghost_uid');
101
        $ret['timestamp'] = $page->getVar('xooghost_published');
102
103
        return $ret;
104
    }
105
}
106