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/includes/diff/ariadne.diff.inc (1 issue)

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
 * Theme function for a header line in the diff.
4
 */
5
function diff_header_line($vars) {
6
	return '<strong>Line ' . $vars['lineno']. '</strong>';
7
}
8
9
function check_plain($text) {
10
	return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
11
}
12
13
/**
14
 * Theme function for a content line in the diff.
15
 */
16
function diff_content_line($vars) {
17
  return '<div>'. $vars['line'] .'</div>';
18
}
19
20
/**
21
 * Theme function for an empty line in the diff.
22
 */
23
function diff_empty_line($vars) {
24
  return $vars['line'];
25
}
26
27
/**
28
 * Diff formatter for Ariadne
29
 * @private
30
 * @subpackage DifferenceEngine
31
 */
32
class AriadneDiffFormatter extends DiffFormatter {
33
34
  var $rows;
35
36
  function __construct() {
37
    $this->leading_context_lines = 2;
38
    $this->trailing_context_lines = 2;
39
  }
40
41
  function _start_diff() {
42
    $this->rows = array();
43
  }
44
45
  function _end_diff() {
46
    return $this->rows;
47
  }
48
49
  function _block_header($xbeg, $xlen, $ybeg, $ylen) {
50
    return array(
51
      array(
52
        'data' => diff_header_line(array('lineno' => $xbeg)),
53
        'colspan' => 2,
54
      ),
55
      array(
56
        'data' => diff_header_line(array('lineno' => $ybeg)),
57
        'colspan' => 2,
58
      )
59
    );
60
  }
61
62
  function _start_block($header) {
63
    if ($this->show_header) {
64
      $this->rows[] = $header;
65
    }
66
  }
67
68
  function _end_block() {
69
  }
70
71
  function _lines($lines, $prefix=' ', $color='white') {
0 ignored issues
show
The parameter $color is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
72
  }
73
74
  /**
75
   * Note: you should HTML-escape parameter before calling this.
76
   */
77
  function addedLine($line) {
78
    return array(
79
      '+',
80
      array(
81
        'data' => diff_content_line(array('line' => $line)),
82
        'class' => 'diff-addedline',
83
      )
84
    );
85
  }
86
87
  /**
88
   * Note: you should HTML-escape parameter before calling this.
89
   */
90
  function deletedLine($line) {
91
    return array(
92
      '-',
93
      array(
94
        'data' => diff_content_line(array('line' => $line)),
95
        'class' => 'diff-deletedline',
96
      )
97
    );
98
  }
99
100
  /**
101
   * Note: you should HTML-escape parameter before calling this.
102
   */
103
  function contextLine($line) {
104
    return array(
105
      '&nbsp;',
106
      array(
107
        'data' => diff_content_line(array('line' => $line)),
108
        'class' => 'diff-context',
109
      )
110
    );
111
  }
112
113
  function emptyLine() {
114
    return array(
115
      '&nbsp;',
116
      diff_empty_line(array('line' => '&nbsp;')),
117
    );
118
  }
119
120
  function _added($lines) {
121 View Code Duplication
    foreach ($lines as $line) {
122
      $this->rows[] = array_merge($this->emptyLine(), $this->addedLine(check_plain($line)));
123
    }
124
  }
125
126
  function _deleted($lines) {
127 View Code Duplication
    foreach ($lines as $line) {
128
      $this->rows[] = array_merge($this->deletedLine(check_plain($line)), $this->emptyLine());
129
    }
130
  }
131
132
  function _context($lines) {
133
    foreach ($lines as $line) {
134
      $this->rows[] = array_merge($this->contextLine(check_plain($line)), $this->contextLine(check_plain($line)));
135
    }
136
  }
137
138
  function _changed($orig, $closing) {
139
    $diff = new WordLevelDiff($orig, $closing);
140
    $del = $diff->orig();
141
    $add = $diff->closing();
142
143
    // Notice that WordLevelDiff returns HTML-escaped output.
144
    // Hence, we will be calling addedLine/deletedLine without HTML-escaping.
145
146
    while ($line = array_shift($del)) {
147
      $aline = array_shift( $add );
148
      $this->rows[] = array_merge($this->deletedLine($line), $this->addedLine($aline));
149
    }
150
    foreach ($add as $line) {  // If any leftovers
151
      $this->rows[] = array_merge($this->emptyLine(), $this->addedLine($line));
152
    }
153
  }
154
}
155