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/Command/ConsoleCommand.php (43 issues)

1
<?php
0 ignored issues
show
Class found in ".php" file; use ".inc" extension instead
Loading history...
This file is missing a doc comment.
Loading history...
Header blocks must be separated by a single blank line
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Filename "ConsoleCommand.php" doesn't match the expected filename "consolecommand.php"
Loading history...
2
declare(strict_types=1);
3
4
/**
0 ignored issues
show
The file-level docblock must follow the opening PHP tag in the file header
Loading history...
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
Loading history...
Block comments must be started with /*
Loading history...
5
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6
 * Copyright (c) Cake Software Foundation, Inc. (https://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...
7
 *
8
 * Licensed under The MIT License
9
 * For full copyright and license information, please see the LICENSE.txt
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
0 ignored issues
show
@copyright tag must contain a year and the name of the copyright holder
Loading history...
13
 * @link      https://cakephp.org CakePHP(tm) Project
0 ignored issues
show
Tag value indented incorrectly; expected 1 space but found 6
Loading history...
The tag in position 2 should be the @license tag
Loading history...
14
 * @since     3.0.0
0 ignored issues
show
The tag in position 3 should be the @link tag
Loading history...
Tag value indented incorrectly; expected 1 space but found 5
Loading history...
15
 * @license   https://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...
16
 */
0 ignored issues
show
PHP version not specified
Loading history...
Header blocks must be separated by a single blank line
Loading history...
Missing @author tag in file comment
Loading history...
Missing @package tag in file comment
Loading history...
Missing @category tag in file comment
Loading history...
17
namespace App\Command;
18
19
use Cake\Command\Command;
20
use Cake\Console\Arguments;
21
use Cake\Console\ConsoleIo;
22
use Cake\Console\ConsoleOptionParser;
23
use Cake\Log\Log;
24
use Psy\Shell as PsyShell;
25
26
/**
27
 * Simple console wrapper around Psy\Shell.
28
 */
0 ignored issues
show
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
Missing @category tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
29
class ConsoleCommand extends Command
30
{
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 ConsoleCommand
Loading history...
31
    /**
32
     * Start the Command and interactive console.
33
     *
34
     * @param \Cake\Console\Arguments $args The command arguments.
0 ignored issues
show
Parameter comment must be on the next line
Loading history...
35
     * @param \Cake\Console\ConsoleIo $io The console io
0 ignored issues
show
Expected 3 spaces after parameter name; 1 found
Loading history...
Parameter comment must end with a full stop
Loading history...
Parameter comment must be on the next line
Loading history...
36
     * @return int|null|void The exit code or null for success
0 ignored issues
show
Expected "integer|null|void" but found "int|null|void" for function return type
Loading history...
Separate the @param and @return sections by a blank line.
Loading history...
37
     */
38
    public function execute(Arguments $args, ConsoleIo $io)
0 ignored issues
show
Expected 1 blank line before function; 0 found
Loading history...
The method parameter $args is never used
Loading history...
39
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
40
        if (!class_exists('Psy\Shell')) {
0 ignored issues
show
Expected 1 space(s) after NOT operator; 0 found
Loading history...
41
            $io->err('<error>Unable to load Psy\Shell.</error>');
42
            $io->err('');
43
            $io->err('Make sure you have installed psysh as a dependency,');
44
            $io->err('and that Psy\Shell is registered in your autoloader.');
45
            $io->err('');
46
            $io->err('If you are using composer run');
47
            $io->err('');
48
            $io->err('<info>$ php composer.phar require --dev psy/psysh</info>');
49
            $io->err('');
50
51
            return static::CODE_ERROR;
52
        }
53
54
        $io->out('You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>');
55
        $io->out('');
56
57
        Log::drop('debug');
58
        Log::drop('error');
59
        $io->setLoggers(false);
60
        restore_error_handler();
61
        restore_exception_handler();
62
63
        $psy = new PsyShell();
64
        $psy->run();
65
    }
66
67
    /**
68
     * Display help for this console.
69
     *
70
     * @param \Cake\Console\ConsoleOptionParser $parser The parser to update
0 ignored issues
show
Parameter comment must be on the next line
Loading history...
Parameter comment must end with a full stop
Loading history...
71
     * @return \Cake\Console\ConsoleOptionParser
0 ignored issues
show
Separate the @param and @return sections by a blank line.
Loading history...
72
     */
73
    public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
74
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
75
        $parser->setDescription(
76
            'This shell provides a REPL that you can use to interact with ' .
77
            'your application in a command line designed to run PHP code. ' .
78
            'You can use it to run adhoc queries with your models, or ' .
79
            'explore the features of CakePHP and your application.' .
80
            "\n\n" .
81
            'You will need to have psysh installed for this Shell to work.'
82
        );
83
84
        return $parser;
85
    }
0 ignored issues
show
Expected 1 blank line after function; 0 found
Loading history...
86
}
87