Issues (245)

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/Entities/Pointcuts/AdvisePointcut.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
/**
4
 * \AppserverIo\Doppelgaenger\Entities\Pointcut\AdvisePointcut
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Bernhard Wick <[email protected]>
15
 * @copyright 2015 TechDivision GmbH - <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io/doppelgaenger
18
 * @link      http://www.appserver.io/
19
 */
20
21
namespace AppserverIo\Doppelgaenger\Entities\Pointcuts;
22
23
use AppserverIo\Doppelgaenger\Dictionaries\ReservedKeywords;
24
25
/**
26
 * Pointcut for direct weaving of advice logic.
27
 * Can only be used with a qualified method signature e.g. \AppserverIo\Doppelgaenger\Logger->log(__METHOD__)
28
 *
29
 * @author    Bernhard Wick <[email protected]>
30
 * @copyright 2015 TechDivision GmbH - <[email protected]>
31
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
 * @link      https://github.com/appserver-io/doppelgaenger
33
 * @link      http://www.appserver.io/
34
 *
35
 * @Target({"METHOD","PROPERTY"})
36
 */
37
class AdvisePointcut extends AbstractSignaturePointcut
38
{
39
40
    /**
41
     * Whether or not the pointcut is considered static, meaning is has to be weaved and evaluated during runtime
42
     * anyway
43
     *
44
     * @var boolean IS_STATIC
45
     */
46
    const IS_STATIC = true;
47
48
    /**
49
     * The type of this pointcut
50
     *
51
     * @var string TYPE
52
     */
53
    const TYPE = 'advise';
54
55
    /**
56
     * Default constructor
57
     *
58
     * @param string  $expression String representing the expression defining this pointcut
59
     * @param boolean $isNegated  If any match made against this pointcut's expression has to be negated in its result
60
     */
61
    public function __construct($expression, $isNegated = false)
62
    {
63
        // clean any trailing brackets and proceed to parent constructor
64
        parent::__construct(rtrim($expression, '()'), $isNegated);
65
    }
66
67
    /**
68
     * Returns a string representing a boolean condition which can be used to determine if
69
     * the pointcut has to be executed
70
     *
71
     * @return string
72
     */
73
    public function getConditionString()
74
    {
75
        return 'true';
76
    }
77
78
    /**
79
     * Returns a string representing the actual execution of the pointcut logic
80
     *
81
     * @param string|null $assignTo Should the result be assigned and stored for later use? If so, to what?
82
     *
83
     * @return string
84
     */
85
    public function getExecutionString($assignTo = null)
86
    {
87
        $assignmentPrefix = '';
88
        if (!is_null($assignTo)) {
89
            $assignmentPrefix = $assignTo . ' = ';
90
        }
91
92
        // we have to test whether or not we need an instance of the used class first.
93
        // if the call is not static then we do
94
        $string = '';
95
        $expression = $this->getExpression();
96
        $invocationCode = '(' . ReservedKeywords::METHOD_INVOCATION_OBJECT . ')';
97
        if ($this->callType === self::CALL_TYPE_OBJECT) {
98
            // don't forget to create an instance first
99
            $variable = '$' . lcfirst(str_replace('\\', '', $this->structure));
100
            $string .= $variable . ' = new ' . str_replace('\\\\', '\\', $this->structure) . '();
101
            ';
102
            $string .= $assignmentPrefix . $variable . $this->callType . $this->function . $invocationCode . ';
103
            ';
104
0 ignored issues
show
Blank line found at end of control structure
Loading history...
105
        } else {
106
            $string .= $assignmentPrefix . $expression . $invocationCode . ';
107
            ';
108
        }
109
110
        return $string;
111
    }
112
113
    /**
114
     * Whether or not the pointcut matches a given candidate.
115
     * Will always return true, as we do not support regex here right now
116
     *
117
     * @param mixed $candidate Candidate to match against the pointcuts match pattern (getMatchPattern())
118
     *
119
     * @return boolean
120
     */
121
    public function matches($candidate)
122
    {
123
        return true;
124
    }
125
}
126