Issues (524)

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.

js/components/Dropdown.jsx (4 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
var React = require("react");
2
3
var Dropdown = React.createClass({
4
	propTypes: {
5
		options: React.PropTypes.arrayOf(React.PropTypes.shape({
6
			id: React.PropTypes.oneOfType([
0 ignored issues
show
'options.*.id' PropType is defined but prop is never used
Loading history...
7
				React.PropTypes.string,
8
				React.PropTypes.number
9
			]).isRequired,
10
			title: React.PropTypes.string.isRequired
0 ignored issues
show
'options.*.title' PropType is defined but prop is never used
Loading history...
11
		}).isRequired),
12
		defaultValue: React.PropTypes.oneOfType([
0 ignored issues
show
'defaultValue' PropType is defined but prop is never used
Loading history...
13
			React.PropTypes.string,
14
			React.PropTypes.number,
15
			React.PropTypes.array
16
		]),
17
		value: React.PropTypes.oneOfType([
18
			React.PropTypes.string,
19
			React.PropTypes.number,
20
			React.PropTypes.array
21
		]),
22
		disabled: React.PropTypes.bool,
0 ignored issues
show
'disabled' PropType is defined but prop is never used
Loading history...
23
		onSelect: React.PropTypes.func.isRequired
24
	},
25
26
	getDefaultProps: function() {
27
		return {
28
			defaultText: 'Select an option'
29
		};
30
	},
31
32
	componentDidMount: function() {
33
		this.initSelectize();
34
	},
35
36
	// When props get updated we re-initialise the selector
37
	componentDidUpdate: function() {
38
		this.removeSelectize();
39
		this.initSelectize();
40
	},
41
42
	componentWillUnmount: function() {
43
		// we want to destroy selectize to prevent
44
		// onUpdate events to hang around after this
45
		// component have been unmounted.
46
		this.removeSelectize();
47
	},
48
49
	selector: null,
50
51
	// We are using the selectize library instead of select2 because
52
	// select2 causes a lot of bugs and the hacks didn't do it anymore.
53
	// The biggest problem is displaying a select2 dropdown in a bootstrap
54
	// modal that has overflow scrolling will break the scrolling.
55
	initSelectize: function() {
56
		$(this.selector).selectize({
57
			valueField: 'id',
58
			labelField: 'title',
59
			searchField: 'title',
60
			options: this.props.options
61
		});
62
		// push the set the default value from react to selectize
63
		if (typeof this.props.value !== 'undefined') {
64
			$(this.selector)[0].selectize.setValue(this.props.value);
65
		}
66
		// make sure that react get notified when values are picked
67
		$(this.selector)[0].selectize.on("change", function(value) {
68
			this.props.onSelect(value);
69
		}.bind(this));
70
	},
71
72
	removeSelectize: function() {
73
		if ($(this.selector)[0].selectize) {
74
			$(this.selector)[0].selectize.destroy();
75
		}
76
	},
77
78
	render: function() {
79
		var props = this.props;
80
		var options = [];
81
		var idx = 0;
82
83
		if (props.options) {
84
			options = Object.keys(props.options).map(function(index) {
85
				idx += 1;
86
				return (
87
					<option
88
						key={idx}
89
						value={props.options[index].id}
90
					>
91
						{props.options[index].title}
92
					</option>
93
				);
94
			});
95
		}
96
97
		options.unshift(<option key={"default"} value={""} disabled>{props.defaultText}</option>);
98
		return (
99
			<select
100
				ref={function(node) { this.selector = node; }.bind(this)}
101
				id={props.name}
102
				className='form-control disable-select2'
103
				name={props.name}
104
				onChange={props.onSelect}
105
				value={props.value}
106
				disabled={props.disabled}
107
			>
108
				{options}
109
			</select>
110
		);
111
	}
112
});
113
114
module.exports = Dropdown;
115