Issues (194)

Security Analysis    no request data  

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.

src/SQLParser/Node/ColRef.php (2 issues)

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
/**
4
 * expression-types.php.
5
 *
6
 *
7
 * Copyright (c) 2010-2013, Justin Swanhart
8
 * with contributions by André Rothe <[email protected], [email protected]>
9
 * and David Négrier <[email protected]>
10
 *
11
 * All rights reserved.
12
 *
13
 * Redistribution and use in source and binary forms, with or without modification,
14
 * are permitted provided that the following conditions are met:
15
 *
16
 *   * Redistributions of source code must retain the above copyright notice,
17
 *     this list of conditions and the following disclaimer.
18
 *   * Redistributions in binary form must reproduce the above copyright notice,
19
 *     this list of conditions and the following disclaimer in the documentation
20
 *     and/or other materials provided with the distribution.
21
 *
22
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25
 * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31
 * DAMAGE.
32
 */
33
namespace SQLParser\Node;
34
35
use Doctrine\DBAL\Connection;
36
use Mouf\MoufManager;
37
use SQLParser\Node\Traverser\VisitorInterface;
38
39
/**
40
 * This class represents an column in an SQL expression.
41
 *
42
 * @author David Négrier <[email protected]>
43
 */
44
class ColRef implements NodeInterface
45
{
46
    private $table;
47
48
    /**
49
     * Returns the table name.
50
     *
51
     * @return string
52
     */
53
    public function getTable()
54
    {
55
        return $this->table;
56
    }
57
58
    /**
59
     * Sets the table name.
60
     *
61
     * @Important
62
     *
63
     * @param string $table
64
     */
65
    public function setTable($table)
66
    {
67
        $this->table = $table;
68
    }
69
70
    private $column;
71
72
    /**
73
     * Returns the column name.
74
     *
75
     * @return string
76
     */
77
    public function getColumn()
78
    {
79
        return $this->column;
80
    }
81
82
    /**
83
     * Sets the column name.
84
     *
85
     * @Important
86
     *
87
     * @param string $column
88
     */
89
    public function setColumn($column)
90
    {
91
        $this->column = $column;
92
    }
93
94
    private $alias;
95
96
    /**
97
     * Returns the alias.
98
     *
99
     * @return string
100
     */
101
    public function getAlias()
102
    {
103
        return $this->alias;
104
    }
105
106
    /**
107
     * Sets the alias.
108
     *
109
     * @Important
110
     *
111
     * @param string $alias
112
     */
113
    public function setAlias($alias)
114
    {
115
        $this->alias = $alias;
116
    }
117
118
    private $direction;
119
120
    /**
121
     * Returns the direction.
122
     *
123
     * @return string
124
     */
125
    public function getDirection()
126
    {
127
        return $this->direction;
128
    }
129
130
    /**
131
     * Sets the direction.
132
     *
133
     * @Important
134
     *
135
     * @param string $direction
136
     */
137
    public function setDirection($direction)
138
    {
139
        $this->direction = $direction;
140
    }
141
142
    /**
143
     * Returns a Mouf instance descriptor describing this object.
144
     *
145
     * @param MoufManager $moufManager
146
     *
147
     * @return MoufInstanceDescriptor
148
     */
149 View Code Duplication
    public function toInstanceDescriptor(MoufManager $moufManager)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
150
    {
151
        $instanceDescriptor = $moufManager->createInstance(get_called_class());
152
        $instanceDescriptor->getProperty('table')->setValue($this->table);
153
        $instanceDescriptor->getProperty('column')->setValue($this->column);
154
        $instanceDescriptor->getProperty('alias')->setValue($this->alias);
155
        $instanceDescriptor->getProperty('direction')->setValue($this->direction);
156
157
        return $instanceDescriptor;
158
    }
159
160
    /**
161
     * Renders the object as a SQL string.
162
     *
163
     * @param Connection $dbConnection
164
     * @param array      $parameters
165
     * @param number     $indent
166
     * @param int        $conditionsMode
167
     *
168
     * @return string
169
     */
170
    public function toSql(array $parameters = array(), Connection $dbConnection = null, $indent = 0, $conditionsMode = self::CONDITION_APPLY)
171
    {
172
        $sql = '';
173
        if ($this->table) {
174
            $sql .= NodeFactory::escapeDBItem($this->table, $dbConnection).'.';
175
        }
176
        if ($this->column != '*') {
177
            $sql .= NodeFactory::escapeDBItem($this->column, $dbConnection);
178
        } else {
179
            $sql .= '*';
180
        }
181
        if ($this->alias) {
182
            $sql .= ' AS '.$this->alias;
183
        }
184
        if ($this->direction) {
185
            $sql .= ' '.$this->direction;
186
        }
187
188
        return $sql;
189
    }
190
191
    /**
192
     * Walks the tree of nodes, calling the visitor passed in parameter.
193
     *
194
     * @param VisitorInterface $visitor
195
     */
196 View Code Duplication
    public function walk(VisitorInterface $visitor)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
197
    {
198
        $node = $this;
199
        $result = $visitor->enterNode($node);
200
        if ($result instanceof NodeInterface) {
201
            $node = $result;
202
        }
203
204
        return $visitor->leaveNode($node);
205
    }
206
}
207