Issues (28)

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/Iris/SaleWrapper/Base.php (1 issue)

Labels
Severity

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
namespace Iris\SaleWrapper;
4
5
abstract class Base
6
{
7
    /**
8
     * @var \Iris\Manager
9
     */
10
    private $manager;
11
12
    /**
13
     * @var \Iris\Mapping\Order
14
     */
15
    private $orderMapping;
16
17
    /**
18
     * @param \Iris\Manager $manager
19
     */
20 31
    public function __construct(\Iris\Manager $manager)
21
    {
22 31
        $this->manager = $manager;
23 31
    }
24
25
    /**
26
     * @return \Iris\Interfaces\Order
27
     */
28 12
    public function getOrderService()
29
    {
30 12
        return $this->getManager()->getService(\Iris\Factory::ORDER);
31
    }
32
33
    /**
34
     * @return \Iris\Api\PartnerClient
35
     */
36 4
    public function getPartnerApiClient()
37
    {
38 4
        return $this->getManager()->getPartnerApiClient();
39
    }
40
41
    /**
42
     * @return \Iris\Api\VentureClient
43
     */
44 8
    public function getVentureApiClient()
45
    {
46 8
        return $this->getManager()->getVentureApiClient();
47
    }
48
49
    /**
50
     * @return \Iris\Manager
51
     */
52 30
    public function getManager()
53
    {
54 30
        return $this->manager;
55
    }
56
57
    /**
58
     * Check if method exists in current context.
59
     * @param string $methodName
60
     * @return bool
61
     */
62
    protected function canCall($methodName)
63
    {
64
        if (!method_exists($this, $methodName)) {
65
            throw new \Iris\Exceptions\MethodNotAllowed($methodName, $this->getName());
0 ignored issues
show
The method getName() does not seem to exist on object<Iris\SaleWrapper\Base>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
66
        }
67
        return true;
68
    }
69
70
    /**
71
     * @param string $methodName
72
     * @param array  $data
73
     * @return array
74
     */
75
    final public function call($methodName, array $data = array())
76
    {
77
        $this->canCall($methodName);
78
79
        $ref = new \ReflectionObject($this);
80
        $method = $ref->getMethod($methodName);
81
82
        $args = $this->mappingArguments($method, $data);
83
84
        return $method->invokeArgs($this, $args);
85
    }
86
87
    /**
88
     * @param \ReflectionMethod $method
89
     * @param array            $data
90
     * @return array
91
     * @throws \Iris\Exceptions\ParameterNotFound
92
     */
93
    final protected function mappingArguments(\ReflectionMethod $method, array $data)
94
    {
95
        $parameters = $method->getParameters();
96
        $args = [];
97
        foreach ($parameters as $parameter) {
98
            $parameterName = mb_strtolower(preg_replace('/([A-Z])/', '_\1', $parameter->name));
99
            $this->validateArgument($parameterName, $method, $data);
100
            $args[$parameter->name] = $data[$parameterName];
101
        }
102
        return $args;
103
    }
104
105
    /**
106
     * @param $parameterName
107
     * @param \ReflectionMethod $method
108
     * @param $data
109
     * @return void
110
     * @throws \Iris\Exceptions\ParameterNotFound
111
     */
112
    final protected function validateArgument($parameterName, \ReflectionMethod $method, $data)
113
    {
114
        if (!isset($data[$parameterName])) {
115
            throw new \Iris\Exceptions\ParameterNotFound($parameterName, $method->name);
116
        }
117
    }
118
119
    /**
120
     * @return \Iris\Mapping\Order
121
     */
122 3
    public function getOrderMapping()
123
    {
124 3
        $this->orderMapping || $this->setOrderMapping(\Iris\Mapping\Order::getInstance());
125 3
        return $this->orderMapping;
126
    }
127
128
    /**
129
     * @param \Iris\Mapping\Order $map
130
     * @return \Iris\SaleWrapper\Venture
131
     */
132 3
    public function setOrderMapping(\Iris\Mapping\Order $map)
133
    {
134 3
        $this->orderMapping = $map;
135 3
        return $this;
136
    }
137
}
138