Issues (87)

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/Aop/Framework/AbstractMethodInvocation.php (1 issue)

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
declare(strict_types=1);
4
/*
5
 * Go! AOP framework
6
 *
7
 * @copyright Copyright 2011, Lisachenko Alexander <[email protected]>
8
 *
9
 * This source file is subject to the license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Go\Aop\Framework;
14
15
use Go\Aop\Intercept\MethodInvocation;
16
use Go\Aop\Support\AnnotatedReflectionMethod;
17
18
use function array_merge;
19
use function array_pop;
20
use function count;
21
22
/**
23
 * Abstract method invocation implementation
24
 */
25
abstract class AbstractMethodInvocation extends AbstractInvocation implements MethodInvocation
26
{
27
    /**
28
     * Instance of object for invoking
29
     */
30
    protected ?object $instance;
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '?', expecting T_FUNCTION or T_CONST
Loading history...
31
32
    /**
33
     * Instance of reflection method for invocation
34
     */
35
    protected AnnotatedReflectionMethod $reflectionMethod;
36
37
    /**
38
     * Class name scope for static invocation
39
     */
40
    protected string $scope = '';
41
42
    /**
43
     * This static string variable holds the name of field to use to avoid extra "if" section in the __invoke method
44
     *
45
     * Overridden in children classes and initialized via LSB
46
     */
47
    protected static string $propertyName;
48
49
    /**
50
     * Constructor for method invocation
51 24
     *
52
     * @param array $advices List of advices for this invocation
53 24
     */
54 24
    public function __construct(array $advices, string $className, string $methodName)
55 24
    {
56
        parent::__construct($advices);
57
        $this->reflectionMethod = $method = new AnnotatedReflectionMethod($className, $methodName);
58 24
59 4
        // Give an access to call protected method
60
        if ($method->isProtected()) {
61 24
            $method->setAccessible(true);
62
        }
63
    }
64
65
    /**
66
     * Invokes current method invocation with all interceptors
67
     *
68
     * @param null|object|string $instance          Invocation instance (class name for static methods)
69
     * @param array              $arguments         List of arguments for method invocation
70
     * @param array              $variadicArguments Additional list of variadic arguments
71
     *
72 20
     * @return mixed Result of invocation
73
     */
74 20
    final public function __invoke($instance = null, array $arguments = [], array $variadicArguments = [])
75 2
    {
76
        if ($this->level > 0) {
77
            $this->stackFrames[] = [$this->arguments, $this->scope, $this->instance, $this->current];
78 20
        }
79
80
        if (count($variadicArguments) > 0) {
81
            $arguments = array_merge($arguments, $variadicArguments);
82
        }
83 20
84
        try {
85 20
            ++$this->level;
86 20
87 20
            $this->current   = 0;
88
            $this->arguments = $arguments;
89 20
90
            $this->{static::$propertyName} = $instance;
91 20
92
            return $this->proceed();
93 20
        } finally {
94 20
            --$this->level;
95
96
            if ($this->level > 0) {
97
                [$this->arguments, $this->scope, $this->instance, $this->current] = array_pop($this->stackFrames);
98
            } else {
99
                $this->instance  = null;
100
                $this->arguments = [];
101
            }
102
        }
103
    }
104 3
105
    /**
106 3
     * Gets the method being called.
107
     *
108
     * @return AnnotatedReflectionMethod Covariant, the method being called.
109
     */
110
    public function getMethod(): AnnotatedReflectionMethod
111
    {
112
        return $this->reflectionMethod;
113
    }
114
115
    /**
116
     * Returns friendly description of this joinpoint
117
     */
118
    final public function __toString(): string
119
    {
120
        return sprintf(
121
            'execution(%s%s%s())',
122
            $this->getScope(),
123
            $this->reflectionMethod->isStatic() ? '::' : '->',
124
            $this->reflectionMethod->name
125 1
        );
126
    }
127
}
128