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.

src/common/include/URL.class.php (1 issue)

Severity

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
 *
5
 * This file is a part of Codendi.
6
 *
7
 * Codendi is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * Codendi is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
class URL {
22
23
    /**
24
    * @see http://www.ietf.org/rfc/rfc2396.txt Annex B
25
    */
26
    /* static */ function parse($url) {
27
        $components = array();
28
        preg_match('`^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?`i',$url, $components);
29
        return $components;
30
    }
31
    /* static */ function getHost($url) {
32
        $components = URL::parse($url);
33
        return $components[4];
34
    }
35
36
    static function getScheme($url) {
37
        $components = URL::parse($url);
38
        return $components[2];
39
    }
40
    /**
41
     *
42
     * Retreives the project name from svn request uri
43
     * @param String $uri
44
     * 
45
     * @return String
46
     */
47
    function getGroupNameFromSVNUrl($uri) {
48
        $pieces = explode('&', $uri);
49
        foreach($pieces as $piece) {
50
            if(strpos($piece, 'root=') !== false) {
51
                $parts = $piece;
52
                break;
53
            }
54
        }
55
        if (!isset($parts)) {
56
            return false;
57
        }
58
        $group = explode('=', $parts);
59
        return $group[1];
60
    }
61
62
    /**
63
     * Wrapper for Rule_ProjectName
64
     */
65
    function getProjectNameRule() {
66
        return new Rule_ProjectName();
67
    }
68
69
    function getGroupIdFromUrl($url) {
70
        $req_uri='/'.trim($url, "/");
71
        // /projects/ and /viewvc/
72
        if ((strpos($req_uri,'/projects/') === 0) || (strpos($req_uri,'/viewvc.php/') !== false)) {
73
            if (strpos($req_uri,'/viewvc.php/') !== false) {
74
                $this_proj_name = $this->getGroupNameFromSVNUrl($req_uri);
75
            } else if (strpos($req_uri,'/projects/') !== false) {
76
                $pieces = explode("/", $url);
77
                $this_proj_name=$pieces[2];
78
            }
79
            //Project short name validation
80
            $rule = $this->getProjectNameRule();
81
            if ($rule->containsIllegalChars($this_proj_name)) {
82
                return false;
83
            }
84
            $dao = $this->getProjectDao();
85
            $dao_results=$dao->searchByUnixGroupName($this_proj_name);
86
            if ($dao_results->rowCount() < 1) {# project does not exist
87
                return false;
88
            }
89
            $group_id=$dao_results->getRow();
90
            $group_id=$group_id['group_id'];
91
        }
92
        // Forum and news. Each published news is a special forum of project 'news'
93
        if (strpos($req_uri,'/forum/') === 0) {
94
            if (array_key_exists('forum_id', $_REQUEST) && $_REQUEST['forum_id']) {
95
                // Get corresponding project
96
                $dao = $this->getForumDao();
97
                $result = $dao->searchByGroupForumId($_REQUEST['forum_id']);
98
                $group_id=$result->getRow();
99
                $group_id=$group_id['group_id'];
100
101
                // News
102
                if ($group_id==$GLOBALS['sys_news_group']) {
103
                    // Otherwise, get group_id of corresponding news
104
                    $dao = $this->getNewsBytesDao();
105
                    $result = $dao->searchByForumId($_REQUEST['forum_id']);
106
                    $group_id = $result->getRow();
107
                    $group_id = $group_id['group_id'];
108
                     
109
                }
110
            }
111
        }
112
        // File downloads. It might be a good idea to restrict access to shownotes.php too...
113
        if (strpos($req_uri,'/file/download.php') === 0) {
114
            list(,$group_id, $file_id) = explode('/', $GLOBALS['PATH_INFO']);
0 ignored issues
show
The assignment to $file_id is unused. Consider omitting it like so list($first,,$third).

This checks looks for assignemnts to variables using the list(...) function, where not all assigned variables are subsequently used.

Consider the following code example.

<?php

function returnThreeValues() {
    return array('a', 'b', 'c');
}

list($a, $b, $c) = returnThreeValues();

print $a . " - " . $c;

Only the variables $a and $c are used. There was no need to assign $b.

Instead, the list call could have been.

list($a,, $c) = returnThreeValues();
Loading history...
115
        }
116
117
        // Artifact attachment download...
118
        if (strpos($req_uri,'/tracker/download.php') === 0) {
119
            if (isset($_REQUEST['artifact_id'])) {
120
                $dao = $this->getArtifactDao();
121
                $result = $dao->searchArtifactId($_REQUEST['artifact_id']);
122
                $group_id=$result->getRow();
123
                $group_id=$group_id['group_id'];
124
            }
125
        }
126
127
        EventManager::instance()->processEvent(
128
            Event::GET_PROJECTID_FROM_URL,
129
            array(
130
                'url'         => $req_uri,
131
                'project_id'  => &$group_id,
132
                'project_dao' => $this->getProjectDao(),
133
                'request'     => new Codendi_Request($_REQUEST)
134
            )
135
        );
136
137
        if ($group_id) {
138
            return $group_id;
139
        } elseif (isset($_REQUEST['group_id'])) {
140
            return $_REQUEST['group_id'];
141
        }
142
143
        return null;
144
    }
145
146
    function getProjectDao() {
147
        return new ProjectDao(CodendiDataAccess::instance());
148
    }
149
    
150
    function getForumDao() {
151
        return new ForumDao(CodendiDataAccess::instance());
152
    }
153
    
154
    function getNewsBytesDao() {
155
        return new NewsBytesDao(CodendiDataAccess::instance());
156
    }
157
    
158
     function getArtifactDao() {
159
        return new ArtifactDao(CodendiDataAccess::instance());
160
    }
161
}
162
?>
163