Issues (201)

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.

src/Conflict/ModuleConflict.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
/*
4
 * This file is part of the puli/manager package.
5
 *
6
 * (c) Bernhard Schussek <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Puli\Manager\Conflict;
13
14
/**
15
 * A conflict between two modules claiming the same token.
16
 *
17
 * @since  1.0
18
 *
19
 * @author Bernhard Schussek <[email protected]>
20
 *
21
 * @see    ModuleConflictDetector
22
 */
23
class ModuleConflict
24
{
25
    /**
26
     * @var string
27
     */
28
    private $conflictingToken;
29
30
    /**
31
     * @var string[]
32
     */
33
    private $moduleNames;
34
35
    /**
36
     * Creates the conflict.
37
     *
38
     * @param string   $conflictingToken The token that caused the conflict.
39
     * @param string[] $moduleNames      The names of the modules claiming the
40
     *                                   token.
41
     */
42 28
    public function __construct($conflictingToken, array $moduleNames)
43
    {
44 28
        sort($moduleNames);
45
46 28
        $this->conflictingToken = $conflictingToken;
47 28
        $this->moduleNames = array();
48
49 28
        foreach ($moduleNames as $moduleName) {
50 28
            $this->moduleNames[$moduleName] = true;
51
        }
52 28
    }
53
54
    /**
55
     * Returns the conflicting repository path.
56
     *
57
     * @return string The conflicting repository path.
58
     */
59 22
    public function getConflictingToken()
60
    {
61 22
        return $this->conflictingToken;
62
    }
63
64
    /**
65
     * Returns the names of the modules causing the conflict.
66
     *
67
     * @return string[] The name of the first conflicting module.
0 ignored issues
show
Should the return type not be integer[]?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
68
     */
69 22
    public function getModuleNames()
70
    {
71 22
        return array_keys($this->moduleNames);
72
    }
73
74
    /**
75
     * Returns whether the conflict involves a given module name.
76
     *
77
     * @param string $moduleName A module name.
78
     *
79
     * @return bool Returns `true` if the module caused the conflict.
80
     */
81 1
    public function involvesModule($moduleName)
82
    {
83 1
        return isset($this->moduleNames[$moduleName]);
84
    }
85
86
    /**
87
     * Returns the opposing module names in the conflict.
88
     *
89
     * @param string $moduleName The name of a module.
90
     *
91
     * @return string[] Returns the names of the opposing modules or an empty
92
     *                  array if the module is not involved in the conflict.
93
     */
94 1
    public function getOpponents($moduleName)
95
    {
96 1
        if (!isset($this->moduleNames[$moduleName])) {
97 1
            return array();
98
        }
99
100 1
        $opponents = $this->moduleNames;
101
102 1
        unset($opponents[$moduleName]);
103
104 1
        return array_keys($opponents);
105
    }
106
}
107