Issues (85)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/Configuration/ServiceProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Configuration;
6
7
use RuntimeException;
8
use SimpleSAML\XMLSecurity\Constants as C;
9
10
use function array_filter;
11
use function array_pop;
12
use function count;
13
use function sprintf;
14
15
/**
16
 * Basic Configuration Wrapper
17
 */
18
class ServiceProvider extends ArrayAdapter implements CertificateProvider, DecryptionProvider, EntityIdProvider
19
{
20
    /**
21
     * @return null|array|\Traversable
22
     */
23
    public function getKeys()
24
    {
25
        return $this->get('keys');
26
    }
27
28
29
    /**
30
     * @return null|string
31
     */
32
    public function getCertificateData(): ?string
33
    {
34
        return $this->get('certificateData');
35
    }
36
37
38
    /**
39
     * @return null|string
40
     */
41
    public function getCertificateFile(): ?string
42
    {
43
        return $this->get('certificateFile');
44
    }
45
46
47
    /**
48
     * @return array|\Traversable|null
49
     */
50
    public function getCertificateFingerprints()
51
    {
52
        return $this->get('certificateFingerprints');
53
    }
54
55
56
    /**
57
     * @return string|null
58
     */
59
    public function getEntityId(): ?string
60
    {
61
        return $this->get('entityId');
62
    }
63
64
65
    /**
66
     * @return null|bool
67
     */
68
    public function isAssertionEncryptionRequired(): ?bool
69
    {
70
        return $this->get('assertionEncryptionEnabled');
71
    }
72
73
74
    /**
75
     * @return null|string
76
     */
77
    public function getSharedKey(): ?string
78
    {
79
        return $this->get('sharedKey');
80
    }
81
82
83
    /**
84
     * @param string $name
85
     * @param bool $required
86
     * @return mixed|null
87
     */
88
    public function getPrivateKey(string $name, ?bool $required = null)
89
    {
90
        if ($required === null) {
91
            $required = false;
92
        }
93
        $privateKeys = $this->get('privateKeys');
94
        $key = array_filter($privateKeys, function (PrivateKey $key) use ($name) {
0 ignored issues
show
It seems like $privateKeys can also be of type null; however, parameter $array of array_filter() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

94
        $key = array_filter(/** @scrutinizer ignore-type */ $privateKeys, function (PrivateKey $key) use ($name) {
Loading history...
95
            return $key->getName() === $name;
96
        });
97
98
        $keyCount = count($key);
99
        if ($keyCount !== 1 && $required) {
100
            throw new RuntimeException(sprintf(
101
                'Attempted to get privateKey by name "%s", found "%d" keys, where only one was expected. Please '
102
                . 'verify that your configuration is correct',
103
                $name,
104
                $keyCount,
105
            ));
106
        }
107
108
        if (!$keyCount) {
109
            return null;
110
        }
111
112
        return array_pop($key);
113
    }
114
115
116
    /**
117
     * @return array
118
     */
119
    public function getBlacklistedAlgorithms(): array
120
    {
121
        return $this->get('blacklistedEncryptionAlgorithms', [C::KEY_TRANSPORT_RSA_1_5]);
122
    }
123
}
124