Issues (2473)

Branch: master

Security Analysis    no vulnerabilities found

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.

engine/classes/ElggRiverItem.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
 * River item class.
4
 *
5
 * @package    Elgg.Core
6
 * @subpackage Core
7
 * 
8
 * @property-read int    $id            The unique identifier (read-only)
9
 * @property-read int    $subject_guid  The GUID of the actor
10
 * @property-read int    $object_guid   The GUID of the object
11
 * @property-read int    $target_guid   The GUID of the object's container
12
 * @property-read int    $annotation_id The ID of the annotation involved in the action
13
 * @property-read string $type          The type of one of the entities involved in the action
14
 * @property-read string $subtype       The subtype of one of the entities involved in the action
15
 * @property-read string $action_type   The name of the action
16
 * @property-read string $view          The view for displaying this river item
17
 * @property-read int    $access_id     The visibility of the river item
18
 * @property-read int    $posted        UNIX timestamp when the action occurred
19
 * @property-read string $enabled       Is the river item enabled yes|no
20
 */
21
class ElggRiverItem {
22
	public $id;
23
	public $subject_guid;
24
	public $object_guid;
25
	public $target_guid;
26
	public $annotation_id;
27
	public $type;
28
	public $subtype;
29
	public $action_type;
30
	public $access_id;
31
	public $view;
32
	public $posted;
33
	public $enabled;
34
35
	/**
36
	 * Construct a river item object given a database row.
37
	 *
38
	 * @param \stdClass $object Object obtained from database
39
	 */
40
	public function __construct($object) {
41
		if (!($object instanceof \stdClass)) {
42
			throw new \InvalidParameterException("Invalid input to \ElggRiverItem constructor");
43
		}
44
45
		// the casting is to support typed serialization like json
46
		$int_types = array('id', 'subject_guid', 'object_guid', 'target_guid', 'annotation_id', 'access_id', 'posted');
47
		foreach ($object as $key => $value) {
0 ignored issues
show
The expression $object of type object<stdClass> is not traversable.
Loading history...
48
			if (in_array($key, $int_types)) {
49
				$this->$key = (int)$value;
50
			} else {
51
				$this->$key = $value;
52
			}
53
		}
54
	}
55
56
	/**
57
	 * Get the subject of this river item
58
	 * 
59
	 * @return \ElggEntity
60
	 */
61
	public function getSubjectEntity() {
62
		return get_entity($this->subject_guid);
63
	}
64
65
	/**
66
	 * Get the object of this river item
67
	 *
68
	 * @return \ElggEntity
69
	 */
70
	public function getObjectEntity() {
71
		return get_entity($this->object_guid);
72
	}
73
74
	/**
75
	 * Get the target of this river item
76
	 *
77
	 * @return \ElggEntity
78
	 */
79
	public function getTargetEntity() {
80
		return get_entity($this->target_guid);
81
	}
82
83
	/**
84
	 * Get the Annotation for this river item
85
	 * 
86
	 * @return \ElggAnnotation
87
	 */
88
	public function getAnnotation() {
89
		return elgg_get_annotation_from_id($this->annotation_id);
90
	}
91
92
	/**
93
	 * Get the view used to display this river item
94
	 *
95
	 * @return string
96
	 */
97
	public function getView() {
98
		return $this->view;
99
	}
100
101
	/**
102
	 * Get the time this activity was posted
103
	 * 
104
	 * @return int
105
	 * @deprecated 1.9 Use getTimePosted()
106
	 */
107
	public function getPostedTime() {
108
		elgg_deprecated_notice("\ElggRiverItem::getPostedTime() deprecated in favor of getTimePosted()", 1.9);
109
		return (int)$this->posted;
110
	}
111
112
	/**
113
	 * Get the time this activity was posted
114
	 * 
115
	 * @return int
116
	 */
117
	public function getTimePosted() {
118
		return (int)$this->posted;
119
	}
120
121
	/**
122
	 * Get the type of the object
123
	 * 
124
	 * This is required for elgg_view_list_item(). All the other data types
125
	 * (entities, extenders, relationships) have a type/subtype.
126
	 *
127
	 * @return string 'river'
128
	 */
129
	public function getType() {
130
		return 'river';
131
	}
132
133
	/**
134
	 * Get the subtype of the object
135
	 * 
136
	 * This is required for elgg_view_list_item().
137
	 *
138
	 * @return string 'item'
139
	 */
140
	public function getSubtype() {
141
		return 'item';
142
	}
143
144
	/**
145
	 * Get a plain old object copy for public consumption
146
	 * 
147
	 * @return \stdClass
148
	 */
149
	public function toObject() {
150
		$object = new \stdClass();
151
		$object->id = $this->id;
152
		$object->subject_guid = $this->subject_guid;
153
		$object->object_guid = $this->object_guid;
154
		$object->annotation_id = $this->annotation_id;
155
		$object->read_access = $this->access_id;
156
		$object->action = $this->action_type;
157
		$object->time_posted = date('c', $this->getTimePosted());
158
		$object->enabled = $this->enabled;
159
		$params = array('item' => $this);
160
		return _elgg_services()->hooks->trigger('to:object', 'river_item', $params, $object);
161
	}
162
163
}
164