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/md/Extensions.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\md;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\SAML2\Utils\XPath;
10
use SimpleSAML\SAML2\XML\alg\AbstractAlgElement as ALG;
11
use SimpleSAML\SAML2\XML\alg\DigestMethod;
12
use SimpleSAML\SAML2\XML\alg\SigningMethod;
13
use SimpleSAML\SAML2\XML\emd\RepublishRequest;
14
use SimpleSAML\SAML2\XML\ExtensionsTrait;
15
use SimpleSAML\SAML2\XML\idpdisc\DiscoveryResponse;
16
use SimpleSAML\SAML2\XML\init\RequestInitiator;
17
use SimpleSAML\SAML2\XML\mdattr\EntityAttributes;
18
use SimpleSAML\SAML2\XML\mdrpi\AbstractMdrpiElement as MDRPI;
19
use SimpleSAML\SAML2\XML\mdrpi\PublicationInfo;
20
use SimpleSAML\SAML2\XML\mdrpi\PublicationPath;
21
use SimpleSAML\SAML2\XML\mdrpi\RegistrationInfo;
22
use SimpleSAML\SAML2\XML\mdui\AbstractMduiElement as MDUI;
23
use SimpleSAML\SAML2\XML\mdui\DiscoHints;
24
use SimpleSAML\SAML2\XML\mdui\UIInfo;
25
use SimpleSAML\SAML2\XML\shibmd\Scope;
26
use SimpleSAML\XML\Chunk;
27
use SimpleSAML\XML\SchemaValidatableElementInterface;
28
use SimpleSAML\XML\SchemaValidatableElementTrait;
29
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
30
use SimpleSAML\XMLSchema\XML\Constants\NS;
31
32
use function array_key_exists;
33
34
/**
35
 * Class for handling SAML2 metadata extensions.
36
 *
37
 * @package simplesamlphp/saml2
38
 */
39
final class Extensions extends AbstractMdElement implements SchemaValidatableElementInterface
40
{
41
    use ExtensionsTrait;
42
    use SchemaValidatableElementTrait;
43
44
45
    /** The namespace-attribute for the xs:any element */
46
    public const string XS_ANY_ELT_NAMESPACE = NS::OTHER;
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 46 at column 24
Loading history...
47
48
    /**
49
     * The exclusions for the xs:any element
50
     *
51
     * @var array<int, array<int, string>>
52
     */
53
    public const array XS_ANY_ELT_EXCLUSIONS = [
54
        ['urn:oasis:names:tc:SAML:2.0:assertion', '*'],
55
        ['urn:oasis:names:tc:SAML:2.0:metadata', '*'],
56
        ['urn:oasis:names:tc:SAML:2.0:protocol', '*'],
57
    ];
58
59
60
    /**
61
     * Create an Extensions object from its md:Extensions XML representation.
62
     *
63
     * For those supported extensions, an object of the corresponding class will be created.
64
     * The rest will be added as a \SimpleSAML\XML\Chunk object.
65
     *
66
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
67
     *   if the qualified name of the supplied element is wrong
68
     */
69
    public static function fromXML(DOMElement $xml): static
70
    {
71
        Assert::eq(
72
            $xml->namespaceURI,
73
            self::NS,
74
            'Unknown namespace \'' . strval($xml->namespaceURI) . '\' for Extensions element.',
75
            InvalidDOMElementException::class,
76
        );
77
        Assert::eq(
78
            $xml->localName,
79
            static::getClassName(static::class),
80
            'Invalid Extensions element \'' . $xml->localName . '\'',
81
            InvalidDOMElementException::class,
82
        );
83
        $ret = [];
84
        $supported = [
85
            RepublishRequest::NS => [
86
                'RepublishRequest' => RepublishRequest::class,
87
            ],
88
            DiscoveryResponse::NS => [
89
                'DiscoveryResponse' => DiscoveryResponse::class,
90
            ],
91
            Scope::NS => [
92
                'Scope' => Scope::class,
93
            ],
94
            EntityAttributes::NS => [
95
                'EntityAttributes' => EntityAttributes::class,
96
            ],
97
            MDRPI::NS => [
98
                'RegistrationInfo' => RegistrationInfo::class,
99
                'PublicationInfo' => PublicationInfo::class,
100
                'PublicationPath' => PublicationPath::class,
101
            ],
102
            MDUI::NS => [
103
                'UIInfo' => UIInfo::class,
104
                'DiscoHints' => DiscoHints::class,
105
            ],
106
            ALG::NS => [
107
                'DigestMethod' => DigestMethod::class,
108
                'SigningMethod' => SigningMethod::class,
109
            ],
110
            RequestInitiator::NS => [
111
                'RequestInitiator' => RequestInitiator::class,
112
            ],
113
        ];
114
115
        /** @var \DOMElement $node */
116
        foreach (XPath::xpQuery($xml, './*', XPath::getXPath($xml)) as $node) {
117
            if (
118
                array_key_exists($node->namespaceURI, $supported)
119
                && array_key_exists($node->localName, $supported[$node->namespaceURI])
120
            ) {
121
                $ret[] = $supported[$node->namespaceURI][$node->localName]::fromXML($node);
122
            } else {
123
                $ret[] = new Chunk($node);
124
            }
125
        }
126
127
        return new static($ret);
128
    }
129
}
130