Issues (62)

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.

include/functions.php (4 issues)

1
<?php
2
3
/**
4
 * ****************************************************************************
5
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
6
 * ****************************************************************************
7
 *  XHTTPERROR - MODULE FOR XOOPS
8
 *  Copyright (c) 2007 - 2012
9
 *  Rota Lucio ( http://luciorota.altervista.org/xoops/ )
10
 *
11
 *  You may not change or alter any portion of this comment or credits
12
 *  of supporting developers from this source code or any supporting
13
 *  source code which is considered copyrighted (c) material of the
14
 *  original comment or credit authors.
15
 *
16
 *  This program is distributed in the hope that it will be useful,
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *  GNU General Public License for more details.
20
 *  ---------------------------------------------------------------------------
21
 * @copyright  Rota Lucio ( http://luciorota.altervista.org/xoops/ )
22
 * @license    GNU General Public License v3.0
23
 * @package    xhttperror
24
 * @author     Rota Lucio ( [email protected] )
25
 *
26
 *  $Rev$:     Revision of last commit
27
 *  $Author$:  Author of last commit
28
 *  $Date$:    Date of last commit
29
 * ****************************************************************************
30
 */
31
function xhttperror_checkModuleAdmin()
32
{
33
    if (is_file($GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) {
34
        require_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
35
36
        return true;
37
    }
38
    echo xoops_error("Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
0 ignored issues
show
Are you sure the usage of xoops_error('Error: You ...stall this Frameworks') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Are you sure xoops_error('Error: You ...stall this Frameworks') of type void can be used in echo? ( Ignorable by Annotation )

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

38
    echo /** @scrutinizer ignore-type */ xoops_error("Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
Loading history...
39
40
    return false;
41
}
42
43
/**
44
 * @param        $global
45
 * @param        $key
46
 * @param string $default
47
 * @param string $type
48
 * @return false|int|mixed|string
49
 */
50
function xhttperror_CleanVars($global, $key, $default = '', $type = 'int')
51
{
52
    switch ($type) {
53
        case 'array':
54
            $ret = (isset($global[$key]) && is_array($global[$key])) ? $global[$key] : $default;
55
            break;
56
        case 'date':
57
            $ret = isset($global[$key]) ? strtotime($global[$key]) : $default;
58
            break;
59
        case 'string':
60
            if (defined('FILTER_SANITIZE_ADD_SLASHES')) {
61
                $ret = isset($global[$key]) ? filter_var($global[$key], FILTER_SANITIZE_ADD_SLASHES) : $default;
62
            } else {
63
                $ret = isset($global[$key]) ? filter_var($global[$key], FILTER_SANITIZE_MAGIC_QUOTES) : $default;
0 ignored issues
show
The constant FILTER_SANITIZE_MAGIC_QUOTES has been deprecated: 7.4 ( Ignorable by Annotation )

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

63
                $ret = isset($global[$key]) ? filter_var($global[$key], /** @scrutinizer ignore-deprecated */ FILTER_SANITIZE_MAGIC_QUOTES) : $default;
Loading history...
64
            }
65
            break;
66
        case 'int':
67
        default:
68
            $ret = isset($global[$key]) ? filter_var($global[$key], FILTER_SANITIZE_NUMBER_INT) : $default;
69
            break;
70
    }
71
    if (false === $ret) {
72
        return $default;
73
    }
74
75
    return $ret;
76
}
77
78
/**
79
 * @param $content
80
 */
81
function xhttperror_meta_keywords($content)
82
{
83
    global $xoopsTpl, $xoTheme;
84
    $myts    = \MyTextSanitizer::getInstance();
85
    $content = $myts->undoHtmlSpecialChars($myts->displayTbox($content));
0 ignored issues
show
The method displayTbox() does not exist on MyTextSanitizer. Did you maybe mean displayTarea()? ( Ignorable by Annotation )

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

85
    $content = $myts->undoHtmlSpecialChars($myts->/** @scrutinizer ignore-call */ displayTbox($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...
86
    if (isset($xoTheme) && is_object($xoTheme)) {
87
        $xoTheme->addMeta('meta', 'keywords', strip_tags($content));
88
    } else {    // Compatibility for old Xoops versions
89
        $xoopsTpl->assign('xoops_meta_keywords', strip_tags($content));
90
    }
91
}
92
93
/**
94
 * @param $content
95
 */
96
function xhttperror_meta_description($content)
97
{
98
    global $xoopsTpl, $xoTheme;
99
    $myts    = \MyTextSanitizer::getInstance();
100
    $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
101
    if (isset($xoTheme) && is_object($xoTheme)) {
102
        $xoTheme->addMeta('meta', 'description', strip_tags($content));
103
    } else {    // Compatibility for old Xoops versions
104
        $xoopsTpl->assign('xoops_meta_description', strip_tags($content));
105
    }
106
}
107