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

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\alg;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Assert\Assert;
9
use SimpleSAML\SAML2\Type\SAMLAnyURIValue;
10
use SimpleSAML\XML\ExtendableElementTrait;
11
use SimpleSAML\XML\SchemaValidatableElementInterface;
12
use SimpleSAML\XML\SchemaValidatableElementTrait;
13
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
14
use SimpleSAML\XMLSchema\XML\Constants\NS;
15
16
/**
17
 * Class for handling the alg:DigestMethod element.
18
 *
19
 * @link http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-metadata-algsupport.pdf
20
 *
21
 * @package simplesamlphp/saml2
22
 */
23
final class DigestMethod extends AbstractAlgElement implements SchemaValidatableElementInterface
24
{
25
    use ExtendableElementTrait;
26
    use SchemaValidatableElementTrait;
27
28
29
    /** The namespace-attribute for the xs:any element */
30
    public const string XS_ANY_ELT_NAMESPACE = NS::ANY;
0 ignored issues
show
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 30 at column 24
Loading history...
31
32
33
    /**
34
     * Create/parse an alg:DigestMethod element.
35
     *
36
     * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $algorithm
37
     * @param \SimpleSAML\XML\Chunk[] $elements
38
     */
39
    public function __construct(
40
        protected SAMLAnyURIValue $algorithm,
41
        array $elements = [],
42
    ) {
43
        $this->setElements($elements);
44
    }
45
46
47
    /**
48
     * Collect the value of the algorithm-property
49
     *
50
     * @return \SimpleSAML\SAML2\Type\SAMLAnyURIValue
51
     */
52
    public function getAlgorithm(): SAMLAnyURIValue
53
    {
54
        return $this->algorithm;
55
    }
56
57
58
    /**
59
     * Convert XML into a DigestMethod
60
     *
61
     * @param \DOMElement $xml The XML element we should load
62
     *
63
     * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
64
     *   if the qualified name of the supplied element is wrong
65
     * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException
66
     *   if the mandatory Algorithm-attribute is missing
67
     */
68
    public static function fromXML(DOMElement $xml): static
69
    {
70
        Assert::same($xml->localName, 'DigestMethod', InvalidDOMElementException::class);
71
        Assert::same($xml->namespaceURI, DigestMethod::NS, InvalidDOMElementException::class);
72
73
        return new static(
74
            self::getAttribute($xml, 'Algorithm', SAMLAnyURIValue::class),
75
            self::getChildElementsFromXML($xml),
76
        );
77
    }
78
79
80
    /**
81
     * Convert this element to XML.
82
     *
83
     * @param \DOMElement|null $parent The element we should append to.
84
     */
85
    public function toXML(?DOMElement $parent = null): DOMElement
86
    {
87
        $e = $this->instantiateParentElement($parent);
88
        $e->setAttribute('Algorithm', $this->getAlgorithm()->getValue());
89
90
        foreach ($this->getElements() as $element) {
91
            /** @var \SimpleSAML\XML\SerializableElementInterface $element */
92
            $element->toXML($e);
93
        }
94
95
        return $e;
96
    }
97
}
98