Issues (85)

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

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\ecp;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
10
use SimpleSAML\SAML2\XML\StringElementTrait;
11
use SimpleSAML\SOAP\Constants as C;
12
use SimpleSAML\XML\Exception\InvalidDOMElementException;
13
use SimpleSAML\XML\Exception\MissingAttributeException;
14
use SimpleSAML\XML\SchemaValidatableElementInterface;
15
use SimpleSAML\XML\SchemaValidatableElementTrait;
16
17
/**
18
 * Class representing the ECP RelayState element.
19
 *
20
 * @package simplesamlphp/saml2
21
 */
22
final class RelayState extends AbstractEcpElement implements SchemaValidatableElementInterface
23
{
24
    use SchemaValidatableElementTrait;
25
    use StringElementTrait;
0 ignored issues
show
The trait SimpleSAML\SAML2\XML\StringElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\ecp\RelayState: $localName, $namespaceURI
Loading history...
26
27
    /**
28
     * Create a ECP RelayState element.
29
     *
30
     * @param string $relayState
31
     */
32
    public function __construct(
33
        string $relayState,
34
    ) {
35
        $this->setContent($relayState);
36
    }
37
38
39
    /**
40
     * Convert XML into a RelayState
41
     *
42
     * @param \DOMElement $xml The XML element we should load
43
     * @return static
44
     *
45
     * @throws \SimpleSAML\XML\Exception\InvalidDOMElementException
46
     *   if the qualified name of the supplied element is wrong
47
     * @throws \SimpleSAML\XML\Exception\MissingAttributeException
48
     *   if the supplied element is missing any of the mandatory attributes
49
     */
50
    public static function fromXML(DOMElement $xml): static
51
    {
52
        Assert::same($xml->localName, 'RelayState', InvalidDOMElementException::class);
53
        Assert::same($xml->namespaceURI, RelayState::NS, InvalidDOMElementException::class);
54
55
        // Assert required attributes
56
        Assert::true(
57
            $xml->hasAttributeNS(C::NS_SOAP_ENV_11, 'actor'),
58
            'Missing env:actor attribute in <ecp:RelayState>.',
59
            MissingAttributeException::class,
60
        );
61
        Assert::true(
62
            $xml->hasAttributeNS(C::NS_SOAP_ENV_11, 'mustUnderstand'),
63
            'Missing env:mustUnderstand attribute in <ecp:RelayState>.',
64
            MissingAttributeException::class,
65
        );
66
67
        $mustUnderstand = $xml->getAttributeNS(C::NS_SOAP_ENV_11, 'mustUnderstand');
68
        Assert::same(
69
            $mustUnderstand,
70
            '1',
71
            'Invalid value of env:mustUnderstand attribute in <ecp:RelayState>.',
72
            ProtocolViolationException::class,
73
        );
74
75
        $actor = $xml->getAttributeNS(C::NS_SOAP_ENV_11, 'actor');
76
        Assert::same(
77
            $actor,
78
            C::SOAP_ACTOR_NEXT,
79
            'Invalid value of env:actor attribute in <ecp:RelayState>.',
80
            ProtocolViolationException::class,
81
        );
82
83
        return new static($xml->textContent);
84
    }
85
86
87
    /**
88
     * Convert this ECP RelayState to XML.
89
     *
90
     * @param \DOMElement|null $parent The element we should append this element to.
91
     * @return \DOMElement
92
     */
93
    public function toXML(?DOMElement $parent = null): DOMElement
94
    {
95
        $e = $this->instantiateParentElement($parent);
96
        $e->setAttributeNS(C::NS_SOAP_ENV_11, 'env:mustUnderstand', '1');
97
        $e->setAttributeNS(C::NS_SOAP_ENV_11, 'env:actor', C::SOAP_ACTOR_NEXT);
98
        $e->textContent = $this->getContent();
99
100
        return $e;
101
    }
102
}
103