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

Security Analysis    no request data  

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/JumpCloud/Handler/RequestHandler.php (2 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
namespace JumpCloud\Handler;
4
5
use GuzzleHttp\Client as GuzzleClient;
6
use GuzzleHttp\Exception\ClientException;
7
use GuzzleHttp\Psr7\Request as HttpRequest;
8
use GuzzleHttp\Psr7\Response;
9
use JumpCloud\Request\RequestInterface;
10
use JumpCloud\Response\ResponseInterface;
11
use Psr\Log\LoggerInterface;
12
use Psr\Log\NullLogger;
13
use Webmozart\Json\JsonEncoder;
14
15
/**
16
 * Class RequestHandler
17
 *
18
 * @package JumpCloud
19
 */
20
class RequestHandler
21
{
22
    /**
23
     * @var NullLogger
24
     */
25
    private $logger;
26
27
    /**
28
     * @var JsonEncoder
29
     */
30
    private $jsonEncoder;
31
32
    /**
33
     * RequestHandler constructor.
34
     *
35
     * @param LoggerInterface|null $logger
36
     */
37 15
    public function __construct(LoggerInterface $logger = null)
38
    {
39 15
        $this->logger = $logger ?: new NullLogger();
0 ignored issues
show
Documentation Bug introduced by
$logger ?: new \Psr\Log\NullLogger() is of type object<Psr\Log\LoggerInterface>, but the property $logger was declared to be of type object<Psr\Log\NullLogger>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
40 15
        $this->jsonEncoder = new JsonEncoder();
41 15
    }
42
43
    /**
44
     * @param GuzzleClient $client
45
     * @param RequestInterface $request
46
     * @return ResponseInterface
47
     */
48 13
    public function handle(GuzzleClient $client, RequestInterface $request)
49
    {
50
        try {
51 13
            $response = $client->send(
52 13
                new HttpRequest(
53 13
                    $request->getMethod(),
54 12
                    $request->getUri(),
55 12
                    $request->getHeaders(),
56 12
                    $this->jsonEncoder->encode($request->getBody())
57
                )
58
            );
59 7
        } catch (\Exception $e) {
60 7
            $this->logger->debug(
61 7
                sprintf('Exception thrown during Guzzle request'),
62
                [
63 7
                    'message' => $e->getMessage(),
64 7
                    'line' => $e->getLine(),
65 7
                    'file' => $e->getFile(),
66 7
                    'trace' => $e->getTraceAsString()
67
                ]
68
            );
69
70 7
            $response = new Response(500);
71
72 7
            if ($e instanceof ClientException) {
73 2
                $response = new Response(401);
74
            }
75
        }
76
77 13
        return $request->getResponseFactory()->create($response);
0 ignored issues
show
$response of type object<Psr\Http\Message\ResponseInterface> is not a sub-type of object<GuzzleHttp\Psr7\Response>. It seems like you assume a concrete implementation of the interface Psr\Http\Message\ResponseInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
78
    }
79
}
80