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/mdrpi/PublicationPath.php (4 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\mdrpi;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\SAML2\Exception\ArrayValidationException;
10
use SimpleSAML\XML\ArrayizableElementInterface;
11
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...
12
use SimpleSAML\XML\SchemaValidatableElementInterface;
13
use SimpleSAML\XML\SchemaValidatableElementTrait;
14
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
15
16
/**
17
 * Class for handling the mdrpi:PublicationPath element.
18
 *
19
 * @link: http://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/saml-metadata-rpi-v1.0.pdf
20
 *
21
 * @package simplesamlphp/saml2
22
 */
23
final class PublicationPath extends AbstractMdrpiElement implements
0 ignored issues
show
The type SimpleSAML\SAML2\XML\mdrpi\AbstractMdrpiElement 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
    ArrayizableElementInterface,
25
    SchemaValidatableElementInterface
26
{
27
    use SchemaValidatableElementTrait;
28
29
30
    /**
31
     * Create/parse a mdrpi:PublicationPath element.
32
     *
33
     * @param \SimpleSAML\SAML2\XML\mdrpi\Publication[] $publication
34
     */
35
    public function __construct(
36
        protected array $publication = [],
37
    ) {
38
        Assert::maxCount($publication, C::UNBOUNDED_LIMIT);
39
        Assert::allIsInstanceOf($publication, Publication::class);
40
    }
41
42
43
    /**
44
     * Collect the value of the Publication-property
45
     *
46
     * @return \SimpleSAML\SAML2\XML\mdrpi\Publication[]
47
     */
48
    public function getPublication(): array
49
    {
50
        return $this->publication;
51
    }
52
53
54
    /**
55
     * Test if an object, at the state it's in, would produce an empty XML-element
56
     */
57
    public function isEmptyElement(): bool
58
    {
59
        return empty($this->publication);
60
    }
61
62
63
    /**
64
     * Convert XML into a PublicationPath
65
     *
66
     * @param \DOMElement $xml The XML element we should load
67
     * @return static
68
     *
69
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
70
     *   if the qualified name of the supplied element is wrong
71
     * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException
72
     *   if the supplied element is missing one of the mandatory attributes
73
     */
74
    public static function fromXML(DOMElement $xml): static
75
    {
76
        Assert::same($xml->localName, 'PublicationPath', InvalidDOMElementException::class);
77
        Assert::same($xml->namespaceURI, PublicationPath::NS, InvalidDOMElementException::class);
78
79
        $Publication = Publication::getChildrenOfClass($xml);
80
81
        return new static($Publication);
82
    }
83
84
85
    /**
86
     * Convert this element to XML.
87
     */
88
    public function toXML(?DOMElement $parent = null): DOMElement
89
    {
90
        $e = $this->instantiateParentElement($parent);
91
92
        foreach ($this->getPublication() as $pub) {
93
            $pub->toXML($e);
94
        }
95
96
        return $e;
97
    }
98
99
100
    /**
101
     * Create a class from an array
102
     *
103
     * @param array{array} $data
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{array} at position 2 could not be parsed: Expected ':' at position 2, but found 'array'.
Loading history...
104
     */
105
    public static function fromArray(array $data): static
106
    {
107
        Assert::allIsArray($data, ArrayValidationException::class);
108
109
        $publication = [];
110
        foreach ($data as $p) {
111
            $publication[] = Publication::fromArray($p);
112
        }
113
114
        return new static($publication);
115
    }
116
117
118
    /**
119
     * Create an array from this class
120
     *
121
     * @return array{array}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{array} at position 2 could not be parsed: Expected ':' at position 2, but found 'array'.
Loading history...
122
     */
123
    public function toArray(): array
124
    {
125
        $data = [];
126
        foreach ($this->getPublication() as $p) {
127
            $data[] = $p->toArray();
128
        }
129
130
        return $data;
131
    }
132
}
133