Issues (1208)

Security Analysis    not enabled

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/LightSaml/Credential/AbstractCredential.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
 * This file is part of the LightSAML-Core package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace LightSaml\Credential;
13
14
use LightSaml\Credential\Context\CredentialContextSet;
15
use RobRichards\XMLSecLibs\XMLSecurityKey;
16
17
abstract class AbstractCredential implements CredentialInterface
18
{
19
    /** @var string */
20
    private $entityId;
21
22
    /** @var string */
23
    private $usageType;
24
25
    /** @var string[] */
26
    private $keyNames = array();
27
28
    /** @var XMLSecurityKey|null */
29
    private $publicKey;
30
31
    /** @var XMLSecurityKey|null */
32
    private $privateKey;
33
34
    /** @var string|null */
35
    private $secretKey;
36
37
    /** @var CredentialContextSet */
38
    private $credentialContext;
39
40 27
    public function __construct()
41
    {
42 27
        $this->credentialContext = new CredentialContextSet();
43 27
    }
44
45
    /**
46
     * @return string
47
     */
48 14
    public function getEntityId()
49
    {
50 14
        return $this->entityId;
51
    }
52
53
    /**
54
     * One of UsageType constants.
55
     *
56
     * @return string|null
57
     */
58 12
    public function getUsageType()
59
    {
60 12
        return $this->usageType;
61
    }
62
63
    /**
64
     * @return string[]
65
     */
66 3
    public function getKeyNames()
67
    {
68 3
        return $this->keyNames;
69
    }
70
71
    /**
72
     * @return XMLSecurityKey|null
73
     */
74 10
    public function getPublicKey()
75
    {
76 10
        return $this->publicKey;
77
    }
78
79
    /**
80
     * @return XMLSecurityKey|null
81
     */
82 15
    public function getPrivateKey()
83
    {
84 15
        return $this->privateKey;
85
    }
86
87
    /**
88
     * @return string|null
89
     */
90 1
    public function getSecretKey()
91
    {
92 1
        return $this->secretKey;
93
    }
94
95
    /**
96
     * @return CredentialContextSet
97
     */
98 11
    public function getCredentialContext()
99
    {
100 11
        return $this->credentialContext;
101
    }
102
103
    /**
104
     * @param CredentialContextSet $credentialContext
105
     *
106
     * @return AbstractCredential
107
     */
108 8
    public function setCredentialContext(CredentialContextSet $credentialContext)
109
    {
110 8
        $this->credentialContext = $credentialContext;
111
112 8
        return $this;
113
    }
114
115
    /**
116
     * @param string $entityId
117
     *
118
     * @return AbstractCredential
119
     */
120 20
    public function setEntityId($entityId)
121
    {
122 20
        $this->entityId = $entityId;
123
124 20
        return $this;
125
    }
126
127
    /**
128
     * @param \string[] $keyNames
129
     *
130
     * @return AbstractCredential
131
     */
132 22
    public function setKeyNames(array $keyNames)
133
    {
134 22
        $this->keyNames = $keyNames;
0 ignored issues
show
Documentation Bug introduced by
It seems like $keyNames of type array<integer,object<string>> is incompatible with the declared type array<integer,string> of property $keyNames.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
135
136 22
        return $this;
137
    }
138
139
    /**
140
     * @param string $keyName
141
     *
142
     * @return AbstractCredential
143
     */
144 9
    public function addKeyName($keyName)
145
    {
146 9
        $keyName = trim($keyName);
147 9
        if ($keyName) {
148 9
            $this->keyNames[] = $keyName;
149
        }
150
151 9
        return $this;
152
    }
153
154
    /**
155
     * @param null|XMLSecurityKey $privateKey
156
     *
157
     * @return AbstractCredential
158
     */
159 21
    public function setPrivateKey(XMLSecurityKey $privateKey)
160
    {
161 21
        $this->privateKey = $privateKey;
162
163 21
        return $this;
164
    }
165
166
    /**
167
     * @param null|XMLSecurityKey $publicKey
168
     *
169
     * @return AbstractCredential
170
     */
171 22
    public function setPublicKey(XMLSecurityKey $publicKey)
172
    {
173 22
        $this->publicKey = $publicKey;
174
175 22
        return $this;
176
    }
177
178
    /**
179
     * @param null|string $secretKey
180
     *
181
     * @return AbstractCredential
182
     */
183 1
    public function setSecretKey($secretKey)
184
    {
185 1
        $this->secretKey = $secretKey;
186
187 1
        return $this;
188
    }
189
190
    /**
191
     * @param string $usageType
192
     *
193
     * @return AbstractCredential
194
     */
195 11
    public function setUsageType($usageType)
196
    {
197 11
        $this->usageType = $usageType;
198
199 11
        return $this;
200
    }
201
}
202