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

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\DomainValue;
10
use SimpleSAML\SAML2\Type\SAMLStringValue;
11
use SimpleSAML\XML\SchemaValidatableElementInterface;
12
use SimpleSAML\XML\SchemaValidatableElementTrait;
13
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
14
15
/**
16
 * Class representing SAML2 SubjectLocality
17
 *
18
 * @package simplesamlphp/saml2
19
 */
20
final class SubjectLocality 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...
21
{
22
    use SchemaValidatableElementTrait;
23
24
25
    /**
26
     * Initialize an SubjectLocality.
27
     *
28
     * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $address
29
     * @param \SimpleSAML\SAML2\Type\DomainValue|null $dnsName
30
     */
31
    public function __construct(
32
        protected ?SAMLStringValue $address = null,
33
        protected ?DomainValue $dnsName = null,
34
    ) {
35
        Assert::nullOrIp($address?->getValue(), 'Invalid IP address');
36
    }
37
38
39
    /**
40
     * Collect the value of the address-property
41
     *
42
     * @return \SimpleSAML\SAML2\Type\SAMLStringValue|null
43
     */
44
    public function getAddress(): ?SAMLStringValue
45
    {
46
        return $this->address;
47
    }
48
49
50
    /**
51
     * Collect the value of the dnsName-property
52
     *
53
     * @return \SimpleSAML\SAML2\Type\DomainValue|null
54
     */
55
    public function getDnsName(): ?DomainValue
56
    {
57
        return $this->dnsName;
58
    }
59
60
61
    /**
62
     * Test if an object, at the state it's in, would produce an empty XML-element
63
     */
64
    public function isEmptyElement(): bool
65
    {
66
        return empty($this->getAddress())
67
            && empty($this->getDnsName());
68
    }
69
70
71
    /**
72
     * Convert XML into a SubjectLocality
73
     *
74
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
75
     *   if the qualified name of the supplied element is wrong
76
     */
77
    public static function fromXML(DOMElement $xml): static
78
    {
79
        Assert::same($xml->localName, 'SubjectLocality', InvalidDOMElementException::class);
80
        Assert::same($xml->namespaceURI, SubjectLocality::NS, InvalidDOMElementException::class);
81
82
        return new static(
83
            self::getOptionalAttribute($xml, 'Address', SAMLStringValue::class, null),
84
            self::getOptionalAttribute($xml, 'DNSName', DomainValue::class, null),
85
        );
86
    }
87
88
89
    /**
90
     * Convert this SubjectLocality to XML.
91
     */
92
    public function toXML(?DOMElement $parent = null): DOMElement
93
    {
94
        $e = $this->instantiateParentElement($parent);
95
96
        if ($this->getAddress() !== null) {
97
            $e->setAttribute('Address', $this->getAddress()->getValue());
98
        }
99
100
        if ($this->getDnsName() !== null) {
101
            $e->setAttribute('DNSName', $this->getDnsName()->getValue());
102
        }
103
104
        return $e;
105
    }
106
}
107