Issues (71)

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.

Docs/Examples/ExampleSeederTask.php (1 issue)

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
App::uses('SeederTaskBase', 'FakeSeeder.Console');
4
5
/**
6
 * Example Seeder Task
7
 */
8
class ExampleSeederTask extends SeederTaskBase {
9
10
	/**
11
	 * The config key to read, 'FakeSeeder.$_configKey.valueKey'
12
	 *
13
	 * Does not need to be set, uses the name of the seeder class by default, e.g. "Article" for "ArticleSeederShell".
14
	 *
15
	 * @var string
16
	 */
17
	protected $_configKey = 'ExampleKey';
18
19
	/**
20
	 * The name of the model to seed
21
	 *
22
	 * Does not need to be set, uses the name of the seeder class by default, e.g. "Article" for "ArticleSeederTask".
23
	 *
24
	 * @var string
25
	 */
26
	protected $_modelName = 'NotExample';
27
28
	/**
29
	 * Models to truncate
30
	 *
31
	 * Does not need to be set, uses the name of the seeder class by default, e.g. "Article" for "ArticleSeederTask".
32
	 *
33
	 * @var array
34
	 */
35
	protected $_modelsToTruncate = array('SomeModel', 'AnotherModel');
36
37
	/**
38
	 * Fixture records which are processed additionally and before the faked ones
39
	 *
40
	 * @var array
41
	 */
42
	protected $_fixtureRecords = array(
43
		array(
44
			'id' => 1,
45
			'name' => 'abc',
46
		),
47
		array(
48
			'id' => 2,
49
			'name' => 'def',
50
		),
51
	);
52
53
	/**
54
	 * The seeding mode, optional.
55
	 *
56
	 * @var null|string
57
	 */
58
	protected $_mode = 'mixed';
59
60
	/**
61
	 * The locale to use for Faker, optional
62
	 *
63
	 * @var null|int
64
	 */
65
	protected $_locale = 'de_DE';
66
67
	/**
68
	 * Set the minimum record count for a seeder task, null means no minimum.
69
	 *
70
	 * @var null|int
71
	 */
72
	protected $_minRecords = 100;
73
74
	/**
75
	 * Set the maximum record count for a seeder task, null means no maximum.
76
	 *
77
	 * @var null|int
78
	 */
79
	protected $_maxRecords = 20000;
80
81
	/**
82
	 * The records to seed, optional
83
	 *
84
	 * @var null|int
85
	 */
86
	protected $_records = 12345;
87
88
	/**
89
	 * Whether or not to validate the seeding data when saving, optional
90
	 *
91
	 * @var null|bool|string
92
	 * @see Model::saveAll() See for possible values for `validate`.
93
	 */
94
	protected $_validateSeeding = true;
95
96
	/**
97
	 * The seeding number for Faker to use
98
	 *
99
	 * @var null|bool|int
100
	 * @see Generator::seed Faker's seed method.
101
	 */
102
	protected $_seedingNumber = 123456;
103
104
	/**
105
	 * Whether or not to truncate the model , optional.
106
	 *
107
	 * @var null|bool
108
	 */
109
	protected $_noTruncate = false;
110
111
	/**
112
	 * Set/get the field formatters
113
	 *
114
	 * {@inheritDoc}
115
	 */
116
	public function fieldFormatters() {
117
		parent::fieldFormatters();
118
		$faker = $this->faker;
119
120
		return $this->_mergeFieldFormatters(
121
			array(
122
				'name' => function ($state) use ($faker) {
0 ignored issues
show
The parameter $state is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
123
					return $faker->unique()->name;
124
				},
125
			)
126
		);
127
	}
128
129
	/**
130
	 * Set/get state per record
131
	 *
132
	 * Can be overridden to return some state with data per record.
133
	 *
134
	 * @return array The state per record.
135
	 */
136
	public function recordState() {
137
		return array(
138
			'foo' => 'bar',
139
		);
140
	}
141
}
142