Issues (49)

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.

src/Adapter/Runtime.php (2 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
2
/**
3
 * Part of the Joomla Framework Cache Package
4
 *
5
 * @copyright  Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
6
 * @license    GNU General Public License version 2 or later; see LICENSE
7
 */
8
9
namespace Joomla\Cache\Adapter;
10
11
use Joomla\Cache\AbstractCacheItemPool;
12
use Joomla\Cache\Item\Item;
13
use Psr\Cache\CacheItemInterface;
14
15
/**
16
 * Runtime memory cache driver.
17
 *
18
 * @since       1.0
19
 * @deprecated  The joomla/cache package is deprecated
20
 */
21
class Runtime extends AbstractCacheItemPool
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Cache\AbstractCacheItemPool has been deprecated with message: The joomla/cache package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
22
{
23
	/**
24
	 * Database of cached items, we use ArrayObject so it can be easily passed by reference
25
	 *
26
	 * @var    \ArrayObject
27
	 * @since  __DEPLOY_VERSION__
28
	 */
29
	protected $db;
30
31
	/**
32
	 * Constructor.
33
	 *
34
	 * @param   mixed  $options  An options array, or an object that implements \ArrayAccess
35
	 *
36
	 * @since   __DEPLOY_VERSION__
37
	 */
38 18
	public function __construct($options = array())
39
	{
40 18
		parent::__construct($options);
41
42 18
		$this->db = new \ArrayObject;
43 18
	}
44
45
	/**
46
	 * This will wipe out the entire cache's keys
47
	 *
48
	 * @return  boolean  True if the pool was successfully cleared. False if there was an error.
49
	 *
50
	 * @since   1.0
51
	 */
52 18
	public function clear()
53
	{
54
		// Replace the db with a new blank array
55 18
		$clearData = $this->db->exchangeArray(array());
56 18
		unset($clearData);
57
58 18
		return true;
59
	}
60
61
	/**
62
	 * Returns a Cache Item representing the specified key.
63
	 *
64
	 * @param   string  $key  The key for which to return the corresponding Cache Item.
65
	 *
66
	 * @return  CacheItemInterface  The corresponding Cache Item.
67
	 *
68
	 * @since   __DEPLOY_VERSION__
69
	 */
70 11
	public function getItem($key)
71
	{
72 11
		$item = new Item($key);
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Cache\Item\Item has been deprecated with message: The joomla/cache package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
73
74 11
		if ($this->hasItem($key))
75
		{
76 9
			$item->set($this->db[$key]);
77
		}
78
79 11
		return $item;
80
	}
81
82
	/**
83
	 * Removes the item from the pool.
84
	 *
85
	 * @param   string  $key  The key to delete.
86
	 *
87
	 * @return  boolean  True if the item was successfully removed. False if there was an error.
88
	 *
89
	 * @since   __DEPLOY_VERSION__
90
	 */
91 4
	public function deleteItem($key)
92
	{
93 4
		if ($this->hasItem($key))
94
		{
95 4
			$newCache = array_diff_key($this->db->getArrayCopy(), array($key => $key));
96 4
			$this->db->exchangeArray($newCache);
97
		}
98
99 4
		return true;
100
	}
101
102
	/**
103
	 * Persists a cache item immediately.
104
	 *
105
	 * @param   CacheItemInterface  $item  The cache item to save.
106
	 *
107
	 * @return  boolean  True if the item was successfully persisted. False if there was an error.
108
	 *
109
	 * @since   __DEPLOY_VERSION__
110
	 */
111 15
	public function save(CacheItemInterface $item)
112
	{
113 15
		$this->db[$item->getKey()] = $item->get();
114
115 15
		return true;
116
	}
117
118
	/**
119
	 * Confirms if the cache contains specified cache item.
120
	 *
121
	 * @param   string  $key  The key for which to check existence.
122
	 *
123
	 * @return  boolean  True if item exists in the cache, false otherwise.
124
	 *
125
	 * @since   1.0
126
	 */
127 15
	public function hasItem($key)
128
	{
129 15
		return array_key_exists($key, $this->db);
130
	}
131
132
	/**
133
	 * Test to see if the CacheItemPoolInterface is available
134
	 *
135
	 * @return  boolean  True on success, false otherwise
136
	 *
137
	 * @since   __DEPLOY_VERSION__
138
	 */
139
	public static function isSupported(): bool
140
	{
141
		return true;
142
	}
143
}
144