Issues (843)

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.

tracker-data.php (1 issue)

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
require_once('require/class.Connection.php');
3
require_once('require/class.Tracker.php');
4
require_once('require/class.Language.php');
5
require_once('require/class.Common.php');
6
require_once('require/class.TrackerLive.php');
7
require_once('require/class.TrackerArchive.php');
8
require_once('require/class.Elevation.php');
9
$TrackerLive = new TrackerLive();
10
$TrackerArchive = new TrackerArchive();
11
$Elevation = new Elevation();
12
$Common = new Common();
13
14
$from_archive = false;
15
if (isset($_GET['ident'])) {
16
	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
17
	if (isset($_GET['currenttime'])) {
18
		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
19
		$currenttime = round($currenttime/1000);
20
		$spotter_array = $TrackerLive->getDateLiveTrackerDataByIdent($ident,$currenttime);
21
		if (empty($spotter_array)) {
22
			$from_archive = true;
23
			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataByIdent($ident,$currenttime);
24
		}
25
		
26
	} else {
27
		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
28
		if (empty($spotter_array)) {
29
			$from_archive = true;
30
			$spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident);
31
		}
32
	}
33
}
34
if (isset($_GET['famtrackid'])) {
35
	$famtrackid = urldecode(filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING));
36
	if (isset($_GET['currenttime'])) {
37
		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
38
		$currenttime = round($currenttime/1000);
39
		$spotter_array = $TrackerLive->getDateLiveTrackerDataById($famtrackid,$currenttime);
40
		
41
		if (empty($spotter_array)) {
42
			$from_archive = true;
43
//			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
44
			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataById($famtrackid,$currenttime);
45
		}
46
		
47
	} else {
48
		$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrackid);
49
		if (empty($spotter_array)) {
50
			$from_archive = true;
51
			$spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($famtrackid);
52
		}
53
	}
54
}
55
 ?>
56
<div class="alldetails">
57
<button type="button" class="close">&times;</button>
58
<?php
59
$spotter_item = $spotter_array[0];
60
date_default_timezone_set('UTC');
61
if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
62
{
63
	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
64
		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
65
	} else $image = $spotter_item['image_thumbnail'];
66
67
}
68
/* else {
69
	$image = "images/placeholder_thumb.png";
70
} */
71
72
print '<div class="top">';
73
if (isset($image)) {
74
	print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image &copy; '.$spotter_item['image_copyright'].'"/><br />Image &copy; '.$spotter_item['image_copyright'].'</div>';
75
}
76
//print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['famtrackid'].'" target="_blank">'.$spotter_item['ident'].'</a></div>';
77
print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['ident'].'</div>';
78
print '</div>';
79
print '</div></div>';
80
print '<div class="details">';
81
print '<div><span>'._("Altitude").'</span>';
82
if (isset($globalGroundAltitude) && $globalGroundAltitude) {
83
    try {
84
	$groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']);
85
    } catch(Exception $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
86
    }
87
}
88
print '<span class="altitude">';
89
if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
90
	print $spotter_item['altitude'].' feet (FL'.$spotter_item['altitude'].')';
91
} else {
92
	print round($spotter_item['altitude']*0.3048).' m (FL'.round($spotter_item['altitude']/100).')';
93
}
94
print '</span>';
95
if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*0.3048) {
96
    print '<br>';
97
    print '<span>'._("Ground Altitude").'</span>';
98
    print '<i>';
99
    print '<span class="groundaltitude">';
100
    if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
101
	print round($groundAltitude*3.28084).' feet';
102
    } else {
103
	print round($groundAltitude).' m';
104
    }
105
    print '</span>';
106
    print '</i>';
107
}
108
print '</div>';
109
print '<div><span>'._("Speed").'</span>';
110
if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
111
	print round($spotter_item['ground_speed']*0.621371).' mph';
112
} elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
113
	print round($spotter_item['ground_speed']*0.539957).' knots';
114
} else {
115
	print $spotter_item['ground_speed'].' km/h';
116
}
117
print '</div>';
118
print '<div><span>'._("Coordinates").'</span>';
119
if ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dms') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dms')) {
120
	$latitude = $Common->convertDMS($spotter_item['latitude'],'latitude');
121
	print '<span class="latitude">'.$latitude['deg'].'° '.$latitude['min']."′ ".$latitude['sec'].'" '.$latitude['NSEW'].'</span>, ';
122
	$longitude = $Common->convertDMS($spotter_item['longitude'],'longitude');
123
	print '<span class="longitude">'.$longitude['deg'].'° '.$longitude['min']."′ ".$longitude['sec'].'" '.$longitude['NSEW'].'</span>';
124
} elseif ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dm') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dm')) {
125
	$latitude = $Common->convertDM($spotter_item['latitude'],'latitude');
126
	print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'],3)."′ ".$latitude['NSEW'].'</span>, ';
127
	$longitude = $Common->convertDM($spotter_item['longitude'],'longitude');
128
	print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'],3)."′ ".$longitude['NSEW'].'</span>';
129
} else {
130
	print '<span class="latitude">'.$spotter_item['latitude'].'</span>, ';
131
	print '<span class="longitude">'.$spotter_item['longitude'].'</span>';
132
}
133
print '</div>';
134
print '<div><span>'._("Type").'</span>'.$spotter_item['type'].'</div>';
135
print '<div><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>';
136
if (isset($spotter_item['over_country']) && $spotter_item['over_country'] != '') {
137
	print '<div><span>'._("Over country").'</span>';
138
	print $spotter_item['over_country'];
139
	print '</div>';
140
}
141
if (isset($spotter_item['source_name']) && $spotter_item['source_name'] != '') {
142
	print '<div><span>'._("Source").'</span>';
143
	print $spotter_item['source_name'];
144
	print '</div>';
145
}
146
if (isset($spotter_item['comment']) && $spotter_item['comment'] != '') {
147
	print '<div><span>'._("Comment").'</span>';
148
	print $spotter_item['comment'];
149
	print '</div>';
150
}
151
if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
152
	print '<a href="?3d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>';
153
} else {
154
	print '<a href="?2d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>';
155
}
156
print '</div>';
157
print '</div>';
158
?>
159
</div>