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.

include/archivedeleteditemsPlugin.class.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
/**
3
 * Copyright (c) STMicroelectronics 2012. All rights reserved
4
 * Copyright (c) Enalean, 2015. All Rights Reserved.
5
 *
6
 * Tuleap is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * Tuleap is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
18
 */
19
20
require_once('common/plugin/Plugin.class.php');
21
22
/**
23
 * Archive
24
 */
25
class ArchivedeleteditemsPlugin extends Plugin {
26
27
    private $archiveScript;
28
29
    /**
30
     * Constructor of the class
31
     *
32
     * @param Integer $id Id of the plugin
33
     *
34
     * @return Void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
35
     */
36
    public function __construct($id) {
37
        parent::__construct($id);
38
        $this->setScope(Plugin::SCOPE_SYSTEM);
39
        $this->archiveScript = $GLOBALS['codendi_bin_prefix'] . "/archive-deleted-items.pl";
40
        $this->_addHook('archive_deleted_item', 'archive_deleted_item', false);
41
    }
42
43
    /**
44
     * Obtain ArchiveDeletedItemsPluginInfo instance
45
     *
46
     * @return ArchiveDeletedItemsPluginInfo
47
     */
48
    public function getPluginInfo() {
49
        if (!is_a($this->pluginInfo, 'ArchiveDeletedItemsPluginInfo')) {
50
            require_once('ArchiveDeletedItemsPluginInfo.class.php');
51
            $this->pluginInfo = new ArchiveDeletedItemsPluginInfo($this);
52
        }
53
        return $this->pluginInfo;
54
    }
55
56
    /**
57
     * Returns the configuration defined for given variable name
58
     *
59
     * @param String $key name of the param
60
     *
61
     * @return String
62
     */
63
    public function getConfigurationParameter($key) {
64
        return $this->getPluginInfo()->getPropertyValueForName($key);
65
    }
66
67
    /**
68
     * Copy files to the archiving directory
69
     *
70
     * @param Array $params Hook parameters
71
     *
72
     * @return Boolean
73
     */
74
    public function archive_deleted_item($params) {
75
        $params['status'] = false;
76
77
        if (!empty($params['source_path'])) {
78
            $source_path = $params['source_path'];
79
        } else {
80
            $params['error'] = 'Missing argument source path';
81
            return false;
82
        }
83
84
        $archive_path = $this->getWellFormattedArchivePath();
85
86
        if (!empty($archive_path)) {
87
            if(!is_dir($archive_path)) {
88
                $params['error'] = 'Non-existing archive path';
89
                return false;
90
            }
91
        } else {
92
            $params['error'] = 'Missing argument archive path';
93
            return false;
94
        }
95
96
        if (!empty($params['archive_prefix'])) {
97
            $archive_prefix = $params['archive_prefix'];
98
        } else {
99
            $params['error'] = 'Missing argument archive prefix';
100
            return false;
101
        }
102
103
        $ret_val         = null;
104
        $exec_res        = null;
105
        if (file_exists($source_path)) {
106
            $destination_path = $archive_path.$archive_prefix.'_'.basename($source_path);
107
            $cmd              = $this->archiveScript." ".$source_path." " .$destination_path;
108
109
            exec($cmd, $exec_res, $ret_val);
110
            if ($ret_val == 0) {
0 ignored issues
show
It seems like you are loosely comparing $ret_val of type integer|null to 0; this is ambiguous as not only 0 == 0 is true, but null == 0 is true, too. Consider using a strict comparison ===.
Loading history...
111
                $params['status'] = true;
112
                return true;
113
            } else {
114
                $params['error'] = 'Archiving of "'.$source_path.'" in "'.$destination_path.'" failed';
115
                return false;
116
            }
117
        } else {
118
            $params['error'] = 'Skipping file "'.$source_path.'": not found in file system.';
119
            return false;
120
        }
121
    }
122
123
    private function getWellFormattedArchivePath() {
124
        $archive_path = $this->getConfigurationParameter('archive_path');
125
126
        if ($archive_path) {
127
            $archive_path  = rtrim($archive_path, '/');
128
            $archive_path .= '/';
129
        }
130
131
        return $archive_path;
132
    }
133
134
}