GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4873)

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.

hudson/include/PluginHudsonJobDao.class.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
 * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
4
 * Copyright (c) Enalean, 2015. All Rights Reserved.
5
 *
6
 * This file is a part of Tuleap.
7
 *
8
 * Tuleap is free software; you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation; either version 2 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * Tuleap is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
/**
23
 *  Data Access Object for PluginHudsonJob 
24
 */
25
class PluginHudsonJobDao extends DataAccessObject {
26
27
    /**
28
    * Gets all jobs in the db
29
    * @return DataAccessResult
30
    */
31
    function searchAll() {
32
        $sql = "SELECT * FROM plugin_hudson_job";
33
        return $this->retrieve($sql);
34
    }
35
    
36
    /**
37
    * Searches PluginHudsonJob by Codendi group ID 
38
    * @return DataAccessResult
39
    */
40
    function searchByGroupID($group_id) {
41
        $sql = sprintf("SELECT *  
42
                        FROM plugin_hudson_job
43
                        WHERE group_id = %s",
44
            $this->da->quoteSmart($group_id));
45
        return $this->retrieve($sql);
46
    }
47
48
    /**
49
    * Searches PluginHudsonJob by job ID 
50
    * @return DataAccessResult
51
    */
52
    function searchByJobID($job_id) {
53
        $sql = sprintf("SELECT *  
54
                        FROM plugin_hudson_job
55
                        WHERE job_id = %s",
56
            $this->da->quoteSmart($job_id));
57
        return $this->retrieve($sql);
58
    }
59
    
60
    /**
61
    * Searches PluginHudsonJob by job name 
62
    * @return DataAccessResult
63
    */
64
    function searchByJobName($job_name) {
65
        $sql = sprintf("SELECT *  
66
                        FROM plugin_hudson_job
67
                        WHERE name = %s",
68
            $this->da->quoteSmart($job_name));
69
        return $this->retrieve($sql);
70
    }
71
    
72
    /**
73
    * Searches PluginHudsonJob by user ID
74
    * means "all the jobs of all projects the user is member of" 
75
    * @return DataAccessResult
76
    */
77
    function searchByUserID($user_id) {
78
        $sql = sprintf("SELECT j.*  
79
                        FROM plugin_hudson_job j, user u, user_group ug
80
                        WHERE ug.group_id = j.group_id AND
81
                              u.user_id = ug.user_id AND 
82
                              u.user_id = %s",
83
            $this->da->quoteSmart($user_id));
84
        return $this->retrieve($sql);
85
    }
86
    
87
    /**
88
    * create a row in the table plugin_hudson_job 
89
    * @return inserted job id if there is no error
90
    */
91
    public function createHudsonJob(
92
            $project_id,
93
            $hudson_job_url,
94
            $job_name,
95
            $use_svn_trigger = false,
96
            $use_cvs_trigger = false,
97
            $token = null,
98
            $svn_paths
99
    ) {
100
        $project_id      = $this->da->quoteSmart($project_id);
101
        $hudson_job_url  = $this->da->quoteSmart($hudson_job_url);
102
        $job_name        = $this->da->quoteSmart($job_name);
103
        $use_svn_trigger = $this->da->escapeInt($use_svn_trigger);
104
        $use_cvs_trigger = $this->da->escapeInt($use_cvs_trigger);
105
        $token           = ($token !== null)? $this->da->quoteSmart($token) : $this->da->quoteSmart('');
106
        $svn_paths       = $this->da->quoteSmart($svn_paths);
107
108
        $sql = "INSERT INTO plugin_hudson_job (group_id, job_url, name, use_svn_trigger, use_cvs_trigger, token, svn_paths)
109
                VALUES ($project_id, $hudson_job_url, $job_name, $use_svn_trigger, $use_cvs_trigger, $token, $svn_paths)";
110
111
        return $this->updateAndGetLastId($sql);
112
    }
113
    
114
    public function updateHudsonJob(
115
        $job_id,
116
        $hudson_job_url,
117
        $job_name,
118
        $use_svn_trigger = false,
119
        $use_cvs_trigger = false,
120
        $token = null,
121
        $svn_paths
122
    ) {
123
        $job_id          = $this->da->quoteSmart($job_id);
124
        $hudson_job_url  = $this->da->quoteSmart($hudson_job_url);
125
        $job_name        = $this->da->quoteSmart($job_name);
126
        $use_svn_trigger = $this->da->escapeInt($use_svn_trigger);
127
        $use_cvs_trigger = $this->da->escapeInt($use_cvs_trigger);
128
        $token           = ($token !== null)? $this->da->quoteSmart($token) : $this->da->quoteSmart('');
129
        $svn_paths       = $this->da->quoteSmart($svn_paths);
130
131
        $sql = "UPDATE plugin_hudson_job
132
                SET job_url = $hudson_job_url,
133
                name = $job_name,
134
                use_svn_trigger = $use_svn_trigger,
135
                use_cvs_trigger = $use_cvs_trigger,
136
                token = $token,
137
                svn_paths = $svn_paths
138
                WHERE job_id = $job_id";
139
140
        return $this->update($sql);
141
    }
142
143
    function deleteHudsonJob($job_id) {
144
        $sql = sprintf("DELETE FROM plugin_hudson_job WHERE job_id = %s",
145
                $this->da->quoteSmart($job_id));
146
        $updated = $this->update($sql);
147
        return $updated;
148
    }
149
    
150
    function deleteHudsonJobsByGroupID($group_id) {
151
        $sql = sprintf("DELETE FROM plugin_hudson_job WHERE group_id = %s",
152
                $this->da->quoteSmart($group_id));
153
        $updated = $this->update($sql);
154
        return $updated;
155
    }
156
157
    /**
158
    * Get jobs number
159
    *
160
    * @param Integer $groupId Id of the project
161
    *
162
    * @return DataAccessResult
163
    */
164
    function countJobs($groupId = null) {
165
        $condition = '';
166
        if ($groupId) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $groupId of type integer|null is loosely compared to true; this is ambiguous if the integer can be zero. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For integer values, zero is a special case, in particular the following results might be unexpected:

0   == false // true
0   == null  // true
123 == false // false
123 == null  // false

// It is often better to use strict comparison
0 === false // false
0 === null  // false
Loading history...
167
            $condition = "AND group_id = ".$this->da->escapeInt($groupId);
168
        }
169
        $sql = "SELECT COUNT(*) AS count
170
                FROM plugin_hudson_job
171
                JOIN groups USING (group_id)
172
                WHERE status = 'A'
173
                  ".$condition;
174
        return $this->retrieve($sql);
175
    }
176
}