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/AuthzDecisionStatement.php (4 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\Constants as C;
0 ignored issues
show
The type SimpleSAML\SAML2\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...
10
use SimpleSAML\SAML2\Type\DecisionTypeValue;
0 ignored issues
show
The type SimpleSAML\SAML2\Type\DecisionTypeValue 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...
11
use SimpleSAML\XML\SchemaValidatableElementInterface;
12
use SimpleSAML\XML\SchemaValidatableElementTrait;
13
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
14
use SimpleSAML\XMLSchema\Exception\MissingElementException;
15
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
16
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
17
use SimpleSAML\XMLSchema\Type\AnyURIValue;
0 ignored issues
show
The type SimpleSAML\XMLSchema\Type\AnyURIValue 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...
18
19
use function array_pop;
20
use function strval;
21
22
/**
23
 * Class representing a SAML2 AuthzDecisionStatement
24
 *
25
 * @package simplesamlphp/saml2
26
 */
27
final class AuthzDecisionStatement extends AbstractStatementType implements SchemaValidatableElementInterface
28
{
29
    use SchemaValidatableElementTrait;
30
31
32
    /**
33
     * Initialize an AuthzDecisionStatement.
34
     *
35
     * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $resource
36
     * @param \SimpleSAML\SAML2\Type\DecisionTypeValue $decision
37
     * @param \SimpleSAML\SAML2\XML\saml\Action[] $action
38
     * @param \SimpleSAML\SAML2\XML\saml\Evidence|null $evidence
39
     */
40
    public function __construct(
41
        // Uses the base AnyURIValue because the SAML-specification allows this attribute to be an empty string
42
        protected AnyURIValue $resource,
43
        protected DecisionTypeValue $decision,
44
        protected array $action,
45
        protected ?Evidence $evidence = null,
46
    ) {
47
        Assert::maxCount($action, C::UNBOUNDED_LIMIT);
48
        Assert::allIsInstanceOf($action, Action::class, SchemaViolationException::class);
0 ignored issues
show
The type SimpleSAML\SAML2\XML\saml\Action 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...
49
    }
50
51
52
    /**
53
     * Collect the value of the resource-property
54
     *
55
     * @return \SimpleSAML\XMLSchema\Type\AnyURIValue
56
     */
57
    public function getResource(): AnyURIValue
58
    {
59
        return $this->resource;
60
    }
61
62
63
    /**
64
     * Collect the value of the decision-property
65
     *
66
     * @return \SimpleSAML\SAML2\Type\DecisionTypeValue
67
     */
68
    public function getDecision(): DecisionTypeValue
69
    {
70
        return $this->decision;
71
    }
72
73
74
    /**
75
     * Collect the value of the action-property
76
     *
77
     * @return \SimpleSAML\SAML2\XML\saml\Action[]
78
     */
79
    public function getAction(): array
80
    {
81
        return $this->action;
82
    }
83
84
85
    /**
86
     * Collect the value of the evidence-property
87
     *
88
     * @return \SimpleSAML\SAML2\XML\saml\Evidence|null
89
     */
90
    public function getEvidence(): ?Evidence
91
    {
92
        return $this->evidence;
93
    }
94
95
96
    /**
97
     * Convert XML into an AuthzDecisionStatement
98
     *
99
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
100
     *   if the qualified name of the supplied element is wrong
101
     * @throws \SimpleSAML\XMLSchema\Exception\MissingElementException
102
     *   if one of the mandatory child-elements is missing
103
     * @throws \Exception if the authentication instant is not a valid timestamp.
104
     */
105
    public static function fromXML(DOMElement $xml): static
106
    {
107
        Assert::same($xml->localName, 'AuthzDecisionStatement', InvalidDOMElementException::class);
108
        Assert::same($xml->namespaceURI, AuthzDecisionStatement::NS, InvalidDOMElementException::class);
109
110
        $action = Action::getChildrenOfClass($xml);
111
        Assert::minCount(
112
            $action,
113
            1,
114
            'Missing <saml:Action> in <saml:AuthzDecisionStatement>',
115
            MissingElementException::class,
116
        );
117
118
        $evidence = Evidence::getChildrenOfClass($xml);
119
        Assert::maxCount(
120
            $evidence,
121
            1,
122
            'Too many <saml:Evidence> in <saml:AuthzDecisionStatement>',
123
            TooManyElementsException::class,
124
        );
125
126
127
        return new static(
128
            self::getAttribute($xml, 'Resource', AnyURIValue::class),
129
            self::getAttribute($xml, 'Decision', DecisionTypeValue::class),
130
            $action,
131
            array_pop($evidence),
132
        );
133
    }
134
135
136
    /**
137
     * Convert this AuthzDecisionStatement to XML.
138
     */
139
    public function toXML(?DOMElement $parent = null): DOMElement
140
    {
141
        $e = $this->instantiateParentElement($parent);
142
143
        $e->setAttribute('Resource', strval($this->getResource()));
144
        $e->setAttribute('Decision', strval($this->getDecision()));
145
146
        foreach ($this->getAction() as $action) {
147
            $action->toXML($e);
148
        }
149
150
        if ($this->getEvidence() !== null && !$this->getEvidence()->isEmptyElement()) {
151
            $this->getEvidence()->toXML($e);
152
        }
153
154
        return $e;
155
    }
156
}
157