Issues (181)

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.

plugins/article.php (11 issues)

1
<?php declare(strict_types=1);
2
/**
3
 * ****************************************************************************
4
 * marquee - MODULE FOR XOOPS
5
 * Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com)
6
 *
7
 * You may not change or alter any portion of this comment or credits
8
 * of supporting developers from this source code or any supporting source code
9
 * which is considered copyrighted (c) material of the original comment or credit authors.
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 *
14
 * @copyright         Hervé Thouzard (https://www.herve-thouzard.com)
15
 * @license           GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
16
 * @author            Hervé Thouzard (https://www.herve-thouzard.com)
17
 *
18
 * Version :
19
 * ****************************************************************************
20
 *
21
 * @param $limit
22
 * @param $dateFormat
23
 * @param $itemsSize
24
 *
25
 * @return array
26
 */
27
28
//  ------------------------------------------------------------------------ //
29
//  Article plugin for Marquee 2.4                                           //
30
//  written by Defkon1 [defkon1 at gmail dot com]                            //
31
//  ------------------------------------------------------------------------ //
32
use XoopsModules\Article;
0 ignored issues
show
The type XoopsModules\Article 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...
33
34
/**
35
 * @param $limit
36
 * @param $dateFormat
37
 * @param $itemsSize
38
 * @return array|false
39
 */
40
function b_marquee_article($limit, $dateFormat, $itemsSize)
41
{
42
    global $xoopsDB;
43
    //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
44
    require_once XOOPS_ROOT_PATH . '/modules/article/include/functions.php';
45
    $block = [];
0 ignored issues
show
The assignment to $block is dead and can be removed.
Loading history...
46
    $myts  = \MyTextSanitizer::getInstance();
0 ignored issues
show
The assignment to $myts is dead and can be removed.
Loading history...
47
    static $accessCats;
48
    $artConfig = art_load_config();
0 ignored issues
show
The assignment to $artConfig is dead and can be removed.
Loading history...
The function art_load_config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

48
    $artConfig = /** @scrutinizer ignore-call */ art_load_config();
Loading history...
49
    art_define_url_delimiter();
0 ignored issues
show
The function art_define_url_delimiter was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

49
    /** @scrutinizer ignore-call */ 
50
    art_define_url_delimiter();
Loading history...
50
    $select  = 'art_id';
51
    $dispTag = '';
0 ignored issues
show
The assignment to $dispTag is dead and can be removed.
Loading history...
52
    $from    = '';
53
    $where   = '';
54
    $order   = 'art_time_publish DESC';
55
    $select  .= ', cat_id, art_title, uid, art_time_publish';
56
    if (null === $accessCats) {
57
        $permissionHandler = Article\Helper::getInstance()->getHandler('Permission');
0 ignored issues
show
The type XoopsModules\Article\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...
58
        $accessCats        = $permissionHandler->getCategories('access');
59
    }
60
    $allowedCats = $accessCats;
61
    $sql       = "SELECT $select FROM " . art_DB_prefix('article') . $from;
0 ignored issues
show
The function art_DB_prefix was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

61
    $sql       = "SELECT $select FROM " . /** @scrutinizer ignore-call */ art_DB_prefix('article') . $from;
Loading history...
62
    $sql       .= ' WHERE cat_id IN (' . implode(',', $allowedCats) . ') AND art_time_publish >0 ' . $where;
63
    $sql       .= ' ORDER BY ' . $order;
64
    $sql       .= ' LIMIT 0, ' . $limit;
65
    $result = $xoopsDB->query($sql);
66
    if (!$xoopsDB->isResultSet($result)) {
67
        return false;
68
    }
69
    $rows   = [];
70
    $author = [];
71
    while (false !== ($row = $xoopsDB->fetchArray($result))) {
72
        $rows[]              = $row;
73
        $author[$row['uid']] = 1;
74
    }
75
    if (count($rows) < 1) {
76
        return false;
77
    }
78
    $authorName     = \XoopsUser::getUnameFromId(array_keys($author));
0 ignored issues
show
array_keys($author) of type array is incompatible with the type integer expected by parameter $userid of XoopsUser::getUnameFromId(). ( Ignorable by Annotation )

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

78
    $authorName     = \XoopsUser::getUnameFromId(/** @scrutinizer ignore-type */ array_keys($author));
Loading history...
79
    $arts           = [];
80
    $uids           = [];
0 ignored issues
show
The assignment to $uids is dead and can be removed.
Loading history...
81
    $cids           = [];
82
    $articleHandler = Article\Helper::getInstance()->getHandler('Article');
83
    foreach ($rows as $row) {
84
        $article = $articleHandler->create(false);
85
        $article->assignVars($row);
86
        $_art = [];
87
        foreach ($row as $tag => $val) {
88
            $_art[$tag] = @$article->getVar($tag);
89
        }
90
        $_art['author']   = $authorName[$row['uid']];
91
        $_art['date']     = $article->getTime($dateFormat);
92
        $titlelength      = $itemsSize + 3;
93
        $_art['title']    = xoops_substr($_art['art_title'], 0, $titlelength);
94
        $_art['category'] = '';
95
        $delimiter        = '/';
96
        $_art['link']     = '<a href="' . XOOPS_URL . "modules/article/view.article.php$delimiter" . $_art['art_id'] . '/c' . $_art['cat_id'] . '"><strong>' . $_art['art_title'] . '</strong></a>';
97
        $arts[]           = $_art;
98
        unset($article, $_art);
99
        $cids[$row['cat_id']] = 1;
100
    }
101
    $block = $arts;
102
103
    return $block;
104
}
105