Issues (205)

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/lib/mysql.php (3 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
 * The MIT License (MIT)
4
 *
5
 * Copyright (c) 2016 Robert Sardinia
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
 * of this software and associated documentation files (the "Software"), to deal
9
 * in the Software without restriction, including without limitation the rights
10
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
 * copies of the Software, and to permit persons to whom the Software is
12
 * furnished to do so, subject to the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be included in all
15
 * copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
 * SOFTWARE.
24
 */
25
26
/**
27
 * @param $url
28
 * @param $user
29
 * @param $pass
30
 * @param $dbName
31
 * @param $userID
32
 * @param $characterID
33
 * @param $eveName
34
 * @param $type
35
 * @return null
36
 */
37
38
39 View Code Duplication
function insertUser($url, $user, $pass, $dbName, $userID, $characterID, $eveName, $type)
0 ignored issues
show
This function 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...
40
{
41
    $host = $url;
42
    $username = $user;
43
    $password = $pass;
44
    $database = $dbName;
45
    $mysqli = mysqli_connect($host, $username, $password, $database);
46
47
    if ($stmt = $mysqli->prepare("REPLACE into authUsers (characterID, discordID, eveName, active, role) values(?,?,?,'yes',?)")) {
48
49
        // Bind the variables to the parameter as strings.
50
        $stmt->bind_param('ssss', $characterID, $userID, $eveName, $type);
51
52
        // Execute the statement.
53
        $stmt->execute();
54
55
        // Close the prepared statement.
56
        $stmt->close();
57
        return null;
58
    }
59
    return null;
60
}
61
62
/**
63
 * @param $url
64
 * @param $user
65
 * @param $pass
66
 * @param $dbName
67
 * @param $authCode
68
 * @return null
69
 */
70 View Code Duplication
function disableReg($url, $user, $pass, $dbName, $authCode)
0 ignored issues
show
This function 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...
71
{
72
    $host = $url;
73
    $username = $user;
74
    $password = $pass;
75
    $database = $dbName;
76
    $mysqli = mysqli_connect($host, $username, $password, $database);
77
78
    if ($stmt = $mysqli->prepare("UPDATE pendingUsers SET active='0' WHERE authString= ?")) {
79
80
        // Bind the variables to the parameter as strings.
81
        $stmt->bind_param('s', $authCode);
82
83
        // Execute the statement.
84
        $stmt->execute();
85
86
        // Close the prepared statement.
87
        $stmt->close();
88
        return null;
89
    }
90
    return null;
91
}
92
93
/**
94
 * @param $url
95
 * @param $user
96
 * @param $pass
97
 * @param $dbName
98
 * @param $authCode
99
 * @return bool|null
100
 */
101 View Code Duplication
function selectPending($url, $user, $pass, $dbName, $authCode)
0 ignored issues
show
This function 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...
102
{
103
    $host = $url;
104
    $username = $user;
105
    $password = $pass;
106
    $database = $dbName;
107
    $mysqli = mysqli_connect($host, $username, $password, $database);
108
109
    if ($stmt = $mysqli->prepare("SELECT * FROM pendingUsers WHERE authString= ? AND active='1'")) {
110
111
        // Bind the variables to the parameter as strings.
112
        $stmt->bind_param('s', $authCode);
113
114
        // Execute the statement.
115
        $stmt->execute();
116
117
        // Return Row
118
        $result = $stmt->get_result();
119
120
        // Close the prepared statement.
121
        $stmt->close();
122
        return $result;
123
    }
124
    return null;
125
}