Issues (47)

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.

Respect/Rest/Routines/AbstractCallbackList.php (1 issue)

Severity

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 the Respect\Rest package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Respect\Rest\Routines;
10
11
use UnexpectedValueException;
12
use ArrayObject;
13
14
/**
15
 * Facilitates the keyed callback lists for routines.
16
 * @author Nick Lombard <[email protected]>
17
 */
18
class AbstractCallbackList extends ArrayObject implements Routinable
19
{
20
    /** filters out non callable from the list, step copy to new storage */
21 40
    public function __construct(array $list = array())
22
    {
23 40
        $this->setFlags(self::ARRAY_AS_PROPS);
24
25 40
        if (!($callbackList = array_filter($list, 'is_callable'))) {
26
            $message = 'Invalid setting: Not a single callable argument for callback routines: '.get_class($this);
27
            throw new UnexpectedValueException($message);
28
        }
29
30 40
        foreach ($callbackList as $acceptSpec => $callback) {
31 40
            if (true === is_callable($callback)) {
32 40
                $this[$acceptSpec] = $callback;
33
            } else {
34
                error_log("The $acceptSpec enry does not have a valid callback configured, it has been ignored.\n", 1);
35
            }
36
        }
37 40
    }
38
39
    /**
40
     * Public accessor methods, free for all (idempotent)
41
     *
42
     * @method getKeys to retrieve only the keys for conneg etc.
43
     * @method hasKey check if key is present
44
     * @method filterKeysContain fetch keys matching supplied string
45
     * @method filterKeysNotContain  fetch keys that don't include string
46
     */
47 34
    public function getKeys()
48
    {
49 34
        return array_keys($this->getArrayCopy());
50
    }
51 1
    public function hasKey($key)
52
    {
53 1
        return isset($this->$key);
54
55
        return array_key_exists($key, $this);
0 ignored issues
show
return array_key_exists($key, $this); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
56
    }
57 24
    public function filterKeysContain($needle)
58
    {
59
        return array_filter($this->getKeys(), function ($key) use ($needle) {
60 24
            return false !== strpos($key, $needle);
61 24
        });
62
    }
63
    public function filterKeysNotContain($needle)
64
    {
65 1
        return array_filter($this->getKeys(), function ($key) use ($needle) {
66 1
            return false === strpos($key, $needle);
67 1
        });
68
    }
69
70
    /**
71
     * Protected accessor methods, members only.
72
     *
73
     * @method getCallback return the configured callback associated with key
74
     * @method executeCallback and forward supplied parmaters
75
     */
76 30
    protected function getCallback($key)
77
    {
78 30
        return $this->$key;
79
    }
80
81 1
    protected function executeCallback($key, $params)
82
    {
83 1
        return call_user_func_array($this->$key, $params);
84
    }
85
}
86