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 (88)

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.

actions/plugins/create_project.php (4 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
/**
4
 * Elgg plugin project creation action
5
 */
6
7
namespace Elgg\CommunityPlugins;
8
9
use PluginProject;
10
use PluginRelease;
11
12
elgg_make_sticky_form('community_plugins');
13
14
// Get variables
15
$title = strip_tags(get_input("title"));
16
$description = plugins_strip_tags(get_input("description"));
17
$tags = get_input("tags");
18
$summary = strip_tags(elgg_substr(get_input('summary'), 0, 250));
19
$homepage = strip_tags(get_input('homepage'));
20
$donate = strip_tags(get_input('donate'));
21
$repo = strip_tags(get_input('repo'));
22
$license = get_input('license');
23
$plugincat = get_input('plugincat', 'uncategorized');
24
$project_access_id = get_input("project_access_id", ACCESS_PUBLIC);
25
$plugin_type = get_input('plugin_type');
26
if ($plugin_type != 'theme' && $plugin_type != 'languagepack') {
27
	$plugin_type = 'plugin';
28
}
29
30
$release_notes = plugins_strip_tags(get_input('release_notes'));
31
$elgg_version = get_input('elgg_version', false);
32
$comments = get_input('comments', 'yes');
33
$version = strip_tags(get_input('version'));
34
$recommended = get_input('recommended', array());
35
$release_access_id = get_input('release_access_id', ACCESS_PUBLIC);
36
37
$user = elgg_get_logged_in_user_entity();
38
39
40
// validate data
41
if (!$title) {
42
	register_error(elgg_echo('plugins:error:notitle'));
43
	forward(REFERER);
44
}
45
$licenses = elgg_get_config('gpllicenses');
46
if ($license == 'none' || !array_key_exists($license, $licenses)) {
47
	register_error(elgg_echo('plugins:error:badlicense'));
48
	forward(REFERER);
49
}
50
$mimetype = get_mimetype('upload');
51
if (!$mimetype) {
52
	register_error(elgg_echo('plugins:error:badformat'));
53
	forward(REFERER);
54
}
55
56
// version is sent but null, so get_input doesn't use defaults.
57
if (!$version) {
58
	register_error(elgg_echo('plugins:error:no_version'));
59
	forward(REFERER);
60
}
61
62
// we require an elgg version now
63
if (!$elgg_version) {
64
	register_error(elgg_echo('plugins:error:no_elgg_version'));
65
	forward(REFERER);
66
}
67
68
// Create the plugin project
69
$plugin_project = new PluginProject();
70
$plugin_project->owner_guid = $user->getGUID();
71
$plugin_project->container_guid = $user->getGUID();
72
$plugin_project->access_id = $project_access_id;
73
$plugin_project->title = $title;
74
$plugin_project->description = $description;
75
$plugin_project->tags = string_to_tag_array($tags);
76
$plugin_project->plugincat = $plugincat;
77
$plugin_project->license = $license;
78
$plugin_project->summary = $summary;
79
$plugin_project->homepage = $homepage;
80
$plugin_project->repo = $repo;
81
$plugin_project->donate = $donate;
82
$plugin_project->digg = 0;
83
$plugin_project->plugin_type = $plugin_type;
84
$plugin_project->save();
85
86
// Extract file and save to default filestore (for now)
87
$prefix = "plugins/";
88
$filestorename = $prefix . strtolower(time() . $_FILES['upload']['name']);
89
$release = new PluginRelease();
90
$release->title = $plugin_project->title;
91
$release->setFilename($filestorename);
92
$release->setMimetype($mimetype);
93
$release->originalfilename = $_FILES['upload']['name'];
94
$release->access_id = $release_access_id;
95
$release->container_guid = $plugin_project->getGUID();
96
$release->version = $version;
97
$release->release_notes = $release_notes;
98
$release->elgg_version = $elgg_version;
99
$release->comments = $comments;
100
$release->save();
101
102 View Code Duplication
if ($release->saveArchive('upload') != TRUE) {
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison !== instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
This code seems to be duplicated across 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...
103
	register_error(elgg_echo("plugins:error:uploadfailed"));
104
	forward(REFERER);
105
}
106
107 View Code Duplication
if (!$plugin_project->getGUID() || !$release->getGUID()) {
0 ignored issues
show
This code seems to be duplicated across 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...
108
	register_error(elgg_echo("plugins:error:uploadfailed"));
109
	forward(REFERER);
110
}
111
112
$release->setRecommended($recommended);
113
114
// check for any project images and associate them with the project
115
$max_num_images = 4;
116 View Code Duplication
for ($i = 1; $i <= $max_num_images; $i++) {
0 ignored issues
show
This code seems to be duplicated across 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...
117
	if (!array_key_exists("image_$i", $_FILES)) {
118
		continue;
119
	}
120
121
	$desc = get_input("image_{$i}_desc");
122
123
	$plugin_project->saveImage("image_$i", $desc, $i);
124
}
125
126
elgg_create_river_item(array(
127
	'view' => 'river/object/plugin_project/create',
128
	'action_type' => 'create',
129
	'subject_guid' => $user->getGUID(),
130
	'object_guid' => $plugin_project->getGUID(),
131
));
132
133
system_message(elgg_echo("plugins:project:saved"));
134
135
elgg_clear_sticky_form('community_plugins');
136
forward($plugin_project->getURL());
137