Issues (1844)

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.

amenadiel/jpgraph/src/graph/WindroseGraph.php (1 issue)

Severity
1
<?php
2
3
/**
4
 * JPGraph v4.0.3
5
 */
6
7
namespace Amenadiel\JpGraph\Graph;
8
9
use Amenadiel\JpGraph\Plot;
10
use Amenadiel\JpGraph\Text;
11
use Amenadiel\JpGraph\Util;
12
13
/**
14
 * @class WindroseGraph
15
 */
16
class WindroseGraph extends Graph
17
{
18
    private $posx;
19
    private $posy;
20
    public $plots = [];
21
22
    public function __construct($width = 300, $height = 200, $cachedName = '', $timeout = 0, $inline = 1)
23
    {
24
        parent::__construct($width, $height, $cachedName, $timeout, $inline);
25
        $this->posx = $width / 2;
26
        $this->posy = $height / 2;
27
        $this->SetColor('white');
28
        $this->title->SetFont(FF_VERDANA, FS_NORMAL, 12);
29
        $this->title->SetMargin(8);
30
        $this->subtitle->SetFont(FF_VERDANA, FS_NORMAL, 10);
31
        $this->subtitle->SetMargin(0);
32
        $this->subsubtitle->SetFont(FF_VERDANA, FS_NORMAL, 8);
33
        $this->subsubtitle->SetMargin(0);
34
    }
35
36
    public function StrokeTexts()
37
    {
38
        if ($this->texts != null) {
39
            $n = safe_count($this->texts);
40
            for ($i = 0; $i < $n; ++$i) {
41
                $this->texts[$i]->Stroke($this->img);
42
            }
43
        }
44
    }
45
46
    public function StrokeIcons()
47
    {
48
        if ($this->iIcons != null) {
49
            $n = safe_count($this->iIcons);
50
            for ($i = 0; $i < $n; ++$i) {
51
                // Since Windrose graphs doesn't have any linear scale the position of
52
                // each icon has to be given as absolute coordinates
53
                $this->iIcons[$i]->_Stroke($this->img);
54
            }
55
        }
56
    }
57
58
    /**
59
     * PUBLIC METHODS.
60
     *
61
     * @param mixed $aObj
62
     */
63
    public function Add($aObj)
64
    {
65
        if (is_array($aObj) && safe_count($aObj) > 0) {
66
            $cl = $aObj[0];
67
        } else {
68
            $cl = $aObj;
69
        }
70
        if ($cl instanceof Text\Text) {
71
            $this->AddText($aObj);
72
        } elseif ($cl instanceof Plot\IconPlot) {
73
            $this->AddIcon($aObj);
74
        } elseif (($cl instanceof Plot\WindrosePlot)) {
75
            $this->plots[] = $aObj;
76
        } else {
77
            Util\JpGraphError::RaiseL(22021);
78
        }
79
    }
80
81
    public function AddText($aTxt, $aToY2 = false)
82
    {
83
        parent::AddText($aTxt);
84
    }
85
86
    public function SetColor($c)
87
    {
88
        $this->SetMarginColor($c);
89
    }
90
91
    // Method description
92
    public function Stroke($aStrokeFileName = '')
93
    {
94
        // If the filename is the predefined value = '_csim_special_'
95
        // we assume that the call to stroke only needs to do enough
96
        // to correctly generate the CSIM maps.
97
        // We use this variable to skip things we don't strictly need
98
        // to do to generate the image map to improve performance
99
        // as best we can. Therefore you will see a lot of tests !$_csim in the
100
        // code below.
101
        $_csim = ($aStrokeFileName === _CSIM_SPECIALFILE);
0 ignored issues
show
The assignment to $_csim is dead and can be removed.
Loading history...
102
103
        // We need to know if we have stroked the plot in the
104
        // GetCSIMareas. Otherwise the CSIM hasn't been generated
105
        // and in the case of GetCSIM called before stroke to generate
106
        // CSIM without storing an image to disk GetCSIM must call Stroke.
107
        $this->iHasStroked = true;
108
109
        if ($this->background_image != '' || $this->background_cflag != '') {
110
            $this->StrokeFrameBackground();
111
        } else {
112
            $this->StrokeFrame();
113
        }
114
115
        // n holds number of plots
116
        $n = safe_count($this->plots);
117
        for ($i = 0; $i < $n; ++$i) {
118
            $this->plots[$i]->Stroke($this);
119
        }
120
121
        $this->footer->Stroke($this->img);
122
        $this->StrokeIcons();
123
        $this->StrokeTexts();
124
        $this->StrokeTitles();
125
126
        // If the filename is given as the special "__handle"
127
        // then the image handler is returned and the image is NOT
128
        // streamed back
129
        if ($aStrokeFileName == _IMG_HANDLER) {
130
            return $this->img->img;
131
        }
132
        // Finally stream the generated picture
133
        $this->cache->PutAndStream(
134
            $this->img,
135
            $this->cache_name,
136
            $this->inline,
137
            $aStrokeFileName
138
        );
139
    }
140
} // @class
141