Issues (273)

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.

admin/index.php (2 issues)

1
<?php
2
3
use Xmf\Module\Admin;
4
use XoopsModules\Wflinks\{Common,
5
    Helper,
6
    Utility
7
};
8
9
/** @var Admin $adminObject */
10
/** @var Helper $helper */
11
/** @var Utility $utility */
12
13
require_once __DIR__ . '/admin_header.php';
14
// Display Admin header
15
xoops_cp_header();
16
17
$adminObject = Admin::getInstance();
18
19
global $xoopsDB;
20
21
$start     = \Xmf\Request::getInt('start', 0);
22
$start1    = \Xmf\Request::getInt('start1', 0);
23
$start2    = \Xmf\Request::getInt('start2', 0);
24
$start3    = \Xmf\Request::getInt('start3', 0);
25
$start4    = \Xmf\Request::getInt('start4', 0);
26
$totalcats = Utility::getTotalCategory();
27
28
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('wflinks_broken'));
29
list($totalbrokenlinks) = $xoopsDB->fetchRow($result);
30
$result2 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('wflinks_mod'));
31
list($totalmodrequests) = $xoopsDB->fetchRow($result2);
32
$result3 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published = 0');
33
list($totalnewlinks) = $xoopsDB->fetchRow($result3);
34
$result4 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE published > 0');
35
list($totallinks) = $xoopsDB->fetchRow($result4);
36
37
//$xxx='<a href="brokenvideo.php">' . _AM_XTUBE_SBROKENSUBMIT . '</a><b>';
38
39
$adminObject->addInfoBox(_AM_WFL_MINDEX_LINKSUMMARY);
40
if ($totalcats > 0) {
41
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="category.php">' . _AM_WFL_SCATEGORY . '</a><b>' . '</infolabel>', $totalcats), '', 'Green');
42
} else {
43
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_WFL_SCATEGORY . '</infolabel>', $totalcats), '', 'Green');
44
}
45
46
if ($totallinks > 0) {
47
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_WFL_SFILES . '</a><b>' . '</infolabel>', $totallinks), '', 'Green');
48
} else {
49
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_WFL_SFILES . '</infolabel>', $totallinks), '', 'Green');
50
}
51
52
if ($totalnewlinks > 0) {
53
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="newlinks.php">' . _AM_WFL_SNEWFILESVAL . '</a><b>' . '</infolabel>', $totalnewlinks), '', 'Red');
54
} else {
55
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_WFL_SNEWFILESVAL . '</infolabel>', $totalnewlinks), '', 'Red');
56
}
57
if ($totalmodrequests > 0) {
58
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="modifications.php">' . _AM_WFL_SMODREQUEST . '</a><b>' . '</infolabel>', $totalmodrequests), '', 'Red');
59
} else {
60
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_WFL_SMODREQUEST . '</infolabel>', $totalmodrequests), '', 'Red');
61
}
62
63
if ($totalbrokenlinks > 0) {
64
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="brokenlink.php">' . _AM_WFL_SBROKENSUBMIT . '</a><b>' . '</infolabel><infotext>', $totalbrokenlinks . '</infotext>'), '', 'Red');
65
} else {
66
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_WFL_SBROKENSUBMIT . '</infolabel><infotext>', $totalbrokenlinks . '</infotext>'), '', 'Red');
67
}
68
69
//check or upload folders
70
$configurator = new Common\Configurator();
71
foreach (array_keys($configurator->uploadFolders) as $i) {
72
    $utility::createFolder($configurator->uploadFolders[$i]);
73
    $adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder');
74
}
75
76
$adminObject->displayNavigation(basename(__FILE__));
77
//------------- Test Data ----------------------------
78
79
if ($helper->getConfig('displaySampleButton')) {
80
    $yamlFile            = dirname(__DIR__) . '/config/admin.yml';
81
    $config              = loadAdminConfig($yamlFile);
82
    $displaySampleButton = $config['displaySampleButton'];
83
84
    if (1 == $displaySampleButton) {
85
        xoops_loadLanguage('admin/modulesadmin', 'system');
86
        require_once dirname(__DIR__) . '/testdata/index.php';
87
        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add');
88
        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add');
89
        //    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add');
90
        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
91
    } else {
92
        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
93
        $displaySampleButton = $config['displaySampleButton'];
94
    }
95
    $adminObject->displayButton('left', '');
96
}
97
98
//------------- End Test Data ----------------------------
99
100
$adminObject->displayIndex();
101
102
/**
103
 * @param $yamlFile
104
 * @return array|bool
105
 */
106
function loadAdminConfig($yamlFile)
107
{
108
    $config = \Xmf\Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
109
    return $config;
110
}
111
112
/**
113
 * @param $yamlFile
114
 */
115
function hideButtons($yamlFile)
116
{
117
    $app['displaySampleButton'] = 0;
0 ignored issues
show
Comprehensibility Best Practice introduced by
$app was never initialized. Although not strictly required by PHP, it is generally a good practice to add $app = array(); before regardless.
Loading history...
118
    \Xmf\Yaml::save($app, $yamlFile);
119
    redirect_header('index.php', 0, '');
120
}
121
122
/**
123
 * @param $yamlFile
124
 */
125
function showButtons($yamlFile)
126
{
127
    $app['displaySampleButton'] = 1;
0 ignored issues
show
Comprehensibility Best Practice introduced by
$app was never initialized. Although not strictly required by PHP, it is generally a good practice to add $app = array(); before regardless.
Loading history...
128
    \Xmf\Yaml::save($app, $yamlFile);
129
    redirect_header('index.php', 0, '');
130
}
131
132
$op = \Xmf\Request::getString('op', 0, 'GET');
133
134
switch ($op) {
135
    case 'hide_buttons':
136
        hideButtons($yamlFile);
137
        break;
138
    case 'show_buttons':
139
        showButtons($yamlFile);
140
        break;
141
}
142
143
echo $utility::getServerStats();
144
145
require __DIR__ . '/admin_footer.php';
146