Issues (278)

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/ratefile.inc.php (1 issue)

Severity
1
<?php
2
/**
3
 * Module: Soapbox
4
 * Version: v 1.5
5
 * Release Date: 23 August 2004
6
 * Author: hsalazar
7
 * Licence: GNU
8
 */
9
10
use Xmf\Request;
11
12
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
13
//if (!isset($_POST['submit'])) {
14
//    exit;
15
//}
16
//if (!isset($_POST['lid'])) {
17
//    exit;
18
//}
19
20
if (!Request::hasVar('submit', 'POST') || !Request::hasVar('lid', 'POST')) {
21
    exit;
22
}
23
24
if (Request::hasVar('submit', 'POST')) { //($_POST['submit']) {
25
    //-------------------------
26
    //    if (!$GLOBALS['xoopsSecurity']->check()) {
27
    if (!$GLOBALS['xoopsSecurity']->check()) {
28
        redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors());
29
    }
30
    //-------------------------
31
    $ratinguser = is_object($xoopsUser) ? $xoopsUser->uid() : 0;
32
    if (function_exists('floatval')) {
33
        $rating = $_POST['rating'] ? (float)$_POST['rating'] : 0;
34
    } else {
35
        $rating = $_POST['rating'] ? \Xmf\Request::getInt('rating', 0, 'POST') : 0;
36
    }
37
    $lid = $_POST['lid'] ? \Xmf\Request::getInt('lid', 0, 'POST') : 0;
38
39
    // Make sure only 1 anonymous from an IP in a single day.
40
    $anonwaitdays = 1;
41
    $ip           = getenv('REMOTE_ADDR');
42
    // Check if Rating is Null
43
    if (empty($rating) || empty($lid)) {
44
        redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_NORATING);
45
    }
46
47
    //module entry data handler
48
    /** @var \XoopsModules\Soapbox\EntrydataHandler $entrydataHandler */
49
    $entrydataHandler = new \XoopsModules\Soapbox\EntrydataHandler();
50
    //get entry object
51
    $_entryob = $entrydataHandler->getArticleOnePermcheck($lid, true);
52
    if (!is_object($_entryob)) {
53
        redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php', 1, _MD_SOAPBOX_CANTVOTEOWN);
54
    }
55
    // Check if Download POSTER is voting (UNLESS Anonymous users allowed to post)
56
    if (0 !== $ratinguser) {
57
        //get category object
58
        $_categoryob = $_entryob->_sbcolumns;
59
        if (!is_object($_categoryob)) {
0 ignored issues
show
The condition is_object($_categoryob) is always false.
Loading history...
60
            redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php', 1, 'no column');
61
        }
62
        if ($_categoryob->getVar('author') === $ratinguser) {
63
            redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_CANTVOTEOWN);
64
        }
65
66
        //uid check
67
        //uid check
68
        $criteria = new \CriteriaCompo();
69
        $criteria->add(new \Criteria('lid', $lid));
70
        $criteria->add(new \Criteria('ratinguser', $ratinguser));
71
        $ratinguservotecount = $entrydataHandler->getVotedataCount($criteria);
72
        unset($criteria);
73
        if ($ratinguservotecount > 0) {
74
            redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_VOTEONCE);
75
        }
76
    }
77
78
    // Check if ANONYMOUS user is trying to vote more than once per day.
79
    if (0 === $ratinguser) {
80
        $yesterday = (time() - (86400 * $anonwaitdays));
81
        //uid check
82
        $criteria = new \CriteriaCompo();
83
        $criteria->add(new \Criteria('lid', $lid));
84
        $criteria->add(new \Criteria('ratinguser', 0));
85
        $criteria->add(new \Criteria('ratinghostname', $ip));
86
        $criteria->add(new \Criteria('ratingtimestamp', $yesterday, '>'));
87
        $anonvotecount = $entrydataHandler->getVotedataCount($criteria);
88
        unset($criteria);
89
        if ($anonvotecount > 0) {
90
            redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_VOTEONCE);
91
        }
92
    }
93
94
    $_votedataob = $entrydataHandler->createVotedata(true);
95
    //    $_votedataob->cleanVars();
96
    $_votedataob->setVar('lid', $lid);
97
    $_votedataob->setVar('ratinguser', $ratinguser);
98
    $_votedataob->setVar('rating', $rating);
99
    $_votedataob->setVar('ratinghostname', $ip);
100
    $_votedataob->setVar('ratingtimestamp', time());
101
    // Save to database
102
    if (!$entrydataHandler->insertVotedata($_votedataob, true)) {
103
        redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_CANTVOTEOWN);
104
    }
105
106
    // All is well.  Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
107
    //    updaterating( $lid );
108
    if (!$entrydataHandler->updateRating($_entryob)) {
109
        redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_UNKNOWNERROR);
110
    } else {
111
        $ratemessage = _MD_SOAPBOX_VOTEAPPRE . '<br>' . sprintf(_MD_SOAPBOX_THANKYOU, $myts->htmlSpecialChars($xoopsConfig['sitename']));
112
        redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, $ratemessage);
113
    }
114
    //    exit();
115
} else {
116
    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?articleID=' . $lid, 1, _MD_SOAPBOX_UNKNOWNERROR);
117
    //    exit();
118
}
119