Issues (49)

Security Analysis    12 potential vulnerabilities

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

  Cross-Site Scripting (10)
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 (2)
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.

webroot/compare/compare.php (9 issues)

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
<!doctype html>
2
<html lang=en>
3
<head>
4
<style>
5
6
body {
7
}
8
9
input[type=text] {
10
    width: 400px;
11
}
12
13
.hidden {
14
    display: none;
15
}
16
17
#wrap {
18
    position: relative;
19
    overflow: visible;
20
21
}
22
23
.stack {
24
    position: absolute;
25
    left: 0;
26
    top: 0;
27
}
28
29
.area {
30
    float: left;
31
    padding: 1em;
32
    background-color: #eee;
33
}
34
35
.invert {
36
    background-color: #666;
37
    color: white;
38
}
39
40
.json {
41
    min-height: 100px;
42
}
43
44
.top {
45
    z-index: 10;
46
}
47
48
</style>
49
</head>
50
51
<body>
52
<h1>Compare images</h1>
53
<p>Add link to images and visually compare them. Change the link och press return to load the image. Add <code>&amp;black</code> to the querystring to get a black background. <a href="http://dbwebb.se/opensource/cimage">Read more...</a></p>
54
55
<p><a id="permalink" href="?">Direct link to this setup.</a></p>
56
57
<form>
58
    <p>
59
        <label>Image 1: <input type="text" id="input1" data-id="1"></label> <img id="thumb1"></br>
60
        <label>Image 2: <input type="text" id="input2" data-id="2"></label> <img id="thumb2"></br>
61
        <label>Image 3: <input type="text" id="input3" data-id="3"></label> <img id="thumb3"></br>
62
        <label>Image 4: <input type="text" id="input4" data-id="4"></label> <img id="thumb4"></br>
63
        <label>Image 5: <input type="text" id="input5" data-id="5"></label> <img id="thumb5"></br>
64
        <label>Image 6: <input type="text" id="input6" data-id="6"></label> <img id="thumb6"></br>
65
        <label><input type="checkbox" id="viewDetails">Show image details</label><br/>
66
        <label><input type="checkbox" id="stack">Stack images?</label><br/>
67
        <label><input type="checkbox" id="bg">Dark background?</label>
68
    </p>
69
</form>
70
71
<div id="buttonWrap" class="hidden">
72
    <button id="button1" class="button" data-id="1">Image 1</button>
73
    <button id="button2" class="button" data-id="2">Image 2</button>
74
    <button id="button3" class="button" data-id="3">Image 3</button>
75
    <button id="button4" class="button" data-id="4">Image 4</button>
76
    <button id="button5" class="button" data-id="5">Image 5</button>
77
    <button id="button6" class="button" data-id="6">Image 6</button>
78
</div>
79
80
<div id="wrap">
81
82
    <div id="area1" class="area">
83
        <code>Image 1</code><br>
84
        <img id="img1">
85
        <pre id="json1" class="json hidden"></pre>
86
    </div>
87
88
    <div id="area2" class="area">
89
        <code>Image 2</code><br>
90
        <img id="img2">
91
        <pre id="json2" class="json hidden"></pre>
92
    </div>
93
94
    <div id="area3" class="area">
95
        <code>Image 3</code><br>
96
        <img id="img3">
97
        <pre id="json3" class="json hidden"></pre>
98
    </div>
99
100
    <div id="area4" class="area">
101
        <code>Image 4</code><br>
102
        <img id="img4">
103
        <pre id="json4" class="json hidden"></pre>
104
    </div>
105
106
    <div id="area5" class="area">
107
        <code>Image 5</code><br>
108
        <img id="img5">
109
        <pre id="json5" class="json hidden"></pre>
110
    </div>
111
112
    <div id="area6" class="area">
113
        <code>Image 6</code><br>
114
        <img id="img6">
115
        <pre id="json6" class="json hidden"></pre>
116
    </div>
117
118
</div>
119
120
121
</body>
122
123
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
124
<script src="../js/cimage.js"></script>
125
<script>
126
<?php
127
if (isset($_GET['input1'])) {
128
    // Use incoming from querystring as defaults
129
?>
130
    CImage.compare({
131
        "input1": "<?=$_GET['input1']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input1'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 131

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
132
        "input2": "<?=$_GET['input2']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input2'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 132

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
133
        "input3": "<?=$_GET['input3']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input3'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 133

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
134
        "input4": "<?=$_GET['input4']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input4'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 134

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
135
        "input5": "<?=$_GET['input5']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input5'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 135

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
136
        "input6": "<?=$_GET['input6']?>",
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['input6'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 136

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
137
        "json": <?=$_GET['json']?>,
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['json'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 137

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
138
        "stack": <?=$_GET['stack']?>,
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['stack'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 138

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
139
        "bg": <?=$_GET['bg']?>
0 ignored issues
show
Security Cross-Site Scripting introduced by
$_GET['bg'] can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

1 path for user data to reach this point

  1. Read from $_GET
    in webroot/compare/compare.php on line 139

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
140
    });
141
<?php
142
} elseif (isset($script)) {
143
    // Use default setup from js configuration
144
    echo $script;
145
} else {
146
    // Use defaults
147
    echo "CImage.compare({});";
148
} ?>
149
</script>
150
151
</html>
152