Issues (1751)

Security Analysis    not enabled

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.

lib/templates/pobject/dialog.rewrite.save.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
	ldDisablePostProcessing();
3
	$ARCurrent->nolangcheck=true;
4
	if (!$this->validateFormSecret()) {
5
		error($ARnls['ariadne:err:invalidsession']);
6
		exit;
7
	}
8
	if ($this->CheckLogin('edit') && $this->CheckConfig()) {
9
		// FIXME: Check vars first;
10
11
		$oldurl = $this->getvar('oldurl');
12
		$newurl = $this->getvar('newurl');
13
14
		$oldreference = $this->getvar('oldreference');
15
		$newreference = $this->getvar('newreference');
16
17
		if ($oldurl && $newurl) {
18
			$rewrite_urls = array(
19
				$oldurl => $newurl
20
			);
21
		};
22
23
		if ($oldreference && $newreference) {
24
			$rewrite_references = array(
25
				$oldreference => $newreference
26
			);
27
		};
28
29
		if ($rewrite_urls || $rewrite_references) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $rewrite_urls of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
Bug Best Practice introduced by
The expression $rewrite_references of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
30
			$query = "object.path =~ '" . $this->path . "%' order by path ASC";
31
32
			$total = $this->count_find($this->path, $query);
33
			$objects_left = $total;
34
			$offset = 0;
35
36
			// amount of objects to process in one run. Smaller stepsize
37
			// gives more updates but takes a bit longer. This way there
38
			// are usually 20 steps to give a nice resolution on the
39
			// updates.
40
41
			$stepsize = (int)($total/20);
42
			if ($stepsize < 5) {
43
				$stepsize = 5;
44
			}
45
			if ($stepsize > 100) {
46
				$stepsize = 100;
47
			}
48
49
			$current_object_path = $this->path;
50 View Code Duplication
			if (strlen($current_object_path) > 25) {
51
				$current_object_path = substr($this->path, 0, 12) . "..." . substr($this->path, strlen($this->path) - 12, strlen($this->path));
52
			}
53
			?>
54
			<div id="rewrite"><?php echo $ARnls["ariadne:rewriting"] . " " . $current_object_path; ?></div>
55
			<div id="progressbar">
56
				<div id="progress"></div>
57
				<div id="progress_text">0/<?php echo $total; ?></div>
58
			</div>
59
			<?php
60
61
			do {
62
				flush();
63
				set_time_limit(30);
64
				$objects = $this->find($this->path, $query, "system.get.phtml", array(), $stepsize, $offset);
65
66
				foreach ($objects as $object) {
67
					$error = false;
68
					$error = current($this->get($object->path, "system.rewrite.urls.php", array("rewrite_urls" => $rewrite_urls)));
69
					if (!$error) {
70
						$error = current($this->get($object->path, "system.rewrite.htmlblocks.php", array("rewrite_urls" => $rewrite_urls)));
71
						if (!$error) {
72
							$error = current($this->get($object->path, "system.rewrite.references.php", array("rewrite_references" => $rewrite_references)));
73
						}
74
					}
75
76
					if ($error) {
77
						?>
78
						<script type="text/javascript">
79
							alert("<?php echo addslashes($error); ?>");
80
						</script>
81
						<?php
82
						return false;
83
					}
84
85
				}
86
87
				$new_objects_left = $objects_left - sizeof($objects);
88
				$next_object_path = current($this->find($this->path, $query, "system.get.path.phtml", array(), 1, $offset));
89
				if (strlen($next_object_path) > 25) {
90
					$next_object_path = substr($next_object_path, 0, 12) . "..." . substr($next_object_path, strlen($next_object_path) - 12, strlen($next_object_path));
91
				}
92
93
				$objects_handled = $objects_left - $new_objects_left;
94
				$objects_skipped = $stepsize - $objects_handled;
95
				$offset += count( $objects );
96
				$objects_left = $new_objects_left;
97
				$items_processed = $total-($objects_left-$offset);
98
				if ($items_processed > $total) {
99
					$items_processed = $total;
100
				}
101
102
				//echo "Changed owner for $stepsize items<br>";
103
				$progress = (int)(100*($offset)/$total);
104
105
				if ($progress < 0) {
106
					$progress = 0;
107
				}
108
				if ($progress > 100) {
109
					$progress = 100;
110
				}
111
				echo "<script type='text/javascript'>\n";
112
				echo "document.getElementById('progress').style.width = '" . $progress . "%';\n";
113
				echo "document.getElementById('progress_text').innerHTML = '" . $offset . "/" . $total . "';\n";
114
				echo "document.getElementById('rewrite').innerHTML = '" . $ARnls["ariadne:rewriting"] . " " . $next_object_path . "';\n";
115
				echo "</script>";
116
				flush();
117
			} while (count($objects) == $stepsize);
118
119
?>
120
			<script type='text/javascript'>
121
				document.getElementById('progress_text').innerHTML = 'Done';
122
				document.getElementById('progress').style.width = '100%';
123
				document.getElementById('rewrite').innerHTML = '<?php echo $ARnls["ariadne:rewriting"] . " " . $current_object_path; ?>';
124
125
				if ( window.opener && window.opener.muze && window.opener.muze.ariadne && window.opener.muze.ariadne.registry ) {
126
					window.opener.muze.ariadne.explore.objectadded();
127
				}
128
				window.close();
129
			</script>
130
<?php
131
		} else {
132
			echo $ARnls['ariadne:err:rewrite.no_input'];
133
		}
134
	}
135
?>
136