This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | class Kint_Parser_Serialize extends Kint_Parser_Plugin |
||
0 ignored issues
–
show
The property $safe_mode is not named in camelCase.
This check marks property names that have not been written in camelCase. In camelCase names are written without any punctuation, the start of each new word being marked
by a capital letter. Thus the name database connection string becomes ![]() |
|||
4 | { |
||
5 | /** |
||
6 | * Disables automatic unserialization on arrays and objects. |
||
7 | * |
||
8 | * As the PHP manual notes: |
||
9 | * |
||
10 | * > Unserialization can result in code being loaded and executed due to |
||
11 | * > object instantiation and autoloading, and a malicious user may be able |
||
12 | * > to exploit this. |
||
13 | * |
||
14 | * The natural way to stop that from happening is to just refuse to unserialize |
||
15 | * stuff by default. Which is what we're doing for anything that's not scalar. |
||
16 | * |
||
17 | * @var bool |
||
18 | */ |
||
19 | public static $safe_mode = true; |
||
0 ignored issues
–
show
$safe_mode does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
20 | public static $options = array(true); |
||
21 | |||
22 | public function getTypes() |
||
23 | { |
||
24 | return array('string'); |
||
25 | } |
||
26 | |||
27 | public function getTriggers() |
||
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() |
|||
28 | { |
||
29 | return Kint_Parser::TRIGGER_SUCCESS; |
||
30 | } |
||
31 | |||
32 | public function parse(&$var, Kint_Object &$o, $trigger) |
||
0 ignored issues
–
show
|
|||
33 | { |
||
34 | $trimmed = rtrim($var); |
||
35 | |||
36 | if ($trimmed !== 'N;' && !preg_match('/^(?:[COabis]:\d+[:;]|d:\d+(?:\.\d+);)/', $trimmed)) { |
||
37 | return; |
||
38 | } |
||
39 | |||
40 | if (!self::$safe_mode || !in_array($trimmed[0], array('C', 'O', 'a'))) { |
||
41 | $blacklist = false; |
||
42 | |||
43 | // Second parameter only supported on PHP 7 |
||
44 | if (KINT_PHP70) { |
||
45 | // Suppress warnings on unserializeable variable |
||
46 | $data = @unserialize($trimmed, self::$options); |
||
47 | } else { |
||
48 | $data = @unserialize($trimmed); |
||
49 | } |
||
50 | |||
51 | if ($data === false && substr($trimmed, 0, 4) !== 'b:0;') { |
||
52 | return; |
||
53 | } |
||
54 | } else { |
||
55 | $blacklist = true; |
||
56 | } |
||
57 | |||
58 | $base_obj = new Kint_Object(); |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
59 | $base_obj->depth = $o->depth + 1; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
60 | $base_obj->name = 'unserialize('.$o->name.')'; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
61 | |||
62 | if ($o->access_path) { |
||
0 ignored issues
–
show
The expression
$o->access_path of type string|null is loosely compared to true ; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For '' == false // true
'' == null // true
'ab' == false // false
'ab' == null // false
// It is often better to use strict comparison
'' === false // false
'' === null // false
![]() |
|||
63 | $base_obj->access_path = 'unserialize('.$o->access_path; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
64 | if (!KINT_PHP70 || self::$options === array(true)) { |
||
65 | $base_obj->access_path .= ')'; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
66 | } elseif (self::$options === array(false)) { |
||
67 | $base_obj->access_path .= ', false)'; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
68 | } else { |
||
69 | $base_obj->access_path .= ', Kint_Parser_Serialize::$options)'; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
70 | } |
||
71 | } |
||
72 | |||
73 | $r = new Kint_Object_Representation('Serialized'); |
||
0 ignored issues
–
show
|
|||
74 | |||
75 | if ($blacklist) { |
||
76 | $base_obj->hints[] = 'blacklist'; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
|||
77 | $r->contents = $base_obj; |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() It seems like
$base_obj of type object<Kint_Object> is incompatible with the declared type array of property $contents .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. ![]() |
|||
78 | } else { |
||
79 | $r->contents = $this->parser->parse($data, $base_obj); |
||
0 ignored issues
–
show
$base_obj does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() It seems like
$this->parser->parse($data, $base_obj) of type object<Kint_Object> is incompatible with the declared type array of property $contents .
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. ![]() |
|||
80 | } |
||
81 | |||
82 | $o->addRepresentation($r, 0); |
||
83 | } |
||
84 | } |
||
85 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.