1 | <?php |
||
14 | class EntityContainer extends ContainerAccessors { |
||
15 | /** |
||
16 | * Property list and description |
||
17 | * |
||
18 | * propertyName => array( |
||
19 | * P_DB_FIELD => 'dbFieldName', - directly converts property to field and vice versa |
||
20 | * ) |
||
21 | * |
||
22 | * @var array[] $properties |
||
23 | */ |
||
24 | protected $properties = array(); |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Set properties data from external source |
||
29 | * |
||
30 | * @param array $properties |
||
31 | */ |
||
32 | public function setProperties($properties) { |
||
35 | |||
36 | /** |
||
37 | * @param array $row |
||
38 | * @param string $processor |
||
39 | */ |
||
40 | protected function processRow(&$row, $processor) { |
||
60 | |||
61 | /** |
||
62 | * Import DB row state into object properties |
||
63 | * |
||
64 | * @param array $row |
||
65 | */ |
||
66 | public function importRow($row) { |
||
75 | |||
76 | /** |
||
77 | * Exports object properties to DB row state WITHOUT ID |
||
78 | * |
||
79 | * Useful for INSERT operations |
||
80 | * |
||
81 | * @return array |
||
82 | */ |
||
83 | public function exportRow() { |
||
89 | |||
90 | public function isEmpty() { |
||
93 | |||
94 | public function isNew() { |
||
97 | |||
98 | /** |
||
99 | * Clears only properties which declared in $properties array |
||
100 | */ |
||
101 | public function clearProperties() { |
||
106 | |||
107 | } |
||
108 |
$this->accessors[$propertyName][$processor]
can contain request data and is used in code execution context(s) leading to a potential security vulnerability.1 path for user data to reach this point
$_POST
in includes/general.php on line 258
in includes/general.php on line 290
in vendor/includes/general.php on line 1303
in includes/classes/Buddy/BuddyParams.php on line 35
in includes/classes/Buddy/BuddyModel.php on line 254
$params->request_text_unsafe
is passed to ContainerAccessors::__set()in includes/classes/Buddy/BuddyModel.php on line -1
in includes/classes/ContainerAccessors.php on line 118
in includes/classes/EntityContainer.php on line 48
General Strategies to prevent injection
In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:
For numeric data, we recommend to explicitly cast the data: