Issues (4388)

Security Analysis    no vulnerabilities found

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

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

1
<?php
0 ignored issues
show
Class found in ".php" file; use ".inc" extension instead
Loading history...
Header blocks must be separated by a single blank line
Loading history...
Filename "ConsoleShell.php" doesn't match the expected filename "consoleshell.php"
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
/**
0 ignored issues
show
Namespaced classes, interfaces and traits should not begin with a file doc comment
Loading history...
3
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
0 ignored issues
show
Doc comment short description must be on a single line, further text should be a separate paragraph
Loading history...
5
 *
6
 * Licensed under The MIT License
7
 * For full copyright and license information, please see the LICENSE.txt
8
 * Redistributions of files must retain the above copyright notice.
9
 *
10
 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
0 ignored issues
show
Coding Style Documentation introduced by
Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration
Loading history...
The tag in position 1 should be the @package tag
Loading history...
@copyright tag must contain a year and the name of the copyright holder
Loading history...
11
 * @link      http://cakephp.org CakePHP(tm) Project
0 ignored issues
show
The tag in position 2 should be the @subpackage tag
Loading history...
Tag value indented incorrectly; expected 1 space but found 6
Loading history...
The tag in position 2 should be the @license tag
Loading history...
12
 * @since     3.0.0
0 ignored issues
show
The tag in position 3 should be the @link tag
Loading history...
The tag in position 3 should be the @author tag
Loading history...
Tag value indented incorrectly; expected 1 space but found 5
Loading history...
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
0 ignored issues
show
Tag value indented incorrectly; expected 1 space but found 3
Loading history...
The tag in position 4 should be the @since tag
Loading history...
The tag in position 4 should be the @copyright tag
Loading history...
14
 */
0 ignored issues
show
Header blocks must be separated by a single blank line
Loading history...
PHP version not specified
Loading history...
There must be exactly one blank line after the file comment
Loading history...
Coding Style Documentation introduced by
Missing @package tag in file comment
Loading history...
Coding Style Documentation introduced by
Missing @subpackage tag in file comment
Loading history...
Coding Style Documentation introduced by
Missing @author tag in file comment
Loading history...
Missing @category tag in file comment
Loading history...
15
namespace App\Shell;
16
17
use Cake\Console\ConsoleOptionParser;
18
use Cake\Console\Shell;
19
use Cake\Log\Log;
20
use Psy\Shell as PsyShell;
21
22
/**
23
 * Simple console wrapper around Psy\Shell.
24
 */
0 ignored issues
show
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @category tag in class comment
Loading history...
25
class ConsoleShell extends Shell
0 ignored issues
show
Deprecated Code introduced by
The class Cake\Console\Shell has been deprecated: 3.6.0 ShellDispatcher and Shell will be removed in 5.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

25
class ConsoleShell extends /** @scrutinizer ignore-deprecated */ Shell
Loading history...
26
{
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
Opening brace should be on the same line as the declaration for class ConsoleShell
Loading history...
27
28
    /**
29
     * Start the shell and interactive console.
30
     *
31
     * @return int|null
0 ignored issues
show
Expected "integer|null" but found "int|null" for function return type
Loading history...
32
     */
33
    public function main()
34
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
35
        if (!class_exists('Psy\Shell')) {
0 ignored issues
show
Expected 1 space(s) after NOT operator; 0 found
Loading history...
36
            $this->err('<error>Unable to load Psy\Shell.</error>');
37
            $this->err('');
38
            $this->err('Make sure you have installed psysh as a dependency,');
39
            $this->err('and that Psy\Shell is registered in your autoloader.');
40
            $this->err('');
41
            $this->err('If you are using composer run');
42
            $this->err('');
43
            $this->err('<info>$ php composer.phar require --dev psy/psysh</info>');
44
            $this->err('');
45
46
            return self::CODE_ERROR;
47
        }
48
49
        $this->out("You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal You can exit with <info>... or <info>`exit`</info> does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
50
        $this->out('');
51
52
        Log::drop('debug');
53
        Log::drop('error');
54
        $this->_io->setLoggers(false);
55
        restore_error_handler();
56
        restore_exception_handler();
57
58
        $psy = new PsyShell();
59
        $psy->run();
60
    }
61
62
    /**
63
     * Display help for this console.
64
     *
65
     * @return \Cake\Console\ConsoleOptionParser
66
     */
67
    public function _getOptionParser()
0 ignored issues
show
Public method name "ConsoleShell::_getOptionParser" must not be prefixed with an underscore
Loading history...
Public method name "ConsoleShell::_getOptionParser" is not in lowerCamel format
Loading history...
68
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
69
        $parser = new ConsoleOptionParser('console');
70
        $parser->description(
0 ignored issues
show
The method description() does not exist on Cake\Console\ConsoleOptionParser. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

70
        $parser->/** @scrutinizer ignore-call */ 
71
                 description(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
71
            'This shell provides a REPL that you can use to interact ' .
72
            'with your application in an interactive fashion. You can use ' .
73
            'it to run adhoc queries with your models, or experiment ' .
74
            'and explore the features of CakePHP and your application.' .
75
            "\n\n" .
76
            'You will need to have psysh installed for this Shell to work.'
77
        );
78
79
        return $parser;
80
    }
0 ignored issues
show
Expected 1 blank line after function; 0 found
Loading history...
81
}
82