Issues (17)

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/Manager/VersionedRedisSentinelManager.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
namespace Monospice\LaravelRedisSentinel\Manager;
4
5
use Illuminate\Redis\RedisManager;
6
use Illuminate\Support\Arr;
7
use InvalidArgumentException;
8
use Monospice\LaravelRedisSentinel\Connectors;
9
use Monospice\LaravelRedisSentinel\Contracts\Factory;
10
11
/**
12
 * Contains common functionality for the RedisSentinelManager implementations
13
 * for differing Laravel versions.
14
 *
15
 * @category Package
16
 * @package  Monospice\LaravelRedisSentinel
17
 * @author   Cy Rossignol <[email protected]>
18
 * @license  See LICENSE file
19
 * @link     http://github.com/monospice/laravel-redis-sentinel-drivers
20
 */
21
abstract class VersionedRedisSentinelManager
22
    extends RedisManager
23
    implements Factory
24
{
25
    /**
26
     * Get the Redis Connection instance represented by the specified name
27
     *
28
     * @param string|null $name The name of the connection as defined in the
29
     * configuration
30
     *
31
     * @return \Illuminate\Redis\Connections\PredisConnection The configured
0 ignored issues
show
Consider making the return type a bit more specific; maybe use \Monospice\LaravelRedisS...ctions\PredisConnection.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
32
     * Redis Connection instance
33
     *
34
     * @throws InvalidArgumentException If attempting to initialize a Redis
35
     * Cluster connection
36
     * @throws InvalidArgumentException If the specified connection is not
37
     * defined in the configuration
38
     */
39
    protected function resolveConnection($name = null)
40
    {
41
        $name = $name ?: 'default';
42
        $options = Arr::get($this->config, 'options', [ ]);
43
44
        if (isset($this->config[$name])) {
45
            return $this->connector()->connect($this->config[$name], $options);
46
        }
47
48
        if (isset($this->config['clusters']['name'])) {
49
            throw new InvalidArgumentException(
50
                'Redis Sentinel connections do not support Redis Cluster.'
51
            );
52
        }
53
54
        throw new InvalidArgumentException(
55
            'The Redis Sentinel connection [' . $name . '] is not defined.'
56
        );
57
    }
58
59
    /**
60
     * Get the appropriate Connector instance for the current client driver
61
     *
62
     * @return Connectors\PredisConnector The Connector instance for the
63
     * current driver
64
     *
65
     * @throws InvalidArgumentException If the current client driver is not
66
     * supported
67
     */
68
    protected function connector()
69
    {
70
        switch ($this->driver) {
71
            case 'predis':
72
                return new Connectors\PredisConnector();
73
        }
74
75
        throw new InvalidArgumentException(
76
            'Unsupported Redis Sentinel client driver [' . $this->driver . ']. '
77
            . 'The monospice/laravel-redis-sentinel-drivers package currently '
78
            . 'supports only the "predis" client. Support for the "phpredis" '
79
            . 'client will be added in the future.'
80
        );
81
    }
82
}
83