Issues (381)

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.

plugins/subscribers.php (3 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
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
5
 * ****************************************************************************
6
 *  XNEWSLETTER - MODULE FOR XOOPS
7
 *  Copyright (c) 2007 - 2012
8
 *  Goffy ( wedega.com )
9
 *
10
 *  You may not change or alter any portion of this comment or credits
11
 *  of supporting developers from this source code or any supporting
12
 *  source code which is considered copyrighted (c) material of the
13
 *  original comment or credit authors.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *  ---------------------------------------------------------------------------
20
 * @copyright  Goffy ( wedega.com )
21
 * @license    GPL 2.0
22
 * @package    xnewsletter
23
 * @author     Goffy ( [email protected] )
24
 *
25
 * ****************************************************************************
26
 */
27
28
use XoopsModules\Xnewsletter;
29
30
// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
31
require_once dirname(__DIR__) . '/include/common.php';
32
33
/**
34
 * @return array
35
 */
36 View Code Duplication
function xnewsletter_plugin_getinfo_subscribers()
0 ignored issues
show
This function 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...
37
{
38
    global $xoopsDB;
39
40
    $pluginInfo         = [];
41
    $pluginInfo['name'] = 'subscribers';
42
    if (file_exists(XOOPS_URL . '/modules/subscribers/images/module_logo.gif')) {
43
        $pluginInfo['icon'] = XOOPS_URL . '/modules/subscribers/images/module_logo.gif';
44
    } elseif (file_exists(XOOPS_URL . '/modules/subscribers/assets/images/logo_module.png')) {
45
        $pluginInfo['icon'] = XOOPS_URL . '/modules/subscribers/assets/images/logo_module.png';
46
    }
47
    //$pluginInfo['modulepath'] = XOOPS_ROOT_PATH . "/modules/subscribers/xoops_version.php";
48
    $pluginInfo['tables'][0] = $xoopsDB->prefix('subscribers_user');
49
    $pluginInfo['descr']     = 'Import from subscribers';
50
    $pluginInfo['hasform']   = 0;
51
52
    return $pluginInfo;
53
}
54
55
/**
56
 * @param $cat_id
57
 * @param $action_after_read
58
 * @param $limitcheck
59
 * @param $skipcatsubscrexist
60
 *
61
 * @return int
0 ignored issues
show
Should the return type not be null|integer?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
62
 */
63 View Code Duplication
function xnewsletter_plugin_getdata_subscribers($cat_id, $action_after_read, $limitcheck, $skipcatsubscrexist)
0 ignored issues
show
This function 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...
64
{
65
    global $xoopsDB;
66
    $helper = Xnewsletter\Helper::getInstance();
67
68
    //$table_import = $xoopsDB->prefix('xnewsletter_import');
69
    $import_status = 0 == $action_after_read ? true : false;
70
    $i             = 0;
71
    $j             = 0;
72
73
    $sql = 'SELECT `user_email`, `user_name`';
74
    $sql .= ' FROM ' . $xoopsDB->prefix('subscribers_user');
75
    $sql .= " WHERE (`user_email` is not null and not(`user_email`=''))";
76
    if (!$result_users = $xoopsDB->query($sql)) {
77
        die('MySQL-Error: ' . $GLOBALS['xoopsDB']->error());
78
    }
79
    while (false !== ($lineArray = $xoopsDB->fetchBoth($result_users))) {
80
        ++$i;
81
        $email     = $lineArray[0];
82
        $sex       = '';
83
        $firstname = '';
84
        $lastname  = $lineArray[1];
85
86
        $subscr_id    = xnewsletter_pluginCheckEmail($email);
87
        $catsubscr_id = xnewsletter_pluginCheckCatSubscr($subscr_id, $cat_id);
88
89
        if (1 == $skipcatsubscrexist && $catsubscr_id > 0) {
90
            //skip existing subscriptions
91
        } else {
92
            $currcatid = $catsubscr_id > 0 ? 0 : $cat_id;
93
            $importObj = $helper->getHandler('Import')->create();
94
            $importObj->setVar('import_email', $email);
95
            $importObj->setVar('import_sex', $sex);
96
            $importObj->setVar('import_firstname', $firstname);
97
            $importObj->setVar('import_lastname', $lastname);
98
            $importObj->setVar('import_cat_id', $currcatid);
99
            $importObj->setVar('import_subscr_id', $subscr_id);
100
            $importObj->setVar('import_catsubscr_id', $catsubscr_id);
101
            $importObj->setVar('import_status', $import_status);
102
            if (!$helper->getHandler('Import')->insert($importObj)) {
103
                echo $importObj->getHtmlErrors();
104
                exit();
105
            }
106
            //            $sql = "INSERT INTO {$table_import} (import_email, import_sex, import_firstname, import_lastname, import_cat_id, import_subscr_id, import_catsubscr_id, import_status)";
107
            //            $sql .= " VALUES ('$email', '$sex', '$firstname', '$lastname', $currcatid, $subscr_id, $catsubscr_id, $import_status)";
108
            //            $result_insert = $xoopsDB->query($sql) or die ("MySQL-Error: " . $GLOBALS['xoopsDB']->error());
109
            ++$j;
110
        }
111
        ++$i;
112
        if (100000 == $j) {
113
            break;
114
        } //maximum number of processing to avoid cache overflow
115
        if ($limitcheck > 0 && $j == $limitcheck) {
116
            $import_status = false;
117
        }
118
    }
119
120
    return $j;
121
}
122