Issues (14)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

lib/AppInfo/Application.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author Christoph Wurst <[email protected]>
7
 *
8
 * @license GNU AGPL version 3 or any later version
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License as
12
 * published by the Free Software Foundation, either version 3 of the
13
 * License, or (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Affero General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU Affero General Public License
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
 *
23
 */
24
25
namespace OCA\Sentry\AppInfo;
26
27
use OCA\Sentry\Config;
28
use OCA\Sentry\InitialState\DsnProvider;
29
use OCA\Sentry\Listener\CustomCspListener;
30
use OCA\Sentry\Reporter\ISentryReporter;
31
use OCA\Sentry\Reporter\RecursionAwareReporter;
32
use OCA\Sentry\Reporter\SentryReporterAdapter;
33
use OCP\AppFramework\App;
34
use OCP\AppFramework\Bootstrap\IBootContext;
35
use OCP\AppFramework\Bootstrap\IBootstrap;
36
use OCP\AppFramework\Bootstrap\IRegistrationContext;
37
use OCP\AppFramework\Http\ContentSecurityPolicy;
38
use OCP\EventDispatcher\IEventDispatcher;
39
use OCP\IConfig;
40
use OCP\IInitialStateService;
41
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
42
use OCP\Support\CrashReport\IRegistry;
43
use OCP\Support\CrashReport\IReporter;
44
use OCP\Util;
45
use Psr\Container\ContainerInterface;
0 ignored issues
show
The type Psr\Container\ContainerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
46
use function parse_url;
47
use function Sentry\init as initSentry;
48
49
class Application extends App implements IBootstrap {
50
51
	public function __construct(array $urlParams = []) {
52
		parent::__construct('sentry', $urlParams);
53
	}
54
55
	public function register(IRegistrationContext $context): void {
56
		// Register the autoloader
57
		include_once __DIR__ . '/../../vendor/autoload.php';
58
59
		// Wire the interface to our decorator and implementation
60
		$context->registerService(ISentryReporter::class, function (ContainerInterface $c) {
61
			/** @var Config $config */
62
			$config = $c->get(Config::class);
63
			/** @var SentryReporterAdapter $inner */
64
			$inner = $c->get(SentryReporterAdapter::class);
65
66
			// Now it's time to connect Sentry
67
			$dsn = $config->getDsn();
0 ignored issues
show
Deprecated Code introduced by
The function OCA\Sentry\Config::getDsn() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

67
			$dsn = /** @scrutinizer ignore-deprecated */ $config->getDsn();
Loading history...
68
			if ($dsn !== null) {
69
				initSentry([
70
					'dsn' => $dsn,
71
					'release' => $config->getServerVersion(),
72
				]);
73
			}
74
75
			return new RecursionAwareReporter($inner);
76
		});
77
		$context->registerCrashReporter(ISentryReporter::class);
78
		$context->registerEventListener(AddContentSecurityPolicyEvent::class, CustomCspListener::class);
79
		$context->registerInitialStateProvider(DsnProvider::class);
80
	}
81
82
	public function boot(IBootContext $context): void {
83
		Util::addScript('sentry', 'sentry');
84
	}
85
86
}
87