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

1
<?php
0 ignored issues
show
The PHP open tag does not have a corresponding PHP close tag
Loading history...
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...
Filename "InstallShell.php" doesn't match the expected filename "installshell.php"
Loading history...
2
namespace App\Shell;
0 ignored issues
show
Missing file doc comment
Loading history...
3
4
use Cake\Console\Shell;
5
use Cake\Filesystem\Folder;
0 ignored issues
show
Unused use statement
Loading history...
6
use Cake\Filesystem\File;
7
use Cake\Core\Configure;
8
use Cake\Core\Configure\Engine\PhpConfig;
0 ignored issues
show
Unused use statement
Loading history...
9
10
class InstallShell 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

10
class InstallShell extends /** @scrutinizer ignore-deprecated */ Shell
Loading history...
Missing class doc comment
Loading history...
Coding Style Documentation introduced by
Missing doc comment for class InstallShell
Loading history...
11
{	
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 InstallShell
Loading history...
Opening class brace must be on a line by itself
Loading history...
12
13
    public function main()
0 ignored issues
show
Missing doc comment for function main()
Loading history...
Missing function doc comment
Loading history...
14
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
15
        $this->out('FortuneCookies installation');
16
        $this->hr();
17
        $this->out('This procedure will output a file called app_local.php');
18
        $this->out('to store Security Salt and Database connection information');
19
		
20
        // Salt
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
21
        $this->hr();
22
        $this->out('Configure Security Salt');
23
        $this->out('A Security Salt is a random string used to encrypt sensitive data inside this app.');
24
        $salt = $this->in('Type a string:');
25
        Configure::write('Security.salt', $salt);
26
        // Database\Connection
27
        // Admin account
28
        // Mail
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
Loading history...
There must be no blank line following an inline comment
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
29
		
30
        if(!Configure::read('Security.salt'))
0 ignored issues
show
Expected 1 space(s) after NOT operator; 0 found
Loading history...
Expected 1 space after closing parenthesis; found 9
Loading history...
Expected 1 space after IF keyword; 0 found
Loading history...
Expected "if (...) {\n"; found "if(...)\n {\n"
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
There must be a single space between the closing parenthesis and the opening brace of a multi-line IF statement; found newline
Loading history...
31
        {
32
            $salt = $this->in('Salt:');
0 ignored issues
show
The assignment to $salt is dead and can be removed.
Loading history...
33
        }
34
35
        Configure::write('debug', false);
36
        Configure::write('Datasources.default.className', 'Cake\Database\Connection');
37
        Configure::write('Datasources.default.driver', 'Cake\Database\Driver\Mysql');
38
        Configure::write('Datasources.default.persistent', false);
39
        Configure::write('Datasources.default.host', 'localhost');
40
        Configure::write('Datasources.default.username', 'root');
41
        Configure::write('Datasources.default.password', 'semaphoredb');
42
        Configure::write('Datasources.default.database', 'fc_test');
43
        Configure::write('Datasources.default.encoding', 'utf8');
44
        Configure::write('Datasources.default.timezone', 'UTC');
45
        Configure::write('Datasources.default.flags', []);
46
        Configure::write('Datasources.default.cacheMetadata', true);
47
        Configure::write('Datasources.default.log', false);
48
        Configure::write('Datasources.default.quoteIdentifiers', false);
49
        Configure::write('Datasources.default.url', env('DATABASE_URL', null));
50
        $file = new File('config/app_local.php', false);
0 ignored issues
show
Deprecated Code introduced by
The class Cake\Filesystem\File has been deprecated: 4.0.0 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

50
        $file = /** @scrutinizer ignore-deprecated */ new File('config/app_local.php', false);
Loading history...
51
        if(!$file->exists()) {
0 ignored issues
show
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
Expected 1 space after IF keyword; 0 found
Loading history...
Expected 1 space(s) after NOT operator; 0 found
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
52
            if($ris = Configure::dump('app_local', 'default')) {
0 ignored issues
show
The assignment to $ris is dead and can be removed.
Loading history...
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
Expected 1 space after IF keyword; 0 found
Loading history...
Variable assignment found within a condition. Did you mean to do a comparison ?
Loading history...
Assignments must be the first block of code on a line
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
53
                $this->out("Wrote config file app_local.php");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Wrote config file app_local.php 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...
54
            }
55
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
56
        $file->close();
57
    }
0 ignored issues
show
Expected 1 blank line after function; 0 found
Loading history...
58
}
59