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.

vendor/amenadiel/jpgraph/src/graph/Grid.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\Util;
10
11
/**
12
 * @class Grid
13
 * // Description: responsible for drawing grid lines in graph
14
 */
15
class Grid
16
{
17
    protected $img;
18
    protected $scale;
19
    protected $majorcolor  = '#CCCCCC';
20
    protected $minorcolor  = '#DDDDDD';
21
    protected $majortype   = 'solid';
22
    protected $minortype   = 'solid';
23
    protected $show        = false;
24
    protected $showMinor   = false;
25
    protected $majorweight = 1;
26
    protected $minorweight = 1;
27
    protected $fill        = false;
28
    protected $fillcolor   = ['#EFEFEF', '#BBCCFF'];
29
30
    public function __construct($aAxis)
31
    {
32
        $this->scale = $aAxis->scale;
33
        $this->img   = $aAxis->img;
34
    }
35
36
    public function SetColor($aMajColor, $aMinColor = false)
37
    {
38
        $this->majorcolor = $aMajColor;
39
        if ($aMinColor === false) {
40
            $aMinColor = $aMajColor;
41
        }
42
        $this->minorcolor = $aMinColor;
43
    }
44
45
    public function SetWeight($aMajorWeight, $aMinorWeight = 1)
46
    {
47
        $this->majorweight = $aMajorWeight;
48
        $this->minorweight = $aMinorWeight;
49
    }
50
51
    // Specify if grid should be dashed, dotted or solid
52
    public function SetLineStyle($aMajorType, $aMinorType = 'solid')
53
    {
54
        $this->majortype = $aMajorType;
55
        $this->minortype = $aMinorType;
56
    }
57
58
    public function SetStyle($aMajorType, $aMinorType = 'solid')
59
    {
60
        $this->SetLineStyle($aMajorType, $aMinorType);
61
    }
62
63
    // Decide if both major and minor grid should be displayed
64
    public function Show($aShowMajor = true, $aShowMinor = false)
65
    {
66
        $this->show      = $aShowMajor;
67
        $this->showMinor = $aShowMinor;
68
    }
69
70
    public function SetFill($aFlg = true, $aColor1 = 'lightgray', $aColor2 = 'lightblue')
71
    {
72
        $this->fill      = $aFlg;
73
        $this->fillcolor = [$aColor1, $aColor2];
74
    }
75
76
    // Display the grid
77
    public function Stroke()
78
    {
79
        if ($this->showMinor && !$this->scale->textscale) {
80
            $this->DoStroke($this->scale->ticks->ticks_pos, $this->minortype, $this->minorcolor, $this->minorweight);
81
            $this->DoStroke($this->scale->ticks->maj_ticks_pos, $this->majortype, $this->majorcolor, $this->majorweight);
82
        } else {
83
            $this->DoStroke($this->scale->ticks->maj_ticks_pos, $this->majortype, $this->majorcolor, $this->majorweight);
84
        }
85
    }
86
87
    /**
88
     * Private methods
89
     * // Draw the grid.
90
     *
91
     * @param mixed $aTicksPos
92
     * @param mixed $aType
93
     * @param mixed $aColor
94
     * @param mixed $aWeight
95
     */
96
    public function DoStroke($aTicksPos, $aType, $aColor, $aWeight)
97
    {
98
        $nbrgrids = safe_count($aTicksPos);
99
        if (!$this->show || $nbrgrids === 0) {
100
            return;
101
        }
102
103
        if ($this->scale->type == 'y') {
104
            $xl = $this->img->left_margin;
105
            $xr = $this->img->width - $this->img->right_margin;
106
107
            if ($this->fill) {
108
                // Draw filled areas
109
                $y2 = $aTicksPos[0];
110
                $i  = 1;
111
                while ($i < $nbrgrids) {
112
                    $y1 = $y2;
113
                    $y2 = $aTicksPos[$i++];
114
                    $this->img->SetColor($this->fillcolor[$i & 1]);
115
                    $this->img->FilledRectangle($xl, $y1, $xr, $y2);
116
                }
117
            }
118
119
            $this->img->SetColor($aColor);
120
            $this->img->SetLineWeight($aWeight);
121
122
            // Draw grid lines
123
            switch ($aType) {
124
                case 'solid':
125
                    $style = LINESTYLE_SOLID;
126
127
                    break;
128
                case 'dotted':
129
                    $style = LINESTYLE_DOTTED;
130
131
                    break;
132
                case 'dashed':
133
                    $style = LINESTYLE_DASHED;
134
135
                    break;
136
                case 'longdashed':
137
                    $style = LINESTYLE_LONGDASH;
138
139
                    break;
140
                default:
141
                    $style = LINESTYLE_SOLID;
142
143
                    break;
144
            }
145
146
            for ($i = 0; $i < $nbrgrids; ++$i) {
147
                $y = $aTicksPos[$i];
148
                $this->img->StyleLine($xl, $y, $xr, $y, $style, true);
149
            }
150
        } elseif ($this->scale->type == 'x') {
151
            $yu    = $this->img->top_margin;
152
            $yl    = $this->img->height - $this->img->bottom_margin;
153
            $limit = $this->img->width - $this->img->right_margin;
154
155
            if ($this->fill) {
156
                // Draw filled areas
157
                $x2 = $aTicksPos[0];
158
                $i  = 1;
159
                while ($i < $nbrgrids) {
160
                    $x1 = $x2;
161
                    $x2 = min($aTicksPos[$i++], $limit);
162
                    $this->img->SetColor($this->fillcolor[$i & 1]);
163
                    $this->img->FilledRectangle($x1, $yu, $x2, $yl);
164
                }
165
            }
166
167
            $this->img->SetColor($aColor);
168
            $this->img->SetLineWeight($aWeight);
169
170
            // We must also test for limit since we might have
171
            // an offset and the number of ticks is calculated with
172
            // assumption offset==0 so we might end up drawing one
173
            // to many gridlines
174
            $i = 0;
175
            $x = $aTicksPos[$i];
0 ignored issues
show
The assignment to $x is dead and can be removed.
Loading history...
176
            while ($i < safe_count($aTicksPos) && ($x = $aTicksPos[$i]) <= $limit) {
177
                if ($aType == 'solid') {
178
                    $this->img->Line($x, $yl, $x, $yu);
179
                } elseif ($aType == 'dotted') {
180
                    $this->img->DashedLineForGrid($x, $yl, $x, $yu, 1, 6);
181
                } elseif ($aType == 'dashed') {
182
                    $this->img->DashedLineForGrid($x, $yl, $x, $yu, 2, 4);
183
                } elseif ($aType == 'longdashed') {
184
                    $this->img->DashedLineForGrid($x, $yl, $x, $yu, 8, 6);
185
                }
186
187
                ++$i;
188
            }
189
        } else {
190
            Util\JpGraphError::RaiseL(25054, $this->scale->type); //('Internal error: Unknown grid axis ['.$this->scale->type.']');
191
        }
192
193
        return true;
194
    }
195
} // @class
196