Issues (195)

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.

Alpha/Model/ArticleComment.php (1 issue)

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
namespace Alpha\Model;
4
5
use Alpha\Model\Type\Relation;
6
use Alpha\Model\Type\Text;
7
use Alpha\Util\Logging\Logger;
8
9
/**
10
 * An article comment class for user comments.
11
 *
12
 * @since 1.0
13
 *
14
 * @author John Collins <[email protected]>
15
 * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
16
 * @copyright Copyright (c) 2018, John Collins (founder of Alpha Framework).
17
 * All rights reserved.
18
 *
19
 * <pre>
20
 * Redistribution and use in source and binary forms, with or
21
 * without modification, are permitted provided that the
22
 * following conditions are met:
23
 *
24
 * * Redistributions of source code must retain the above
25
 *   copyright notice, this list of conditions and the
26
 *   following disclaimer.
27
 * * Redistributions in binary form must reproduce the above
28
 *   copyright notice, this list of conditions and the
29
 *   following disclaimer in the documentation and/or other
30
 *   materials provided with the distribution.
31
 * * Neither the name of the Alpha Framework nor the names
32
 *   of its contributors may be used to endorse or promote
33
 *   products derived from this software without specific
34
 *   prior written permission.
35
 *
36
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
37
 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
38
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
39
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
41
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
46
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
47
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
 * </pre>
50
 */
51
class ArticleComment extends ActiveRecord
52
{
53
    /**
54
     * The article this comment belongs to.
55
     *
56
     * @var \Alpha\Model\Type\Relation
57
     *
58
     * @since 1.0
59
     */
60
    protected $articleID;
61
62
    /**
63
     * The content of the comment posted by the user.
64
     *
65
     * @var \Alpha\Model\Type\Text
66
     *
67
     * @since 1.0
68
     */
69
    protected $content;
70
71
    /**
72
     * An array of data display labels for the class properties.
73
     *
74
     * @var array
75
     *
76
     * @since 1.0
77
     */
78
    protected $dataLabels = array('ID' => 'Article Comment ID#', 'articleID' => 'Article', 'content' => 'Comment');
79
80
    /**
81
     * The name of the database table for the class.
82
     *
83
     * @var string
84
     *
85
     * @since 1.0
86
     */
87
    const TABLE_NAME = 'ArticleComment';
88
89
    /**
90
     * Trace logger.
91
     *
92
     * @var \Alpha\Util\Logging\Logger
93
     *
94
     * @since 1.1
95
     */
96
    private static $logger = null;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
97
98
    /**
99
     * constructor for the class.
100
     *
101
     * @since 1.0
102
     */
103
    public function __construct()
104
    {
105
        self::$logger = new Logger('ArticleComment');
106
107
        // ensure to call the parent constructor
108
        parent::__construct();
109
110
        $this->articleID = new Relation();
111
        $this->articleID->setRelatedClass('Alpha\Model\Article');
112
        $this->articleID->setRelatedClassField('ID');
113
        $this->articleID->setRelatedClassDisplayField('description');
114
        $this->articleID->setRelationType('MANY-TO-ONE');
115
116
        $this->content = new Text();
117
        $this->content->setAllowHTML(false);
118
    }
119
}
120