Issues (195)

Security Analysis    6 potential vulnerabilities

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 (4)
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 (1)
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.
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/Controller/AdminScoreController.php (2 issues)

Labels
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Controller;
6
7
use App\Model\AdminScore;
8
use App\Repository\AdminScoreRepository;
9
use Symfony\Component\HttpFoundation\Response;
10
use Symfony\Component\Routing\Annotation\Route;
11
12
/**
13
 * The AdminScoreController serves the search form and results page of the AdminScore tool.
14
 */
15
class AdminScoreController extends XtoolsController
16
{
17
    /**
18
     * @inheritDoc
19
     * @codeCoverageIgnore
20
     */
21
    public function getIndexRoute(): string
22
    {
23
        return 'AdminScore';
24
    }
25
26
    /**
27
     * Display the AdminScore search form.
28
     * @Route("/adminscore", name="AdminScore")
29
     * @Route("/adminscore/index.php", name="AdminScoreIndexPhp")
30
     * @Route("/scottywong tools/adminscore.php", name="AdminScoreLegacy")
31
     * @Route("/adminscore/{project}", name="AdminScoreProject")
32
     * @return Response
33
     */
34
    public function indexAction(): Response
35
    {
36
        // Redirect if we have a project and user.
37
        if (isset($this->params['project']) && isset($this->params['username'])) {
38
            return $this->redirectToRoute('AdminScoreResult', $this->params);
39
        }
40
41
        return $this->render('adminscore/index.html.twig', [
42
            'xtPage' => 'AdminScore',
43
            'xtPageTitle' => 'tool-adminscore',
44
            'xtSubtitle' => 'tool-adminscore-desc',
45
            'project' => $this->project,
46
        ]);
47
    }
48
49
    /**
50
     * Display the AdminScore results.
51
     * @Route("/adminscore/{project}/{username}", name="AdminScoreResult")
52
     * @param AdminScoreRepository $adminScoreRepo
53
     * @return Response
54
     * @codeCoverageIgnore
55
     */
56
    public function resultAction(AdminScoreRepository $adminScoreRepo): Response
57
    {
58
        $adminScore = new AdminScore($adminScoreRepo, $this->project, $this->user);
0 ignored issues
show
It seems like $this->user can also be of type null; however, parameter $user of App\Model\AdminScore::__construct() does only seem to accept App\Model\User, maybe add an additional type check? ( Ignorable by Annotation )

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

58
        $adminScore = new AdminScore($adminScoreRepo, $this->project, /** @scrutinizer ignore-type */ $this->user);
Loading history...
59
60
        return $this->getFormattedResponse('adminscore/result', [
61
            'xtPage' => 'AdminScore',
62
            'xtTitle' => $this->user->getUsername(),
0 ignored issues
show
The method getUsername() does not exist on null. ( Ignorable by Annotation )

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

62
            'xtTitle' => $this->user->/** @scrutinizer ignore-call */ getUsername(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
            'as' => $adminScore,
64
        ]);
65
    }
66
}
67