Issues (43)

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/SimpleUPS/Service.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 namespace SimpleUPS;
2
3
/**
4
 * The type of service a shipment was shipped with
5
 * @since 1.0
6
 */
7
class Service extends Model
8
{
9
10
    const
11
        NEXT_DAY_AIR_EARLY_AM = '14',
12
        NEXT_DAY_AIR = '01',
13
        NEXT_DAY_AIR_SAVER = '13',
14
        SECOND_DAY_AIR_AM = '59',
15
        SECOND_DAY_AIR = '02',
16
        THREE_DAY_SELECT = '12',
17
        GROUND = '03',
18
19
        INT_STANDARD = '11',
20
        INT_WORLDWIDE_EXPRESS = '07',
21
        INT_WORLDWIDE_EXPRESS_PLUS = '54',
22
        INT_WORLDWIDE_EXPEDITED = '08',
23
        INT_SAVER = '65',
24
25
        POLAND_TODAY_STANDARD = '82',
26
        POLAND_TODAY_DEDICATED_COURIER = '83',
27
        POLAND_TODAY_INTERCITY = '84',
28
        POLAND_TODAY_EXPRESS = '85',
29
        POLAND_TODAY_EXPRESS_SAVER = '86',
30
        POLAND_WORLDWIDE_EXPRESS_FREIGHT = '96';
31
32
    private
33
        /* @var string $code */
34
        $code,
35
36
        /* @var string $description */
37
        $description,
38
39
        $descriptions = array(
40
        '14' => 'Next Day Air Early AM',
41
        '01' => 'Next Day Air',
42
        '13' => 'Next Day Air Saver',
43
        '59' => 'Second Day Air AM',
44
        '02' => 'Second Day Air',
45
        '12' => 'Three Day Select',
46
        '03' => 'Ground',
47
        '11' => 'International Standard',
48
        '07' => 'International Worldwide Express',
49
        '54' => 'International Worldwide Express Plus',
50
        '08' => 'International Worldwide Expedited',
51
        '65' => 'International Saver',
52
        '82' => 'Poland Today Standard',
53
        '83' => 'Poland Today Dedicated Courier',
54
        '84' => 'Poland Today Intercity',
55
        '85' => 'Poland Today Express',
56
        '86' => 'Poland Today Express Saver',
57
        '96' => 'Poland Worldwide Express Freight'
58
    );
59
60
    /**
61
     * Set the service code
62
     * @internal
63
     *
64
     * @param string $code
65
     *
66
     * @return Service
67
     */
68
    public function setCode($code)
69
    {
70
        $this->code = (string)$code;
71
72
        if ($this->description === null && isset($this->descriptions[$this->code])) {
73
            $this->description = $this->descriptions[$this->code];
74
        }
75
76
        return $this;
77
    }
78
79
    /**
80
     * Get the service code
81
     * @return string
82
     */
83
    public function getCode()
84
    {
85
        return $this->code;
86
    }
87
88
    /**
89
     * Set the service description
90
     * @internal
91
     *
92
     * @param string $description
93
     *
94
     * @return Service
95
     */
96
    public function setDescription($description)
97
    {
98
        $this->description = (string)$description;
99
        return $this;
100
    }
101
102
    /**
103
     * Get the service description
104
     * @return string
105
     */
106
    public function getDescription()
107
    {
108
        return $this->description;
109
    }
110
111
    /**
112
     * Get service as XML
113
     * @internal
114
     *
115
     * @param \DomDocument $dom
116
     *
117
     * @return \DOMElement
118
     */
119
    public function toXml(\DomDocument $dom)
120
    {
121
        $shipper = $dom->createElement('Service');
122
123
        if ($this->getCode() != null) {
124
            $shipper->appendChild($dom->createElement('Code', $this->getCode()));
125
        }
126
127
        if ($this->getDescription() != null) {
128
            $shipper->appendChild($dom->createElement('Description', $this->getDescription()));
129
        }
130
131
        return $shipper;
132
    }
133
134
    /**
135
     * Get this object from XML
136
     * @internal
137
     *
138
     * @param \SimpleXMLElement $xml
139
     *
140
     * @return Service
141
     */
142 View Code Duplication
    public static function fromXml(\SimpleXMLElement $xml)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
143
    {
144
        $service = new Service();
145
        $service->setIsResponse();
146
        $service->setCode($xml->Code);
147
148
        if (isset($xml->Description)) {
149
            $service->setDescription($xml->Description);
150
        }
151
152
        return $service;
153
    }
154
}