Issues (387)

Branch: develop

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

tests/features/bootstrap/Ast/UsesTagContext.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 *  For the full copyright and license information, please view the LICENSE
6
 *  file that was distributed with this source code.
7
 *
8
 *  @copyright 2010-2018 Mike van Riel<[email protected]>
9
 *  @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 *  @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Behat\Contexts\Ast;
14
15
use Behat\Behat\Context\Context;
16
use Behat\Gherkin\Node\PyStringNode;
17
use Exception;
18
use phpDocumentor\Descriptor\Tag\UsesDescriptor;
19
use Webmozart\Assert\Assert;
20
21
/**
22
 * This class contains the context methods for tests of the uses tag.
23
 */
24
final class UsesTagContext extends BaseContext implements Context
25
{
26
    /**
27
     * @param string $classFqsen
28
     * @throws Exception
29
     * @Then class ":classFqsen" has a tag uses referencing url ":reference"
30
     */
31
    public function classHasTagUsesReferencingUrl($classFqsen, $reference)
32
    {
33
        $class = $this->findClassByFqsen($classFqsen);
34
        $usesTags = $class->getTags()->get('uses', []);
35
        $this->hasUsesTagReference($usesTags, $reference);
36
    }
37
38
    /**
39
     * @param string $classFqsen
40
     * @Then class ":classFqsen" has :number tag/tags uses referencing :element descriptor ":reference"
41
     */
42
    public function classHasTagUsesReferencing($classFqsen, $number, $element, $reference)
43
    {
44
        $this->classHasTagUsesReferencingWithDescription($classFqsen, $number, $element, $reference, new PyStringNode([], 0));
45
    }
46
47
    /**
48
     * @param string $classFqsen
49
     * @throws Exception
50
     * @Then class ":classFqsen" has :number tag/tags uses referencing :element descriptor ":reference" with description:
51
     */
52
    public function classHasTagUsesReferencingWithDescription($classFqsen, $number, $element, $reference, PyStringNode $description)
0 ignored issues
show
The parameter $element is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
    {
54
        $count = 0;
55
        $class = $this->findClassByFqsen($classFqsen);
56
        $usesTags = $class->getTags()->get('uses', []);
57
        /** @var UsesTag $tag */
58
        foreach ($usesTags as $tag) {
59
            $r = (string) $tag->getReference();
60
            if ($r === $reference
61
                && ((string) $tag->getDescription()) === $description->getRaw()
62
            ) {
63
                ++$count;
64
            }
65
        }
66
67
        Assert::eq($number, $count, sprintf('Missing uses tag with reference "%s"', $reference));
68
    }
69
70
71
    /**
72
     * @then function ":function" has tag uses referencing ":reference"
73
     * @throws Exception
74
     */
75
    public function functionHasUsesTagReferencing(string $function, string $reference)
76
    {
77
        $functionDescriptor = $this->findFunctionByFqsen($function);
78
        $this->hasUsesTagReference($functionDescriptor->getTags()->get('uses', []), $reference);
79
    }
80
81
    /**
82
     * @param $reference
83
     * @param UsesDescriptor[] $usesTags
84
     * @throws Exception
85
     */
86
    private function hasUsesTagReference($usesTags, string $reference) : void
87
    {
88
        /** @var UsesDescriptor $tag */
89
        foreach ($usesTags as $tag) {
90
            if (((string) $tag->getReference()) === $reference) {
91
                return;
92
            }
93
        }
94
95
        throw new Exception(sprintf('Missing uses tag with reference "%s"', $reference));
96
    }
97
}
98