Issues (190)

Security Analysis    not enabled

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.

bundles/lib/Cache/Redis.php (2 issues)

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
 * Manage Cache by Redis
5
 *
6
 * @category  	lib
7
 * @package		lib\Cache
8
 * @author    	Judicaël Paquet <[email protected]>
9
 * @copyright 	Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93)
10
 * @license   	https://github.com/las93/venus2/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
11
 * @version   	Release: 1.0.0
12
 * @filesource	https://github.com/las93/venus2
13
 * @link      	https://github.com/las93
14
 * @since     	1.0
15
 */
16
namespace Venus\lib\Cache;
17
18
use \Redis as RealRedis;
19
use \Venus\lib\Cache\CacheInterface;
20
21
/**
22
 * This class manage the Cache by Redis
23
 *
24
 * @category  	lib
25
 * @package		lib\Cache
26
 * @author    	Judicaël Paquet <[email protected]>
27
 * @copyright 	Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93)
28
 * @license   	https://github.com/las93/venus2/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
29
 * @version   	Release: 1.0.0
30
 * @filesource	https://github.com/las93/venus2
31
 * @link      	https://github.com/las93
32
 * @since     	1.0
33
 */
34
class Redis extends RealRedis implements CacheInterface
35
{
36
    /**
37
     * constructor with the connection to Redis
38
     *
39
     * @access public
40
     * @param $oConf
41
     * @throws \Exception
42
     * @internal param string $sName name of the session
43
     * @internal param int $iFlags flags
44
     * @internal param int $iTimeout expiration of cache
45
     */
46
    public function __construct($oConf)
47
    {
48
        if (!$this->connect($oConf->host, $oConf->port)) {
49
50
            throw new \Exception('Redis server unavailable');
51
        }
52
    
53
        // Select the REDIS db index
54
        $this->select($oConf->index);
55
    }
56
57
    /**
58
     * get a value
59
     *
60
     * @access public
61
     * @param  string $sName name of the session
62
     * @param  int $iFlags flags
63
     * @param  int $iTimeout expiration of cache
64
     * @return mixed
65
     */
66
    public function get(string $sName, int &$iFlags = null, int $iTimeout = 0)
67
    {
68
        return parent::get($sName);
69
    }
70
71
    /**
72
     * set a value
73
     *
74
     * @access public
75
     * @param  string $sName name of the session
76
     * @param  mixed $mValue value of this sesion var
77
     * @param  int $iFlag unused
78
     * @param  int $iExpire expiration of cache
79
     * @return \Venus\lib\Cache\Apc
80
     */
81
    public function set(string $sName, $mValue, int $iFlag = 0, int $iExpire = false)
82
    {
83
        if ($iExpire === false) {
84
85
            return parent::set($sName, $mValue);
86
        }
87
        else {
88
89
            return parent::setex($sName, $iExpire, $mValue);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (setex() instead of set()). Are you sure this is correct? If so, you might want to change this to $this->setex().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
90
        }
91
    }
92
93
    /**
94
     * flush the cache
95
     *
96
     * @access public
97
     * @return mixed
98
     */
99
    public function flush()
100
    {
101
        return false;
102
    }
103
104
    /**
105
     * delete a value
106
     *
107
     * @access public
108
     * @param  string $sName name of the session
109
     * @return mixed
110
     */
111
    public function delete(string $sName)
112
    {
113
        return $this->del($sName);
114
    }
115
116
    /**
117
     * close the redis connecction
118
     *
119
     * @access public
120
     * @return mixed
121
     */
122
    public function __sleep()
123
    {
124
        $this->close();
125
    }
126
127
    /**
128
     * add
129
     *
130
     * @access public
131
     * @param  string $sName name of the session
132
     * @param  mixed $mValue value of this sesion var
133
     * @param  int $iFlag unused
0 ignored issues
show
There is no parameter named $iFlag. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
134
     * @param  int $iExpire expiration of cache
135
     * @return mixed
136
     */
137
    public function add(string $sName, $mValue, int $iExpire = false)
138
    {
139
        return $this->set($sName, $mValue, 0, $iExpire);
140
    }
141
}
142