Issues (43)

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/Controller/Abstracts/AbstractField.php (4 issues)

Labels
Severity
1
<?php
2
3
namespace WebTheory\Saveyour\Controller\Abstracts;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
use WebTheory\Saveyour\Contracts\Controller\FormFieldControllerInterface;
7
use WebTheory\Saveyour\Contracts\Data\FieldDataManagerInterface;
8
use WebTheory\Saveyour\Contracts\Field\FormFieldInterface;
9
use WebTheory\Saveyour\Contracts\Formatting\DataFormatterInterface;
10
use WebTheory\Saveyour\Contracts\Report\ProcessedFieldReportInterface;
11
use WebTheory\Saveyour\Contracts\Report\ValidationReportInterface;
12
use WebTheory\Saveyour\Controller\FormFieldController;
13
use WebTheory\Saveyour\Validation\Validator;
14
15
abstract class AbstractField implements FormFieldControllerInterface
16
{
17
    /**
18
     * @var string
19
     */
20
    protected string $__requestVar;
21
22
    /**
23
     * @var bool
24
     */
25
    protected bool $__isPermittedToProcess = true;
26
27
    /**
28
     * @var array<int,string>
29
     */
30
    protected array $__mustAwait = [];
31
32
    protected FormFieldControllerInterface $__coreController;
33
34 12
    public function __construct(string $requestVar, array $mustAwait = [], $processingEnabled = true)
35
    {
36 12
        $this->__requestVar = $requestVar;
37 12
        $this->__mustAwait = $mustAwait;
38 12
        $this->__isPermittedToProcess = $processingEnabled;
39
40 12
        $this->__coreController = $this->createFormFieldController();
41
    }
42
43
    /**
44
     * Get the value of requestVar
45
     *
46
     * @return string
47
     */
48 3
    public function getRequestVar(): string
49
    {
50 3
        return $this->__coreController->getRequestVar();
51
    }
52
53
    public function getFormField(): ?FormFieldInterface
54
    {
55
        return $this->__coreController->getFormField();
56
    }
57
58
    public function requestVarPresent(ServerRequestInterface $request): bool
59
    {
60
        return $this->__coreController->requestVarPresent($request);
61
    }
62
63
    public function inspect($value): ValidationReportInterface
64
    {
65
        return $this->__coreController->inspect($value);
66
    }
67
68
    public function validate($value): bool
69
    {
70
        return $this->__coreController->validate($value);
71
    }
72
73
    public function getPresetValue(ServerRequestInterface $request)
74
    {
75
        return $this->__coreController->getPresetValue($request);
76
    }
77
78
    public function getUpdatedValue(ServerRequestInterface $request): ?array
79
    {
80
        return $this->__coreController->getUpdatedValue($request);
81
    }
82
83 3
    public function mustAwait(): array
84
    {
85 3
        return $this->__coreController->mustAwait();
86
    }
87
88
    public function render(ServerRequestInterface $request): string
89
    {
90
        return $this->__coreController->render($request);
91
    }
92
93
    public function compose(ServerRequestInterface $request): FormFieldInterface
94
    {
95
        return $this->__coreController->compose($request);
96
    }
97
98 6
    public function isPermittedToProcess(): bool
99
    {
100 6
        return $this->__coreController->isPermittedToProcess();
101
    }
102
103
    public function process(ServerRequestInterface $request): ProcessedFieldReportInterface
104
    {
105
        return $this->__coreController->process($request);
106
    }
107
108 12
    protected function createFormFieldController(): FormFieldControllerInterface
109
    {
110 12
        return new FormFieldController(
111 12
            $this->defineRequestVar(),
112 12
            $this->defineFormField(),
0 ignored issues
show
Are you sure the usage of $this->defineFormField() targeting WebTheory\Saveyour\Contr...ield::defineFormField() 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...
113 12
            $this->defineDataManager(),
0 ignored issues
show
Are you sure the usage of $this->defineDataManager() targeting WebTheory\Saveyour\Contr...ld::defineDataManager() 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...
114 12
            $this->defineValidator(),
0 ignored issues
show
Are you sure the usage of $this->defineValidator() targeting WebTheory\Saveyour\Contr...ield::defineValidator() 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...
115 12
            $this->defineDataFormatter(),
0 ignored issues
show
Are you sure the usage of $this->defineDataFormatter() targeting WebTheory\Saveyour\Contr...::defineDataFormatter() 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...
116 12
            $this->definePermissionProcessStatus(),
117 12
            $this->defineMustAwait(),
118
        );
119
    }
120
121 12
    protected function defineRequestVar(): string
122
    {
123 12
        return $this->__requestVar;
124
    }
125
126 12
    protected function defineFormField(): ?FormFieldInterface
127
    {
128 12
        return null;
129
    }
130
131 12
    protected function defineDataManager(): ?FieldDataManagerInterface
132
    {
133 12
        return null;
134
    }
135
136 12
    protected function defineDataFormatter(): ?DataFormatterInterface
137
    {
138 12
        return null;
139
    }
140
141 12
    protected function defineValidator(): ?Validator
142
    {
143 12
        return null;
144
    }
145
146 12
    protected function definePermissionProcessStatus(): ?bool
147
    {
148 12
        return $this->__isPermittedToProcess;
149
    }
150
151 12
    protected function defineMustAwait(): ?array
152
    {
153 12
        return $this->__mustAwait;
154
    }
155
}
156