Issues (63)

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.

JmsSerializer/SourceSubscribingHandler.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
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license.
17
 */
18
namespace Elastification\Client\Serializer\JmsSerializer;
19
20
use JMS\Serializer\Context;
21
use JMS\Serializer\GraphNavigator;
22
use JMS\Serializer\Handler\SubscribingHandlerInterface;
23
use JMS\Serializer\JsonDeserializationVisitor;
24
25
/**
26
 * This handler enables us to dynamically inject a deserialization class for the _source element of the
27
 * elasticsearch response.
28
 *
29
 * @package Elastification\Client\Serializer\JmsSerializer
30
 * @author  Mario Mueller
31
 */
32
class SourceSubscribingHandler implements SubscribingHandlerInterface
33
{
34
    /**
35
     * @var string
36
     */
37
    private $sourceDeSerClass;
38
39
    /**
40
     * @param string $sourceDeSerClass
41
     */
42 11
    function __construct($sourceDeSerClass)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
43
    {
44 11
        $this->sourceDeSerClass = $sourceDeSerClass;
45 11
    }
46
47
    /**
48
     * Return format:
49
     *
50
     *      array(
51
     *          array(
52
     *              'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
53
     *              'format' => 'json',
54
     *              'type' => 'DateTime',
55
     *              'method' => 'serializeDateTimeToJson',
56
     *          ),
57
     *      )
58
     *
59
     * The direction and method keys can be omitted.
60
     *
61
     * @return array
62
     */
63 11
    public static function getSubscribingMethods()
64
    {
65
        return array(
66
            array(
67 11
                'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
68 11
                'format' => 'json',
69 11
                'type' => 'ElastificationSource',
70 11
                'method' => 'serializeElastificationSource',
71 11
            ),
72 11
        );
73
    }
74
75
    /**
76
     * @param JsonDeserializationVisitor $visitor
77
     * @param                            $data
78
     * @param array                      $type
79
     * @param Context                    $context
80
     *
81
     * @return mixed
82
     * @author Mario Mueller
83
     */
84 1
    public function serializeElastificationSource(
85
        JsonDeserializationVisitor $visitor,
86
        $data,
87
        array $type,
88
        Context $context
89
    ) {
90 1
        $this->sourceDeSerClass = empty($this->sourceDeSerClass) ? $type['name'] : $this->sourceDeSerClass;
91
92 1
        return $visitor->getNavigator()->accept($data, ['name' => $this->sourceDeSerClass], $context);
93
    }
94
95
    /**
96
     * @return string
97
     * @author Mario Mueller (autogenerated code)
98
     */
99 1
    public function getSourceDeSerClass()
100
    {
101 1
        return $this->sourceDeSerClass;
102
    }
103
104
    /**
105
     * @param string $sourceDeSerClass
106
     *
107
     * @return void
108
     * @author Mario Mueller (autogenerated code)
109
     */
110 5
    public function setSourceDeSerClass($sourceDeSerClass)
111
    {
112 5
        $this->sourceDeSerClass = $sourceDeSerClass;
113 5
    }
114
}
115