Issues (457)

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/Providers/FmLibServiceProvider.php (2 issues)

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
declare(strict_types=1);
3
/**
4
 * Created by PhpStorm.
5
 * User: benedikt
6
 * Date: 1/24/18
7
 * Time: 2:55 PM
8
 */
9
10
namespace Tfboe\FmLib\Providers;
11
12
use Doctrine\DBAL\Types\Type;
13
use Doctrine\ORM\EntityManagerInterface;
14
use Illuminate\Contracts\Container\Container;
15
use Illuminate\Contracts\Debug\ExceptionHandler;
16
use Illuminate\Support\Facades\Validator;
17
use Illuminate\Support\ServiceProvider;
18
use Irazasyed\JwtAuthGuard\JwtAuthGuardServiceProvider;
19
use LaravelDoctrine\Extensions\GedmoExtensionsServiceProvider;
20
use LaravelDoctrine\ORM\DoctrineServiceProvider;
21
use Tfboe\FmLib\Entity\Helpers\UTCDateTimeType;
22
use Tfboe\FmLib\Exceptions\Handler;
23
use Tfboe\FmLib\Http\Middleware\Authenticate;
24
use Tfboe\FmLib\Service\AsyncExecuterService;
25
use Tfboe\FmLib\Service\AsyncExecuterServiceInterface;
26
use Tfboe\FmLib\Service\DeletionService;
27
use Tfboe\FmLib\Service\DeletionServiceInterface;
28
use Tfboe\FmLib\Service\DynamicServiceLoadingService;
29
use Tfboe\FmLib\Service\DynamicServiceLoadingServiceInterface;
30
use Tfboe\FmLib\Service\LoadingService;
31
use Tfboe\FmLib\Service\LoadingServiceInterface;
32
use Tfboe\FmLib\Service\ObjectCreatorService;
33
use Tfboe\FmLib\Service\ObjectCreatorServiceInterface;
34
use Tfboe\FmLib\Service\PlayerService;
35
use Tfboe\FmLib\Service\PlayerServiceInterface;
36
use Tfboe\FmLib\Service\RankingSystem\EloRanking;
37
use Tfboe\FmLib\Service\RankingSystem\EloRankingInterface;
38
use Tfboe\FmLib\Service\RankingSystem\EntityComparerByTimeStartTimeAndLocalIdentifier;
39
use Tfboe\FmLib\Service\RankingSystem\RecursiveEndStartTimeService;
40
use Tfboe\FmLib\Service\RankingSystemService;
41
use Tfboe\FmLib\Service\RankingSystemServiceInterface;
42
use Tymon\JWTAuth\Providers\LumenServiceProvider;
43
44
/**
45
 * Class FmLibServiceProvider
46
 * @package Tfboe\FmLib\Providers
47
 */
48
class FmLibServiceProvider extends ServiceProvider
49
{
50
//<editor-fold desc="Public Methods">
51
  /**
52
   * Bootstrap the application services.
53
   *
54
   * @return void
55
   */
56
  public function boot()
57
  {
58
    app()->configure('fm-lib');
59
60
    /** @noinspection PhpUndefinedMethodInspection */
61
    Validator::extend('IntegerType', function (/** @noinspection PhpUnusedParameterInspection */
62
      $attribute, $value, $parameters, $validator) {
0 ignored issues
show
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $validator is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
      return is_int($value);
64
    }, 'The :attribute must be an integer.');
65
66
    include __DIR__ . '/../routes.php';
67
  }
68
69
  /** @noinspection PhpDocMissingThrowsInspection */ //\Doctrine\DBAL\DBALException
70
  /**
71
   * Register the application services.
72
   *
73
   * @return void
74
   */
75
  public function register()
76
  {
77
    //register middleware
78
    app()->routeMiddleware(['auth' => Authenticate::class]);
79
80
    $this->app->singleton(
81
      ExceptionHandler::class,
82
      Handler::class
83
    );
84
85
    if ($this->app->environment() !== 'production') {
86
      if (class_exists('\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider')) {
87
        $this->app->register('\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider');
88
      }
89
    }
90
91
    /** @noinspection PhpUnhandledExceptionInspection */ // \Doctrine\DBAL\DBALException datetime is a valid type
92
    Type::overrideType('datetime', UTCDateTimeType::class);
93
94
    $this->app->register(LumenServiceProvider::class);
95
    $this->app->register(DoctrineServiceProvider::class);
96
    $this->app->register(GedmoExtensionsServiceProvider::class);
97
    $this->app->register(JwtAuthGuardServiceProvider::class);
98
99
    $this->app->singleton(DynamicServiceLoadingServiceInterface::class, function (Container $app) {
100
      return new DynamicServiceLoadingService($app);
101
    });
102
103
    $this->app->singleton(RankingSystemServiceInterface::class, function (Container $app) {
104
      return new RankingSystemService($app->make(DynamicServiceLoadingServiceInterface::class),
105
        $app->make(EntityManagerInterface::class));
106
    });
107
108
    $this->app->singleton(ObjectCreatorServiceInterface::class, function () {
109
      return new ObjectCreatorService();
110
    });
111
112
    $this->app->singleton(EloRankingInterface::class, function (Container $app) {
113
      $timeService = new RecursiveEndStartTimeService();
114
      return new EloRanking(
115
        $app->make(EntityManagerInterface::class),
116
        $timeService,
117
        new EntityComparerByTimeStartTimeAndLocalIdentifier($timeService),
118
        $app->make(ObjectCreatorServiceInterface::class));
119
    });
120
121
    $this->app->singleton(LoadingServiceInterface::class, function (Container $app) {
122
      return new LoadingService($app->make(EntityManagerInterface::class));
123
    });
124
125
    $this->app->singleton(PlayerServiceInterface::class, function (Container $app) {
126
      return new PlayerService(
127
        $app->make(EntityManagerInterface::class),
128
        $app->make(LoadingServiceInterface::class),
129
        $app->make(RankingSystemServiceInterface::class)
130
      );
131
    });
132
133
    $this->app->singleton(AsyncExecuterServiceInterface::class, function () {
134
      return new AsyncExecuterService();
135
    });
136
  }
137
//</editor-fold desc="Public Methods">
138
}