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

Security Analysis    no request data  

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
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
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.
  Header Injection
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/Api/Command/AbstractEntityEvent.php (3 issues)

1
<?php
2
3
/**
4
 * Abstract entity event class is base class for creating the events for received in response entities. It
5
 * includes methods to be able to quickly get a chat id and reply on message, get parent entity which
6
 * triggered this entity event.
7
 *
8
 * @package Teebot (Telegram bot framework)
9
 *
10
 * @author  Stanislav Drozdov <[email protected]>
11
 */
12
13
declare(strict_types=1);
14
15
namespace Teebot\Api\Command;
16
17
use Teebot\Api\{
18
    Response,
19
    Entity\EntityInterface,
20
    Entity\Message,
21
    Method\SendMessage
22
};
23
24
abstract class AbstractEntityEvent implements EventInterface
25
{
26
    /**
27
     * @var Processor $processor
28
     */
29
    protected $processor;
30
31
    /**
32
     * @var array
33
     */
34
    protected $params;
35
36
    /**
37
     * @var EntityInterface $entity
38
     */
39
    protected $entity = null;
40
41
    /**
42
     * Abstract method of each entity event which will be called if certain entity presents in response
43
     * and it's class exists or mapped in the config.
44
     *
45
     * @return null|bool
46
     */
47
    abstract public function run();
48
49
    /**
50
     * Sets configuration parameters
51
     *
52
     * @param array $params
53
     *
54
     * @return EventInterface
55
     */
56
    public function setParams(array $params): EventInterface
57
    {
58
        $this->params = $params;
59
60
        return $this;
61
    }
62
63
    /**
64
     * Returns chat id if the type of calling entity or it's parent is Message
65
     *
66
     * @return null|int
67
     */
68
    public function getChatId(): ?int
69
    {
70
        if ($this->entity instanceof Message) {
71
            return $this->entity->getChatId();
0 ignored issues
show
Are you sure the usage of $this->entity->getChatId() targeting Teebot\Api\Entity\Message::getChatId() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
72
        }
73
74
        $parent = $this->entity->getParent();
75
76
        if ($parent instanceof Message) {
77
            return $parent->getChatId();
0 ignored issues
show
Are you sure the usage of $parent->getChatId() targeting Teebot\Api\Entity\Message::getChatId() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
78
        }
79
80
        return null;
81
    }
82
83
    /**
84
     * @param Processor $processor
85
     *
86
     * @return EventInterface
87
     */
88
    public function setProcessor(Processor $processor): EventInterface
89
    {
90
        $this->processor = $processor;
91
92
        return $this;
93
    }
94
95
    /**
96
     * Sets entity
97
     *
98
     * @param EntityInterface $entity Entity object
99
     *
100
     * @return EventInterface
101
     */
102
    public function setEntity(EntityInterface $entity): EventInterface
103
    {
104
        $this->entity = $entity;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Sends text message to current chat
111
     *
112
     * @param string $text Message text
113
     *
114
     * @return Response
115
     */
116
    protected function sendMessage(string $text): Response
117
    {
118
        return $this->reply(
119
            (new SendMessage())
120
                ->setText($text)
121
        );
122
    }
123
124
    /**
125
     * Replies on the message
126
     *
127
     * @param SendMessage $sendMessage Object of the SendMessage method
128
     *
129
     * @return Response
130
     */
131
    protected function reply(SendMessage $sendMessage): Response
132
    {
133
        $chatId = $this->getChatId();
134
135
        if ((int)$chatId == 0) {
136
            return false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return false returns the type false which is incompatible with the type-hinted return Teebot\Api\Response.
Loading history...
137
        }
138
139
        $sendMessage->setChatId($chatId);
140
141
        return $this->processor->call($sendMessage, true, $this->entity);
142
    }
143
}
144