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

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\mdui;
6
7
use SimpleSAML\Assert\Assert;
8
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
9
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
10
use SimpleSAML\SAML2\XML\StringElementTrait;
11
use SimpleSAML\XML\SchemaValidatableElementInterface;
12
use SimpleSAML\XML\SchemaValidatableElementTrait;
13
14
/**
15
 * Class implementing GeolocationHint.
16
 *
17
 * @package simplesamlphp/saml2
18
 */
19
final class GeolocationHint extends AbstractMduiElement implements SchemaValidatableElementInterface
20
{
21
    use SchemaValidatableElementTrait;
22
    use StringElementTrait;
0 ignored issues
show
The trait SimpleSAML\SAML2\XML\StringElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\mdui\GeolocationHint: $localName, $namespaceURI
Loading history...
23
24
25
    /**
26
     * @param string $content
27
     */
28
    public function __construct(string $content)
29
    {
30
        $this->setContent($content);
31
    }
32
33
34
    /**
35
     * Set the content of the element.
36
     *
37
     * @param string $content  The value to go in the XML textContent
38
     */
39
    protected function setContent(string $content): void
40
    {
41
        $sanitized = $this->sanitizeContent($content);
42
        $this->validateContent($sanitized);
43
44
        // Store the email address with any whitespace removed
45
        $this->content = $sanitized;
46
    }
47
48
49
    /**
50
     * Sanitize the content of the element.
51
     *
52
     * @param string $content  The unsanitized textContent
53
     * @throws \Exception on failure
54
     * @return string
55
     */
56
    protected function sanitizeContent(string $content): string
57
    {
58
        return preg_replace('/\s+/', '', $content);
59
    }
60
61
62
    /**
63
     * Validate the content of the element.
64
     *
65
     * @param string $content  The value to go in the XML textContent
66
     * @throws \Exception on failure
67
     * @return void
68
     */
69
    protected function validateContent(string $content): void
70
    {
71
        Assert::notWhitespaceOnly($content, ProtocolViolationException::class);
72
        // Assert::regex(
73
        //     $content,
74
        //     '/^geo:([-+]?\d+(?:\.\d+)?),([-+]?\d+(?:\.\d+)?)(?:\?z=(\d{1,2}))?$/',
75
        //     'Content is not a valid geolocation:  %s'
76
        // );
77
        // The regex above is incomplete, so for now we only test for a valid URI
78
        SAMLAssert::validURI($content);
79
    }
80
}
81