Issues (5)

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.

ExchangeRate.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
 * (c) itmedia.by <[email protected]>
4
 */
5
6
namespace Submarine\NbrbExchangeRatesBundle;
7
8
/**
9
 * Курс обмена
10
 * Class ExchangeRate
11
 * @package Submarine\NbrbParserBundle
12
 */
13
class ExchangeRate
14
{
15
16
    /**
17
     * Внутренний код валюты
18
     * @var int
19
     */
20
    private $id;
21
22
    /**
23
     * цифровой код
24
     * @var int
25
     */
26
    private $numCode;
27
28
    /**
29
     * буквенный код
30
     * @var string
31
     */
32
    private $charCode;
33
34
    /**
35
     * номинал
36
     * @var int
37
     */
38
    private $scale;
39
40
    /**
41
     * наименование валюты
42
     * @var string
43
     */
44
    private $name;
45
46
    /**
47
     * курс
48
     * @var float
49
     */
50
    private $rate;
51
52
    /**
53
     * @var \DateTime
54
     */
55
    private $date;
56
57
    /**
58
     * ExchangeRate constructor.
59
     * @param int $id
60
     * @param int $numCode
61
     * @param string $charCode
62
     * @param int $scale
63
     * @param string $name
64
     * @param float $rate
65
     * @param \DateTime $date
66
     */
67
    public function __construct($id, $numCode, $charCode, $scale, $name, $rate, \DateTime $date)
68
    {
69
        $this->id = $id;
70
        $this->numCode = $numCode;
71
        $this->charCode = $charCode;
72
        $this->scale = $scale;
73
        $this->name = $name;
74
        $this->rate = $rate;
75
        $this->date = $date;
76
    }
77
78
79
    static public function createFromXML(\SimpleXMLElement $xmlElement = null, \DateTime $date)
80
    {
81
        return new ExchangeRate(
82
            (int)$xmlElement->attributes()[0],
0 ignored issues
show
It seems like $xmlElement is not always an object, but can also be of type null. Maybe add an additional type check?

If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe:

function someFunction(A $objectMaybe = null)
{
    if ($objectMaybe instanceof A) {
        $objectMaybe->doSomething();
    }
}
Loading history...
83
            (int)$xmlElement->NumCode,
84
            (string)$xmlElement->CharCode,
85
            (int)$xmlElement->Scale,
86
            (string)($xmlElement->Name ?: $xmlElement->QuotName),
87
            (float)$xmlElement->Rate,
88
            $date
89
        );
90
    }
91
92
93
    /**
94
     * @return int
95
     */
96
    public function getId()
97
    {
98
        return $this->id;
99
    }
100
101
    /**
102
     * @return int
103
     */
104
    public function getNumCode()
105
    {
106
        return $this->numCode;
107
    }
108
109
110
    /**
111
     * @return string
112
     */
113
    public function getCharCode()
114
    {
115
        return $this->charCode;
116
    }
117
118
    /**
119
     * @return string
120
     */
121
    public function getName()
122
    {
123
        return $this->name;
124
    }
125
126
    /**
127
     * @return float
128
     */
129
    public function getRate()
130
    {
131
        return $this->rate;
132
    }
133
134
    /**
135
     * @return int
136
     */
137
    public function getScale()
138
    {
139
        return $this->scale;
140
    }
141
142
    /**
143
     * @return \DateTime
144
     */
145
    public function getDate()
146
    {
147
        return $this->date;
148
    }
149
150
151
}