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/ar/beta/diff.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
	global $AR;
3
	require_once($AR->dir->install."/lib/includes/diff/DiffEngine.php");
4
	require_once($AR->dir->install."/lib/includes/diff/ariadne.diff.inc");
5
6
	ar_pinp::allow( 'ar_beta_diff' );
7
8
	class ar_beta_diff extends arBase {
9
		public static function diff ($a, $b){
10
			$a = is_array($a) ? $a : explode("\n", $a);
11
			$b = is_array($b) ? $b : explode("\n", $b);
12
13
			$diff = new Diff($a, $b);
14
15
			if ($diff) {
16
				$formatter = new AriadneDiffFormatter();
17
				$result = $formatter->format($diff);
18
19
				$rows = ar_html::nodes();
20
				foreach ($result as $line) {
0 ignored issues
show
The expression $result of type string is not traversable.
Loading history...
21
					$cells = ar_html::nodes();
22
					foreach ($line as $content) {
23
						if (is_array($content)) {
24
							$options = array();
25
							if ($content['class']) {
26
								$options['class'] = $content['class'];
27
							}
28
							if ($content['colspan']) {
29
								$options['colspan'] = $content['colspan'];
30
							}
31
32
							$cell = ar_html::tag("td", $options, $content['data']);
33
							$cells[] = $cell;
34
						} else {
35
							$cells[] = ar_html::tag("td", $content);
36
						}
37
					}
38
					$rows[] = ar_html::tag("tr", $cells);
39
				}
40
41
				if (count($rows)) {
42
					$table = ar_html::tag("table", array("class" => "diff"), $rows);
43
					$table->insertBefore(ar_html::tag("col", array("class" => "content")), $table->firstChild);
44
					$table->insertBefore(ar_html::tag("col"), $table->firstChild);
45
					$table->insertBefore(ar_html::tag("col", array("class" => "content")), $table->firstChild);
46
					$table->insertBefore(ar_html::tag("col"), $table->firstChild);
47
48
					return $table;
49
				}
50
			}
51
		}
52
53
		public static function style () {
54
			$css = ar_css::stylesheet()
55
			->import("
56
				html.js .diff-js-hidden { display:none; }
57
				.diff-inline-metadata {
58
				  padding:4px;
59
				  border:1px solid #ddd;
60
				  background:#fff;
61
				  margin:0px 0px 10px;
62
				  }
63
64
				.diff-inline-legend { font-size:11px; }
65
66
				.diff-inline-legend span,
67
				.diff-inline-legend label { margin-right:5px; }
68
69
				/**
70
				 * Inline diff markup
71
				 */
72
				span.diff-deleted { color:#ccc; }
73
				span.diff-deleted img { border: solid 2px #ccc; }
74
				span.diff-changed { background:#ffb; }
75
				span.diff-changed img { border:solid 2px #ffb; }
76
				span.diff-added { background:#cfc; }
77
				span.diff-added img { border: solid 2px #cfc; }
78
79
				/**
80
				 * Traditional split diff theming
81
				 */
82
				table.diff {
83
				  border-spacing: 0px;
84
				  border-collapse: collapse;
85
				  margin-bottom: 20px;
86
				  width: 100%;
87
				  table-layout: fixed;
88
				}
89
				table.diff col {
90
					width: 1.4em;
91
				}
92
				table.diff col.content {
93
					width: 50%;
94
				}
95
				table.diff tr.even, table.diff tr.odd {
96
				  background-color: inherit;
97
				  border: none;
98
				}
99
				td.diff-prevlink {
100
				  text-align: left;
101
				}
102
				td.diff-nextlink {
103
				  text-align: right;
104
				}
105
				td.diff-section-title, div.diff-section-title {
106
				  background-color: #f0f0ff;
107
				  font-size: 0.83em;
108
				  font-weight: bold;
109
				  padding: 0.1em 1em;
110
				}
111
				table.diff td {
112
					vertical-align: top;
113
					border-bottom: 1px solid #CCCCCC;
114
				}
115
116
				td.diff-deletedline {
117
				  background-color: #ffa;
118
				  width: 50%;
119
				}
120
				td.diff-addedline {
121
				  background-color: #afa;
122
				  width: 50%;
123
				}
124
				td.diff-context {
125
				  background-color: #fafafa;
126
				}
127
				span.diffchange {
128
				  color: #f00;
129
				  font-weight: bold;
130
				}
131
132
				table.diff col.diff-marker {
133
				  width: 1.4em;
134
				}
135
				table.diff col.diff-content {
136
				  width: 50%;
137
				}
138
				table.diff th {
139
				  padding-right: inherit;
140
				}
141
				table.diff td div {
142
				  overflow: auto;
143
				  padding: 0.1ex 0.5em;
144
				  word-wrap: break-word;
145
				}
146
				table.diff td {
147
				  padding: 0.1ex 0.4em;
148
				}
149
			");
150
151
			return $css;
152
		}
153
	}
154