Issues (51)

Security Analysis    no request data  

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.

src/Commands/SetupCommand.php (1 issue)

Labels
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
namespace FLAIRUK\GoodTillSystem\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Filesystem\Filesystem;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Process\Process;
9
use TCG\Voyager\Providers\VoyagerDummyServiceProvider;
10
use TCG\Voyager\Traits\Seedable;
11
use TCG\Voyager\VoyagerServiceProvider;
12
13
class SetupCommand extends Command
14
{
15
16
    protected $hidden = false;
17
    /**
18
     * The console command name.
19
     *
20
     * @var string
21
     */
22
    protected $name = 'goodtill:setup';
23
24
    /**
25
     * The console command description.
26
     *
27
     * @var string
28
     */
29
    protected $description = 'Install the Good Tiil System package';
30
31
    protected function getOptions()
32
    {
33
        return [
34
            ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production', null],
35
            ['with-dummy', null, InputOption::VALUE_NONE, 'Install with dummy data', null],
36
        ];
37
    }
38
39
    /**
40
     * Get the composer command for the environment.
41
     *
42
     * @return string
43
     */
44
    protected function findComposer()
45
    {
46
        if (file_exists(getcwd().'/composer.phar')) {
47
            return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar';
48
        }
49
50
        return 'composer';
51
    }
52
53
    public function fire(Filesystem $filesystem)
54
    {
55
        return $this->handle($filesystem);
56
    }
57
58
    /**
59
     * Execute the console command.
60
     *
61
     * @param \Illuminate\Filesystem\Filesystem $filesystem
62
     *
63
     * @return void
64
     */
65
    public function handle(Filesystem $filesystem)
66
    {
67
        $this->info('Publishing the Voyager assets, database, and config files');
68
69
        // Publish only relevant resources on install
70
        // $tags = ['seeds'];
71
72
        $this->call('vendor:publish', ['--provider' => VoyagerServiceProvider::class, '--tag' => $tags]);
0 ignored issues
show
The variable $tags does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
73
74
        // $this->info('Migrating the database tables into your application');
75
        // $this->call('migrate', ['--force' => $this->option('force')]);
76
77
        // $this->info('Attempting to set Voyager User model as parent to App\User');
78
        // if (file_exists(app_path('User.php'))) {
79
        //     $str = file_get_contents(app_path('User.php'));
80
81
        //     if ($str !== false) {
82
        //         $str = str_replace('extends Authenticatable', "extends \TCG\Voyager\Models\User", $str);
83
84
        //         file_put_contents(app_path('User.php'), $str);
85
        //     }
86
        // } else {
87
        //     $this->warn('Unable to locate "app/User.php".  Did you move this file?');
88
        //     $this->warn('You will need to update this manually.  Change "extends Authenticatable" to "extends \TCG\Voyager\Models\User" in your User model');
89
        // }
90
91
        $this->info('Dumping the autoloaded files and reloading all new files');
92
93
        $composer = $this->findComposer();
94
95
        $process = new Process([$composer.' dump-autoload']);
96
        $process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time
97
        $process->setWorkingDirectory(base_path())->run();
98
99
        $this->info('Adding Environment Variables');
100
        $routes_contents = $filesystem->get(base_path('.env'));
101
        if (false === strpos($routes_contents, "\n\nGOOD_TILL_DOAMIN=\nGOOD_TILL_USERNAME=\nGOOD_TILL_PASSWORD=")) {
102
            $filesystem->append(
103
                base_path('routes/web.php'),
104
                "\n\nGOOD_TILL_DOAMIN=\nGOOD_TILL_USERNAME=\nGOOD_TILL_PASSWORD="
105
            );
106
        }
107
108
        // $this->info('Seeding data into the database');
109
        // $this->seed('VoyagerDatabaseSeeder');
110
111
        // if ($this->option('with-dummy')) {
112
        //     $this->info('Publishing dummy content');
113
        //     $tags = ['dummy_seeds', 'dummy_content', 'dummy_config', 'dummy_migrations'];
114
        //     $this->call('vendor:publish', ['--provider' => VoyagerDummyServiceProvider::class, '--tag' => $tags]);
115
116
        //     $this->info('Migrating dummy tables');
117
        //     $this->call('migrate');
118
119
        //     $this->info('Seeding dummy data');
120
        //     $this->seed('VoyagerDummyDatabaseSeeder');
121
        // } else {
122
        //     $this->call('vendor:publish', ['--provider' => VoyagerServiceProvider::class, '--tag' => ['config', 'voyager_avatar']]);
123
        // }
124
125
        // $this->info('Setting up the hooks');
126
        // $this->call('hook:setup');
127
128
        // $this->info('Adding the storage symlink to your public folder');
129
        // $this->call('storage:link');
130
131
        // $this->info('Successfully installed Voyager! Enjoy');
132
    }
133
}