Issues (2013)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

unsupported_plugins/HtmlTidy/html-tidy-logic.php (3 issues)

1
<?php
2
##
3
##  Plugin for htmlArea, to run code through the server's HTML Tidy
4
##   By Adam Wright, for The University of Western Australia
5
##    This is the server-side script, which dirty code is run through.
6
##
7
##  Distributed under the same terms as HTMLArea itself.
8
##  This notice MUST stay intact for use (see license.txt).
9
##
10
11
// Get the original source
12
$source = $_POST['htisource_name'];
13
$source = stripslashes($source);
14
$cwd    = str_replace("\\", '/', getcwd()) . '/';
15
16
// Open a tidy process - I hope it's installed!
17
$descriptorspec = [
18
    0 => ['pipe', 'r'],
19
    1 => ['pipe', 'w']
20
];
21
$process        = @proc_open("tidy -utf8 -config {$cwd}html-tidy-config.cfg", $descriptorspec, $pipes);
22
23
// Make sure the program started and we got the hooks...
24
// Either way, get some source code into $source
25
if (is_resource($process)) {
26
    // Feed untidy source into the stdin
27
    fwrite($pipes[0], $source);
28
    fclose($pipes[0]);
29
30
    // Read clean source out to the browser
31
    while (!feof($pipes[1])) {
32
        //echo fgets($pipes[1], 1024);
33
        $newsrc .= fgets($pipes[1], 1024);
34
    }
35
    fclose($pipes[1]);
36
37
    // Clean up after ourselves
38
    proc_close($process);
39
} else {
40
    /* Use tidy if it's available from PECL */
41
    if (function_exists('tidy_parse_string')) {
42
        $tempsrc = tidy_parse_string($source);
43
        tidy_clean_repair();
0 ignored issues
show
The call to tidy_clean_repair() has too few arguments starting with object. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
        /** @scrutinizer ignore-call */ 
44
        tidy_clean_repair();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
44
        $newsrc = tidy_get_output();
0 ignored issues
show
The call to tidy_get_output() has too few arguments starting with object. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
        $newsrc = /** @scrutinizer ignore-call */ tidy_get_output();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
45
    } else {
46
        // Better give them back what they came with, so they don't lose it all...
47
        $newsrc = "<body>\n" . $source . "\n</body>";
48
    }
49
}
50
51
// Split our source into an array by lines
52
$srcLines = preg_split("/\n/", $newsrc, -1, PREG_SPLIT_NO_EMPTY);
53
54
// Get only the lines between the body tags
55
$startLn = 0;
56
while (false === strpos($srcLines[$startLn++], '<body') && $startLn < sizeof($srcLines)) {
57
    ;
58
}
59
$endLn = $startLn;
60
while (false === strpos($srcLines[$endLn++], '</body') && $endLn < sizeof($srcLines)) {
61
    ;
62
}
63
64
$srcLines = array_slice($srcLines, $startLn, ($endLn - $startLn - 1));
65
66
// Create a set of javascript code to compile a new source string
67
foreach ($srcLines as $line) {
68
    $jsMakeSrc .= "\tns += '" . str_replace("'", "\'", $line) . "\\n';\n";
69
}
70
if (!sizeof($srcLines)) {
71
    echo "alert(HTMLArea._lc('Tidy failed.  Check your HTML for syntax errors.', 'HtmlTidy'));\n";
72
} else {
73
    ?>
74
    var ns="";
75
    <?php echo $jsMakeSrc; ?>
76
    editor.setHTML(ns);
77
<? } ?>
0 ignored issues
show
Security Best Practice introduced by
It is not recommended to use PHP's short opening tag <?, better use <?php, or <?= in case of outputting.

Short opening tags are disabled in PHP?s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.

As a precaution to avoid these problems better use the long opening tag <?php.

Loading history...
78