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/ecp/Request.php (4 issues)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\ecp;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
10
use SimpleSAML\SAML2\Type\SAMLStringValue;
11
use SimpleSAML\SAML2\XML\saml\Issuer;
12
use SimpleSAML\SAML2\XML\samlp\IDPList;
13
use SimpleSAML\SOAP11\Constants as C;
0 ignored issues
show
The type SimpleSAML\SOAP11\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...
14
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
0 ignored issues
show
The type SimpleSAML\SOAP11\Type\MustUnderstandValue 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...
15
use SimpleSAML\XML\SchemaValidatableElementInterface;
16
use SimpleSAML\XML\SchemaValidatableElementTrait;
17
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
18
use SimpleSAML\XMLSchema\Exception\MissingAttributeException;
19
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
20
use SimpleSAML\XMLSchema\Type\BooleanValue;
0 ignored issues
show
The type SimpleSAML\XMLSchema\Type\BooleanValue 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...
21
22
use function intval;
23
use function strval;
24
25
/**
26
 * Class representing the ECP Request element.
27
 *
28
 * @package simplesamlphp/saml2
29
 */
30
final class Request extends AbstractEcpElement implements SchemaValidatableElementInterface
0 ignored issues
show
The type SimpleSAML\SAML2\XML\ecp\AbstractEcpElement 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...
31
{
32
    use SchemaValidatableElementTrait;
33
34
35
    /**
36
     * Create a ECP Request element.
37
     *
38
     * @param \SimpleSAML\SAML2\XML\saml\Issuer $issuer
39
     * @param \SimpleSAML\SAML2\XML\samlp\IDPList|null $idpList
40
     * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $providerName
41
     * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $isPassive
42
     */
43
    public function __construct(
44
        protected Issuer $issuer,
45
        protected ?IDPList $idpList = null,
46
        protected ?SAMLStringValue $providerName = null,
47
        protected ?BooleanValue $isPassive = null,
48
    ) {
49
    }
50
51
52
    /**
53
     * Collect the value of the isPassive-property
54
     *
55
     * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null
56
     */
57
    public function getIsPassive(): ?BooleanValue
58
    {
59
        return $this->isPassive;
60
    }
61
62
63
    /**
64
     * Collect the value of the providerName-property
65
     *
66
     * @return \SimpleSAML\SAML2\Type\SAMLStringValue|null
67
     */
68
    public function getProviderName(): ?SAMLStringValue
69
    {
70
        return $this->providerName;
71
    }
72
73
74
    /**
75
     * Collect the value of the issuer-property
76
     *
77
     * @return \SimpleSAML\SAML2\XML\saml\Issuer
78
     */
79
    public function getIssuer(): Issuer
80
    {
81
        return $this->issuer;
82
    }
83
84
85
    /**
86
     * Collect the value of the idpList-property
87
     *
88
     * @return \SimpleSAML\SAML2\XML\samlp\IDPList|null
89
     */
90
    public function getIDPList(): ?IDPList
91
    {
92
        return $this->idpList;
93
    }
94
95
96
    /**
97
     * Convert XML into a Request
98
     *
99
     * @param \DOMElement $xml The XML element we should load
100
     *
101
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
102
     *   if the qualified name of the supplied element is wrong
103
     * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException
104
     *   if the supplied element is missing any of the mandatory attributes
105
     */
106
    public static function fromXML(DOMElement $xml): static
107
    {
108
        Assert::same($xml->localName, 'Request', InvalidDOMElementException::class);
109
        Assert::same($xml->namespaceURI, Request::NS, InvalidDOMElementException::class);
110
111
        // Assert required attributes
112
        Assert::true(
113
            $xml->hasAttributeNS(C::NS_SOAP_ENV, 'actor'),
114
            'Missing env:actor attribute in <ecp:Request>.',
115
            MissingAttributeException::class,
116
        );
117
        Assert::true(
118
            $xml->hasAttributeNS(C::NS_SOAP_ENV, 'mustUnderstand'),
119
            'Missing env:mustUnderstand attribute in <ecp:Request>.',
120
            MissingAttributeException::class,
121
        );
122
123
        MustUnderstandValue::fromString($xml->getAttributeNS(C::NS_SOAP_ENV, 'mustUnderstand'));
124
125
        Assert::same(
126
            $xml->getAttributeNS(C::NS_SOAP_ENV, 'actor'),
127
            C::SOAP_ACTOR_NEXT,
128
            'Invalid value of env:actor attribute in <ecp:Request>.',
129
            ProtocolViolationException::class,
130
        );
131
132
        $issuer = Issuer::getChildrenOfClass($xml);
133
        Assert::count(
134
            $issuer,
135
            1,
136
            'More than one <saml:Issuer> in <ecp:Request>.',
137
            TooManyElementsException::class,
138
        );
139
140
        $idpList = IDPList::getChildrenOfClass($xml);
141
142
        return new static(
143
            array_pop($issuer),
144
            array_pop($idpList),
145
            self::getOptionalAttribute($xml, 'ProviderName', SAMLStringValue::class, null),
146
            self::getOptionalAttribute($xml, 'IsPassive', BooleanValue::class, null),
147
        );
148
    }
149
150
151
    /**
152
     * Convert this ECP SubjectConfirmation to XML.
153
     *
154
     * @param \DOMElement|null $parent The element we should append this element to.
155
     */
156
    public function toXML(?DOMElement $parent = null): DOMElement
157
    {
158
        $e = $this->instantiateParentElement($parent);
159
        $e->setAttributeNS(C::NS_SOAP_ENV, 'SOAP-ENV:mustUnderstand', '1');
160
        $e->setAttributeNS(C::NS_SOAP_ENV, 'SOAP-ENV:actor', C::SOAP_ACTOR_NEXT);
161
162
        if ($this->getProviderName() !== null) {
163
            $e->setAttribute('ProviderName', $this->getProviderName()->getValue());
164
        }
165
166
        if ($this->getIsPassive() !== null) {
167
            $e->setAttribute('IsPassive', strval(intval($this->getIsPassive()->toBoolean())));
168
        }
169
170
        $this->getIssuer()->toXML($e);
171
        $this->getIDPList()?->toXML($e);
172
173
        return $e;
174
    }
175
}
176