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/frs/ServiceFile.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
/**
22
 * ServiceFile
23
 */
24
class ServiceFile extends Service {
25
    
26
    
27
    /**
28
    * getPublicArea
29
    * 
30
    * Return the link which will be displayed in public area in summary page
31
    */
32
    function getPublicArea() {
33
        $html  = '';
34
        $html .= '<p><a href="/file/showfiles.php?group_id='.$this->getGroupId().'">';
35
        $html .= $GLOBALS['Response']->getImage("ic/file.png", array('width'=>'20', 'height'=>'20', 'alt'=>$GLOBALS['Language']->getText('include_project_home','files')));
36
        $html .= ' '.$GLOBALS['Language']->getText('include_project_home','file_releases').'</a>';
37
        $html .= ' ( '.$GLOBALS['Language']->getText('include_project_home','packages',count($this->_getPackagesForUser(user_getid()))).' )';
38
        $html .= '</p>';
39
        return $html;
40
    }
41
    /**
42
    * getSummaryPageContent
43
    *
44
    * Return the text to display on the summary page
45
    * @return arr[title], arr[content]
0 ignored issues
show
The doc-type arr[title], could not be parsed: Expected "]" at position 2, but found "title". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
46
    */
47
    function getSummaryPageContent() {
48
        $hp   = Codendi_HTMLPurifier::instance();
49
        $user = UserManager::instance()->getCurrentUser();
50
        $ret  = array(
51
            'title' => $GLOBALS['Language']->getText('include_project_home','latest_file_releases'),
52
            'content' => ''
53
        );
54
        
55
        $packages = $this->_getPackagesForUser($user->getId());
56
        if (count($packages)) {
57
            $ret['content'] .= '
58
                <table cellspacing="1" cellpadding="5" width="100%" border="0">
59
                    <tr class="boxitem">
60
                        <td>
61
                            '.$GLOBALS['Language']->getText('include_project_home','package').'
62
                        </td>
63
                        <td>
64
                            '.$GLOBALS['Language']->getText('include_project_home','version').'
65
                        </td>
66
                        <td>
67
                            '.$GLOBALS['Language']->getText('include_project_home','download').'
68
                        </td>
69
                    </tr>
70
            ';
71
            require_once('FileModuleMonitorFactory.class.php');
72
            $fmmf = new FileModuleMonitorFactory();
73
            foreach($packages as $package) {
74
                // the icon is different whether the package is monitored or not
75
                if ($fmmf->isMonitoring($package['package_id'], $user, false)) {
76
                    $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_stop.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home', 'stop_monitoring'), 'title'=>$GLOBALS['Language']->getText('include_project_home', 'stop_monitoring')));
77
                } else {
78
                    $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_start.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home', 'start_monitoring'), 'title'=>$GLOBALS['Language']->getText('include_project_home', 'start_monitoring')));
79
                }
80
            
81
                $ret['content'] .= '
82
                  <TR class="boxitem">
83
                  <TD>
84
                    <B>' .  $hp->purify(util_unconvert_htmlspecialchars($package['package_name']), CODENDI_PURIFIER_CONVERT_HTML)  . '</B>&nbsp;
85
                    <a HREF="/file/filemodule_monitor.php?filemodule_id=' . $package['package_id'] . '&group_id='.$this->getGroupId().'">'.
86
                        $monitor_img . '     
87
                    </a>
88
                  </TD>';
89
                // Releases to display
90
                $ret['content'] .= '<TD>'.  $hp->purify($package['release_name'], CODENDI_PURIFIER_CONVERT_HTML)  .'&nbsp;<A href="/file/shownotes.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">' .
91
                    $GLOBALS['HTML']->getImage("ic/text.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home','release_notes'), 'title'=>$GLOBALS['Language']->getText('include_project_home','release_notes'))) . ' 
92
                  </TD>
93
                  <TD><A HREF="/file/showfiles.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">'.$GLOBALS['Language']->getText('include_project_home','download').'</A></TD></TR>';
94
            }
95
            $ret['content'] .= '</table>';
96
        } else {
97
            $ret['content'] .= '<b>'. $GLOBALS['Language']->getText('include_project_home','no_files_released') .'</b>';
98
        }
99
        $ret['content'] .= '
100
            <div align="center">
101
                <a href="/file/showfiles.php?group_id='.$this->getGroupId().'">['.$GLOBALS['Language']->getText('include_project_home','view_all_files').']</A>
102
            </div>
103
        ';
104
        return $ret;
105
    }
106
    
107
    private function getFRSPackageFactory() {
108
        require_once('FRSPackageFactory.class.php');
109
        return new FRSPackageFactory();
110
    }
111
    
112
    /**
113
    * _getPackagesForUser
114
    * 
115
    * return the packages the user can see
116
    *
117
    * @param  user_id  
118
    */
119
    function _getPackagesForUser($user_id) {
120
        $frspf = $this->getFRSPackageFactory();
121
        $packages = array();
122
        $sql="SELECT frs_package.package_id,frs_package.name AS package_name,frs_release.name AS release_name,frs_release.release_id AS release_id,frs_release.release_date AS release_date ".
123
        "FROM frs_package,frs_release ".
124
        "WHERE frs_package.package_id=frs_release.package_id ".
125
        "AND frs_package.group_id='". db_ei($this->getGroupId()) ."' ".
126
        "AND frs_release.status_id=' ".db_ei($frspf->STATUS_ACTIVE)."' ".
127
        "ORDER BY frs_package.rank,frs_package.package_id,frs_release.release_date DESC, frs_release.release_id DESC";
128
        $res_files = db_query($sql);
129
        $rows_files = db_numrows($res_files);
130
        if ($res_files && $rows_files >= 1) {
131
            for ($f=0; $f<$rows_files; $f++) {
132
                $package_id=db_result($res_files,$f,'package_id');
133
                $release_id=db_result($res_files,$f,'release_id');
134
                if ($frspf->userCanRead($this->getGroupId(), $package_id, $user_id)) {
135
                    if (isset($package_displayed[$package_id]) && $package_displayed[$package_id]) {
136
                        //if ($package_id==db_result($res_files,($f-1),'package_id')) {
137
                        //same package as last iteration - don't show this release
138
                    } else {
139
                        $authorized=false;
140
                        // check access.
141
                        if (permission_exist('RELEASE_READ', $release_id)) {
142
                            $authorized=permission_is_authorized('RELEASE_READ',$release_id, $user_id ,$this->getGroupId());
143
                        } else {  
144
                            $authorized=permission_is_authorized('PACKAGE_READ',$package_id, $user_id ,$this->getGroupId());
145
                        }
146
                        if ($authorized) {
147
                            $packages[] = array(
148
                                'package_name' => db_result($res_files,$f,'package_name'),
149
                                'release_name' => db_result($res_files,$f,'release_name'),
150
                                'release_id'   => $release_id,
151
                                'package_id'   => $package_id,
152
                            );
153
                            $package_displayed[$package_id] = true;
154
                         }
155
                    }
156
                }
157
            }
158
        }
159
        return $packages;
160
    }
161
    function isRequestedPageDistributed(&$request) {
162
        return in_array($_SERVER['SCRIPT_NAME'], array(
163
            '/file/admin/release.php', 
164
            '/file/admin/frsajax.php', 
165
            '/file/download.php',
166
        ));
167
    }
168
}
169
?>
170