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

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.

CargoUI/src/Main.php (3 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
 * This file is part of the prooph/php-ddd-cargo-sample.
4
 * (c) Alexander Miertsch <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * Date: 8/8/15 - 12:37 AM
10
 */
11
namespace Codeliner\CargoUI;
12
13
use Psr\Http\Message\RequestInterface;
14
use Psr\Http\Message\ResponseInterface;
15
16
/**
17
 * Class Main
18
 *
19
 * This middleware is the main entry point to the CargoUI.
20
 * It compiles riot.js tags and put them into a HTML5 layout together
21
 * with some js libs and bootstrap css.
22
 * If enabled it caches the compiled layout to respond fast on subsequent requests
23
 * and let the riot SPA handle the client logic.
24
 *
25
 * @package Codeliner\CargoUI
26
 * @author Alexander Miertsch <[email protected]>
27
 */
28
final class Main
29
{
30
    /**
31
     * @var bool
32
     */
33
    private $cacheEnabled;
34
35
    /**
36
     * @var string
37
     */
38
    private $layout;
39
40
    /**
41
     * @var string
42
     */
43
    private $layoutCacheFile = 'data/cache/layout.phtml';
44
45
    /**
46
     * @var RiotCompiler
47
     */
48
    private $riotCompiler;
49
50
    /**
51
     * @param string $layout
52
     * @param bool $cacheEnabled
53
     * @param RiotCompiler $riotCompiler
54
     */
55
    public function __construct($layout, $cacheEnabled, RiotCompiler $riotCompiler)
56
    {
57
        $this->layout = (string)$layout;
58
        $this->cacheEnabled = (bool)$cacheEnabled;
59
        $this->riotCompiler = $riotCompiler;
60
    }
61
62
    /**
63
     * Render layout and write it to the response body
64
     *
65
     * @param RequestInterface $request
66
     * @param ResponseInterface $response
67
     * @param callable|null $next
68
     * @return ResponseInterface
69
     */
70
    public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null)
0 ignored issues
show
The parameter $request 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 $next 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...
71
    {
72
        $layout = $this->renderLayout();
73
74
        $response->getBody()->write($layout);
75
76
        return $response;
77
    }
78
79
    private function renderLayout()
80
    {
81
        if ($this->cacheEnabled && file_exists($this->layoutCacheFile)) {
82
            return file_get_contents($this->layoutCacheFile);
83
        }
84
85
        $layout = "";
86
        try {
87
            ob_start();
88
            $includeReturn = include $this->layout;
89
            $layout = ob_get_clean();
90
        } catch (\Exception $ex) {
91
            ob_end_clean();
92
            throw $ex;
93
        }
94
        if ($includeReturn === false && empty($layout)) {
95
            throw new \UnexpectedValueException(sprintf(
96
                'Unable to render layout "%s"; file include failed',
97
                $this->layout
98
            ));
99
        }
100
101
        if ($this->cacheEnabled) {
102
            file_put_contents($this->layoutCacheFile, $layout);
103
        }
104
105
        return $layout;
106
    }
107
108
    /**
109
     * @return string
110
     */
111
    private function compileRiot()
0 ignored issues
show
This method is not used, and could be removed.
Loading history...
112
    {
113
        return $this->riotCompiler->compileToRiotStatements();
114
    }
115
}