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/SubjectConfirmation.php (2 issues)

Labels
Severity
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\Type\SAMLAnyURIValue;
10
use SimpleSAML\SAML2\XML\IdentifierTrait;
11
use SimpleSAML\XML\SchemaValidatableElementInterface;
12
use SimpleSAML\XML\SchemaValidatableElementTrait;
13
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
14
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
15
16
use function array_pop;
17
18
/**
19
 * Class representing SAML 2 SubjectConfirmation element.
20
 *
21
 * @package simplesamlphp/saml2
22
 */
23
final class SubjectConfirmation 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...
24
{
25
    use IdentifierTrait;
26
    use SchemaValidatableElementTrait;
27
28
29
    /**
30
     * Initialize (and parse) a SubjectConfirmation element.
31
     *
32
     * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $method
33
     * @param \SimpleSAML\SAML2\XML\saml\IdentifierInterface|null $identifier
34
     * @param \SimpleSAML\SAML2\XML\saml\SubjectConfirmationData|null $subjectConfirmationData
35
     */
36
    public function __construct(
37
        protected SAMLAnyURIValue $method,
38
        ?IdentifierInterface $identifier = null,
39
        protected ?SubjectConfirmationData $subjectConfirmationData = null,
40
    ) {
41
        $this->setIdentifier($identifier);
42
    }
43
44
45
    /**
46
     * Collect the value of the Method-property
47
     *
48
     * @return \SimpleSAML\SAML2\Type\SAMLAnyURIValue
49
     */
50
    public function getMethod(): SAMLAnyURIValue
51
    {
52
        return $this->method;
53
    }
54
55
56
    /**
57
     * Collect the value of the SubjectConfirmationData-property
58
     *
59
     * @return \SimpleSAML\SAML2\XML\saml\SubjectConfirmationData|null
60
     */
61
    public function getSubjectConfirmationData(): ?SubjectConfirmationData
62
    {
63
        return $this->subjectConfirmationData;
64
    }
65
66
67
    /**
68
     * Convert XML into a SubjectConfirmation
69
     *
70
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
71
     *   if the qualified name of the supplied element is wrong
72
     * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException
73
     *   if the supplied element is missing one of the mandatory attributes
74
     * @throws \SimpleSAML\XMLSchema\Exception\TooManyElementsException
75
     *   if too many child-elements of a type are specified
76
     */
77
    public static function fromXML(DOMElement $xml): static
78
    {
79
        Assert::same($xml->localName, 'SubjectConfirmation', InvalidDOMElementException::class);
80
        Assert::same($xml->namespaceURI, SubjectConfirmation::NS, InvalidDOMElementException::class);
81
82
        $subjectConfirmationData = SubjectConfirmationData::getChildrenOfClass($xml);
83
        Assert::maxCount(
84
            $subjectConfirmationData,
85
            1,
86
            'More than one <saml:SubjectConfirmationData> in <saml:SubjectConfirmation>.',
87
            TooManyElementsException::class,
88
        );
89
90
        return new static(
91
            self::getAttribute($xml, 'Method', SAMLAnyURIValue::class),
92
            self::getIdentifierFromXML($xml),
93
            array_pop($subjectConfirmationData),
94
        );
95
    }
96
97
98
    /**
99
     * Convert this element to XML.
100
     */
101
    public function toXML(?DOMElement $parent = null): DOMElement
102
    {
103
        $e = $this->instantiateParentElement($parent);
104
        $e->setAttribute('Method', $this->getMethod()->getValue());
105
106
        $this->getIdentifier()?->toXML($e);
0 ignored issues
show
The method toXML() does not exist on SimpleSAML\SAML2\XML\saml\IdentifierInterface. It seems like you code against a sub-type of said class. However, the method does not exist in SimpleSAML\SAML2\XML\saml\BaseIdentifierInterface. Are you sure you never get one of those? ( Ignorable by Annotation )

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

106
        $this->getIdentifier()?->/** @scrutinizer ignore-call */ toXML($e);
Loading history...
107
108
        if ($this->getSubjectConfirmationData() !== null && !$this->getSubjectConfirmationData()->isEmptyElement()) {
109
            $this->getSubjectConfirmationData()->toXML($e);
110
        }
111
112
        return $e;
113
    }
114
}
115