Issues (501)

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.

views/life/notes.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
$db_link = serverConnect();
3
4
require_once("config/carNames.php");
5
6
if (isset($_GET["page"])) {
7
    $page = $_GET["page"];
8
} else {
9
    $page = 1;
10
}
11
12
$max = 'LIMIT ' . ($page - 1) * $_SESSION['items'] . ',' . $_SESSION['items'];
13
14
if (isset($search)) {
15
    logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['vehicles'], 1);
16
    $sql = "SELECT $playerIdColumn FROM `players` WHERE `name` LIKE '%$search%' ";
17
    $result_of_query = $db_link->query($sql);
18
    if ($result_of_query->num_rows > 0) {
19
        while ($row = mysqli_fetch_row($result_of_query)) {
20
            $samepID[] = $row;
21
        }
22
        $samepID = array_reduce($samepID, 'array_merge', array());
23
        $sql = "SELECT * FROM `vehicles` WHERE `pid` LIKE '$search' OR `classname` LIKE '%$search%' OR `pid` IN (" . implode(',', $samepID) . ") OR `plate` LIKE '$search' OR `inventory` LIKE '%$search%';";
24
        $result_of_query = $db_link->query($sql);
25
        $total_records = mysqli_num_rows($result_of_query);
26
        $sql = "SELECT * FROM `vehicles` WHERE `pid` LIKE '$search' OR `classname` LIKE '%$search%' OR `pid` IN (" . implode(',', $samepID) . ") OR `plate` LIKE '$search' OR `inventory` LIKE '%$search %' $max;";
27
    } else {
28
        $sql = "SELECT * FROM `vehicles` WHERE `pid` LIKE '$search' OR `classname` LIKE '%$search%' OR `plate` LIKE '$search' OR `inventory` LIKE '%$search%';";
29
        $result_of_query = $db_link->query($sql);
30
        $total_records = mysqli_num_rows($result_of_query);
31
        $sql = "SELECT * FROM `vehicles` WHERE `pid` LIKE '$search' OR `classname` LIKE '%$search%' OR `plate` LIKE '$search' OR `inventory` LIKE '%$search%' $max;";
32
    }
33
} else {
34
        $sql = "SELECT * FROM `vehicles` $max;";
35
}
36
$result_of_query = $db_link->query($sql);
37
?>
38
<!-- Page Heading -->
39
<div class="row">
40
    <div class="col-lg-12">
41
        <h1 class="page-header">
42
            <?php echo $lang['vehicles']; ?>
43
            <small><?php echo " " . $lang['overview']; ?></small>
44
        </h1>
45
    </div>
46
</div>
47
<!-- /.row -->
48
49
<div class="col-md-12">
50
    <div class="content-panel">
51
        <h4>
52
            <i class="fa fa-car"></i>
53
            <?php echo " " . $lang['vehicles']; ?>
54
            <div class="col-md-2 pull-right">
55
                <form style="float:right;" name='rows' method="post" action="<?php echo $settings['url'] ?>vehicles">
56
                    <select id='items' name='items'>
57
                        <?php echo $_SESSION['items']; ?>
58
                        <option value="5" <?php if ('5' == $_SESSION['items']) {
59
    echo 'selected';
60
}
61
?>>5</option>
62
                        <option value="10" <?php if ('10' == $_SESSION['items']) {
63
    echo 'selected';
64
}
65
?>>10</option>
66
                        <option value="15" <?php if ('15' == $_SESSION['items']) {
67
    echo 'selected';
68
}
69
?>>15</option>
70
                        <option value="25" <?php if ('25' == $_SESSION['items']) {
71
    echo 'selected';
72
}
73
?>>25</option>
74
                        <option value="50" <?php if ('50' == $_SESSION['items']) {
75
    echo 'selected';
76
}
77
?>>50</option>
78
                    </select>
79
                    <input class='btn btn-sm btn-primary' name='update' type="submit"
80
                           value="<?php echo $lang['itemsPP'] ?>">
81
                    <script type='text/javascript'>
82
                        function searchpage() {
83
                            sn = document.getElementById('searchText').value;
84
                            redirecturl = '<?php echo $settings['url'] ?>vehicles/' + sn;
85
                            document.location.href = redirecturl;
86
                        }
87
                    </script>
88
                </form>
89
            </div>
90
            <div class="col-md-3 pull-right">
91
                <form style="float:right;" name='search'>
92
                    <input id='searchText' type='text' name='searchText' placeholder="<?php if (isset($search)) echo $search ?>">
93
                    <input class='btn btn-sm btn-primary' type='button' name='search'
94
                           onclick='searchpage();' value='<?php echo $lang['search'] ?>'>
95
                </form>
96
            </div>
97
        </h4>
98
        <hr class="hidden-xs">
99
        <table class="table table-striped table-advance table-hover">
100
            <thead>
101
            <tr>
102
                <th><i class="fa fa-eye"></i> <?php echo $lang['owner']; ?></th>
103
                <th><i class="fa fa-car"></i> <?php echo $lang['class']; ?></th>
104
                <th class="hidden-xs"><i class="fa fa-car"></i> <?php echo $lang['type']; ?></th>
105
                <th class="hidden-xs"><i class="fa fa-car"></i> <?php echo $lang['plate']; ?></th>
106
                <th class="hidden-xs"><i class="fa fa-car"></i> <?php echo $lang['alive']; ?></th>
107
                <th class="hidden-xs"><i class="fa fa-info"></i> <?php echo $lang['active']; ?></th>
108
                <?php if ($_SESSION['user_level'] >= $_SESSION['permission']['edit']['playet']) {
109
    echo '<th><i class="fa fa-pencil"></i><div class="hidden-xs"> ' . $lang['edit'] . '</div></th>';
110
}
111
?>
112
            </tr>
113
            </thead>
114
            <tbody>
115
            <?php
116
            while ($row = mysqli_fetch_assoc($result_of_query)) {
117
                echo "<tr>";
118
                echo "<td>" . nameID($row["pid"]) . "</td>";
0 ignored issues
show
The call to nameID() misses a required argument $db_link.

This check looks for function calls that miss required arguments.

Loading history...
119
                echo "<td>" . carName($row["classname"]) . "</td>";
120
                echo "<td class='hidden-xs'>" . carType($row["type"], $lang) . "</td>";
121
                echo "<td class='hidden-xs'>" . $row["plate"] . "</td>";
122
                echo "<td class='hidden-xs'>" . yesNo($row["alive"], $lang) . "</td>";
123
                echo "<td class='hidden-xs'>" . yesNo($row["active"], $lang) . "</td>";
124
                if ($_SESSION['user_level'] >= P_EDIT_VEHICLES) {
125
                    echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editVeh/" . $row["id"] . "'>";
126
                    echo "<i class='fa fa-pencil'></i></a></td>";
127
                }
128
                echo "</tr>";
129
            }
130
131
            echo "</tbody></table>";
132
133
            if (isset($search)) {
134
                $total_pages = ceil($total_records / $_SESSION['items']);
135
                if ($total_pages > 1) {
136
137
                    echo "<center><a class='btn btn-primary' href='" . $settings['url'] . "vehicles/" . $search . "?page=1'>" . $lang['first'] . "</a> ";
138
                    ?>
139
                    <div class="btn-group">
140
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
141
                            <?php echo $lang['page'] . " " ?><span class="caret"></span>
142
                        </button>
143
144
                        <ul class="dropdown-menu scrollable-menu" role="menu">
145
                            <?php
146
                            for ($i = 1; $i <= $total_pages; $i++) {
147
                                ?>
148
                                <li><?php echo "<a href='" . $settings['url'] . "vehicles/" . $search . "?page=" . $i . "'>" . $i . "</a> "; ?></li>
149
                            <?php }; ?>
150
                        </ul>
151
                    </div>
152
153
                    <?php
154
                    echo "<a class='btn btn-primary' href='" . $settings['url'] . "vehicles/" . $search . "?page=" . $total_pages . "'>" . $lang['last'] . "</a></center>";
155
                }
156
            } else {
157
                $sql = "SELECT `id` FROM `vehicles`;";
158
                $result_of_query = $db_link->query($sql);
159
                $total_records = mysqli_num_rows($result_of_query);
160
                $total_pages = ceil($total_records / $_SESSION['items']);
161
                if ($total_pages > 1) {
162
                    echo "<center><a class='btn btn-primary' href='" . $settings['url'] . "vehicles?page=1'>" . $lang['first'] . "</a> ";
163
                    ?>
164
                    <div class="btn-group">
165
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
166
                            <?php echo $lang['page'] . " " ?><span class="caret"></span>
167
                        </button>
168
169
                        <ul class="dropdown-menu scrollable-menu" role="menu">
170
                            <?php
171
                            for ($i = 1; $i <= $total_pages; $i++) {
172
                                ?>
173
                                <li><?php echo "<a href='" . $settings['url'] . "vehicles?page=" . $i . "'>" . $i . "</a> "; ?></li>
174
                            <?php }; ?>
175
                        </ul>
176
                    </div>
177
178
                    <?php
179
                    echo "<a class='btn btn-primary' href='" . $settings['url'] . "vehicles?page=$total_pages'>" . $lang['last'] . "</a></center>";
180
                }
181
            }
182
            ?>
183
            <br>
184
            </tbody>
185
        </table>
186
    </div>
187
</div>
0 ignored issues
show
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
188