Issues (538)

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/XML/saml/AuthnContext.php (6 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\SAML2\XML\saml\AuthnContextClassRef;
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\AuthnContextClassRef was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use SimpleSAML\SAML2\XML\saml\AuthnContextDecl;
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\AuthnContextDecl was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use SimpleSAML\SAML2\XML\saml\AuthnContextDeclRef;
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\AuthnContextDeclRef was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use SimpleSAML\XML\Constants as C;
0 ignored issues
show
The type SimpleSAML\XML\Constants was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use SimpleSAML\XML\SchemaValidatableElementInterface;
14
use SimpleSAML\XML\SchemaValidatableElementTrait;
15
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
16
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
17
18
use function array_pop;
19
use function is_null;
20
21
/**
22
 * Class representing SAML2 AuthnContext
23
 *
24
 * @package simplesamlphp/saml2
25
 */
26
final class AuthnContext extends AbstractSamlElement implements SchemaValidatableElementInterface
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\AbstractSamlElement was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
{
28
    use SchemaValidatableElementTrait;
29
30
31
    /**
32
     * Initialize an AuthnContext.
33
     *
34
     * @param \SimpleSAML\SAML2\XML\saml\AuthnContextClassRef|null $authnContextClassRef
35
     * @param \SimpleSAML\SAML2\XML\saml\AuthnContextDecl|null $authnContextDecl
36
     * @param \SimpleSAML\SAML2\XML\saml\AuthnContextDeclRef|null $authnContextDeclRef
37
     * @param \SimpleSAML\SAML2\XML\saml\AuthenticatingAuthority[] $authenticatingAuthorities
38
     * @throws \SimpleSAML\Assert\AssertionFailedException
39
     */
40
    public function __construct(
41
        protected ?AuthnContextClassRef $authnContextClassRef,
42
        protected ?AuthnContextDecl $authnContextDecl,
43
        protected ?AuthnContextDeclRef $authnContextDeclRef,
44
        protected array $authenticatingAuthorities = [],
45
    ) {
46
        if (is_null($authnContextClassRef)) {
47
            Assert::false(
48
                is_null($authnContextDecl) && is_null($authnContextDeclRef),
49
                'You need either an AuthnContextDecl or an AuthnContextDeclRef',
50
            );
51
        }
52
        Assert::oneOf(
53
            null,
54
            [$authnContextDecl, $authnContextDeclRef],
55
            'Can only have one of AuthnContextDecl/AuthnContextDeclRef',
56
        );
57
58
        Assert::maxCount($authenticatingAuthorities, C::UNBOUNDED_LIMIT);
59
        Assert::allIsInstanceOf($authenticatingAuthorities, AuthenticatingAuthority::class);
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\AuthenticatingAuthority was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
60
    }
61
62
63
    /**
64
     * Collect the value of the authnContextClassRef-property
65
     *
66
     * @return \SimpleSAML\SAML2\XML\saml\AuthnContextClassRef|null
67
     */
68
    public function getAuthnContextClassRef(): ?AuthnContextClassRef
69
    {
70
        return $this->authnContextClassRef;
71
    }
72
73
74
    /**
75
     * Collect the value of the authnContextDeclRef-property
76
     *
77
     * @return \SimpleSAML\SAML2\XML\saml\AuthnContextDeclRef|null
78
     */
79
    public function getAuthnContextDeclRef(): ?AuthnContextDeclRef
80
    {
81
        return $this->authnContextDeclRef;
82
    }
83
84
85
    /**
86
     * Collect the value of the authnContextDecl-property
87
     *
88
     * @return \SimpleSAML\SAML2\XML\saml\AuthnContextDecl|null
89
     */
90
    public function getAuthnContextDecl(): ?AuthnContextDecl
91
    {
92
        return $this->authnContextDecl;
93
    }
94
95
96
    /**
97
     * Collect the value of the authenticatingAuthorities-property
98
     *
99
     * @return \SimpleSAML\SAML2\XML\saml\AuthenticatingAuthority[]
100
     */
101
    public function getAuthenticatingAuthorities(): array
102
    {
103
        return $this->authenticatingAuthorities;
104
    }
105
106
107
    /**
108
     * Convert XML into a AuthnContext
109
     *
110
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
111
     *   if the qualified name of the supplied element is wrong
112
     */
113
    public static function fromXML(DOMElement $xml): static
114
    {
115
        Assert::same($xml->localName, 'AuthnContext', InvalidDOMElementException::class);
116
        Assert::same($xml->namespaceURI, AuthnContext::NS, InvalidDOMElementException::class);
117
118
        $authnContextClassRef = AuthnContextClassRef::getChildrenOfClass($xml);
119
        Assert::maxCount(
120
            $authnContextClassRef,
121
            1,
122
            "More than one <saml:AuthnContextClassRef> found",
123
            TooManyElementsException::class,
124
        );
125
126
        $authnContextDeclRef = AuthnContextDeclRef::getChildrenOfClass($xml);
127
        Assert::maxCount(
128
            $authnContextDeclRef,
129
            1,
130
            "More than one <saml:AuthnContextDeclRef> found",
131
            TooManyElementsException::class,
132
        );
133
134
        $authnContextDecl = AuthnContextDecl::getChildrenOfClass($xml);
135
        Assert::maxCount(
136
            $authnContextDecl,
137
            1,
138
            "More than one <saml:AuthnContextDecl> found",
139
            TooManyElementsException::class,
140
        );
141
142
        $authorities = AuthenticatingAuthority::getChildrenOfClass($xml);
143
144
        return new static(
145
            array_pop($authnContextClassRef),
146
            array_pop($authnContextDecl),
147
            array_pop($authnContextDeclRef),
148
            $authorities,
149
        );
150
    }
151
152
153
    /**
154
     * Convert this AuthContextDeclRef to XML.
155
     */
156
    public function toXML(?DOMElement $parent = null): DOMElement
157
    {
158
        $e = $this->instantiateParentElement($parent);
159
160
        $this->getAuthnContextClassRef()?->toXML($e);
161
        $this->getAuthnContextDecl()?->toXML($e);
162
        $this->getAuthnContextDeclRef()?->toXML($e);
163
164
        foreach ($this->getAuthenticatingAuthorities() as $authority) {
165
            $authority->toXML($e);
166
        }
167
168
        return $e;
169
    }
170
}
171