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

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/DeathByCaptcha.php (10 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 juniorb2ss\DeathByCaptcha;
4
5
use GuzzleHttp\Client as GuzzleClient;
6
use GuzzleHttp\ClientInterface;
7
use GuzzleHttp\Psr7\Response;
8
use juniorb2ss\DeathByCaptcha\Abstracts\HttpDeathByCaptchaAbstract;
9
use juniorb2ss\DeathByCaptcha\Interfaces\AccountInterface;
10
use juniorb2ss\DeathByCaptcha\Interfaces\DeathByCaptchaInterface;
11
use juniorb2ss\DeathByCaptcha\Interfaces\ReportInterface;
12
use juniorb2ss\DeathByCaptcha\Interfaces\ResolveInterface;
13
use juniorb2ss\DeathByCaptcha\Interfaces\StatusInterface;
14
use juniorb2ss\DeathByCaptcha\Services\AccountService;
15
use juniorb2ss\DeathByCaptcha\Services\ImageService;
16
use juniorb2ss\DeathByCaptcha\Services\ReportService;
17
use juniorb2ss\DeathByCaptcha\Services\ResolveService;
18
use juniorb2ss\DeathByCaptcha\Services\StatusService;
19
20
class DeathByCaptcha extends HttpDeathByCaptchaAbstract implements DeathByCaptchaInterface
21
{
22
    /**
23
     * URL do serviço
24
     */
25
    const API_URL = 'http://api.dbcapi.me/api/';
26
27
    /**
28
     * API Version
29
     */
30
    const API_VERSION = 'DBC/PHP v5';
31
32
    /**
33
     * Request DEFAULT TIMEOUT
34
     */
35
    const DEFAULT_TIMEOUT = 60;
36
37
    /**
38
     * @param string                $username
39
     * @param string                $password
40
     * @param ClientInterface|null  $client
0 ignored issues
show
There is no parameter named $client. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
41
     * @param AccountInterface|null $account
0 ignored issues
show
There is no parameter named $account. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
42
     * @param StatusInterface|null  $status
0 ignored issues
show
There is no parameter named $status. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
43
     */
44 81
    public function __construct(
45
        string $username,
46
        string $password
47
    ) {
48 81
        $this->username = $username;
0 ignored issues
show
The property username does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
49 81
        $this->password = $password;
0 ignored issues
show
The property password does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
50
51 81
        $this->client = new GuzzleClient;
0 ignored issues
show
The property client does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
52 81
        $this->account = new AccountService;
0 ignored issues
show
The property account does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
53 81
        $this->status = new StatusService;
0 ignored issues
show
The property status does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
54 81
        $this->report = new ReportService;
0 ignored issues
show
The property report does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
55 81
        $this->resolve = new ResolveService;
0 ignored issues
show
The property resolve does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
56 81
    }
57
58 81
    public function setHttpClient(ClientInterface $client)
59
    {
60 81
        $this->client = $client;
61
62 81
        return $this;
63
    }
64
65 39
    public function account(): AccountInterface
66
    {
67 39
        $response = $this->accountRequest();
68
69 24
        return $this->account
70 24
                    ->setResponse($response);
71
    }
72
73 18
    public function status(): StatusInterface
74
    {
75 18
        $response = $this->statusRequest();
76
77 18
        return $this->status
78 18
                    ->setResponse($response);
79
    }
80
81 3
    public function report(int $id): ReportInterface
82
    {
83 3
        $response = $this->captchAsIncorrect($id);
84
85 3
        return $this->report
86 3
                    ->setResponse($response);
87
    }
88
89 21
    public function resolve($captcha): ResolveInterface
90
    {
91
        // If passed captcha id, retrieve captcha text
92 21
        if (is_int($captcha)) {
93 6
            $response = $this->retrieveCaptcha($captcha);
94
        } else {
95 15
            $image = ImageService::base64From($captcha);
96
97 12
            $response = $this->uploadCaptcha($image);
98
        }
99
100 6
        return $this->resolve
101 6
                    ->setResponse($response);
102
    }
103
104
    public function resolveV2(string $mix, string $url = null): ResolveInterface
105
    {
106
        if (is_null($url)) {
107
            $response = $this->retrieveCaptcha($mix);
108
        } else {
109
            $response = $this->sendReCaptchaV2($mix, $url);
110
        }
111
112
        return $this->resolve
113
                    ->setResponse($response);
114
    }
115
}
116