Issues (1240)

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.

system/libraries/Controller.php (4 issues)

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 defined('SYSPATH') or die('No direct access allowed.');
2
/**
3
 * Kohana Controller class. The controller class must be extended to work
4
 * properly, so this class is defined as abstract.
5
 *
6
 * $Id: Controller.php 4365 2009-05-27 21:09:27Z samsoir $
7
 *
8
 * @package    Core
9
 * @author     Kohana Team
10
 * @copyright  (c) 2007-2008 Kohana Team
11
 * @license    http://kohanaphp.com/license.html
12
 */
13
abstract class Controller_Core
14
{
15
16
    // Allow all controllers to run in production by default
17
    const ALLOW_PRODUCTION = true;
18
19
    /**
20
     * Loads URI, and Input into this controller.
21
     *
22
     * @return  void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
23
     */
24
    public function __construct()
25
    {
26
        if (Kohana::$instance == null) {
27
            // Set the instance to the first controller loaded
28
            Kohana::$instance = $this;
29
        }
30
31
        // URI should always be available
32
        $this->uri = URI::instance();
0 ignored issues
show
The property uri does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
33
34
        // Input should always be available
35
        $this->input = Input::instance();
0 ignored issues
show
The property input does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
36
    }
37
38
    /**
39
     * Handles methods that do not exist.
40
     *
41
     * @param   string  method name
42
     * @param   array   arguments
43
     * @return  void
44
     */
45
    public function __call($method, $args)
46
    {
47
        // Default to showing a 404 page
48
        Event::run('system.404');
49
    }
50
51
    /**
52
     * Includes a View within the controller scope.
53
     *
54
     * @param   string  view filename
55
     * @param   array   array of view variables
56
     * @return  string
0 ignored issues
show
Should the return type not be null|string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
57
     */
58
    public function _kohana_load_view($kohana_view_filename, $kohana_input_data)
59
    {
60
        if ($kohana_view_filename == '') {
61
            return;
62
        }
63
64
        // Buffering on
65
        ob_start();
66
67
        // Import the view variables to local namespace
68
        extract($kohana_input_data, EXTR_SKIP);
69
70
        // Views are straight HTML pages with embedded PHP, so importing them
71
        // this way insures that $this can be accessed as if the user was in
72
        // the controller, which gives the easiest access to libraries in views
73
        try {
74
            include $kohana_view_filename;
75
        } catch (Exception $e) {
76
            ob_end_clean();
77
            throw $e;
78
        }
79
80
        // Fetch the output and close the buffer
81
        return ob_get_clean();
82
    }
83
} // End Controller Class
84