Issues (9)

Security Analysis    no request data  

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.

src/Device/CommandLineParameters/PageTrait.php (2 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
<?php
2
/**
3
 * This file is part of the Ghostscript package
4
 *
5
 * @author Simon Schrape <[email protected]>
6
 */
7
8
namespace GravityMedia\Ghostscript\Device\CommandLineParameters;
9
10
/**
11
 * The page parameters trait.
12
 *
13
 * @package GravityMedia\Ghostscript\Device\CommandLineParameters
14
 *
15
 * @link    http://ghostscript.com/doc/current/Use.htm#Page_parameters
16
 */
17
trait PageTrait
18
{
19
    /**
20
     * Get argument value.
21
     *
22
     * @param string $name
23
     *
24
     * @return null|string
25
     */
26
    abstract protected function getArgumentValue($name);
27
28
    /**
29
     * Set argument.
30
     *
31
     * @param string $argument
32
     *
33
     * @return $this
34
     */
35
    abstract protected function setArgument($argument);
36
37
    /**
38
     * Get FirstPage parameter value
39
     *
40
     * @return string|null
41
     */
42
    public function getFirstPage()
43
    {
44
        return $this->getArgumentValue('-dFirstPage');
45
    }
46
47
    /**
48
     * Set FirstPage parameter
49
     * Begins processing on the designated page of the document.
50
     * 
51
     * @param int $firstPage.
0 ignored issues
show
There is no parameter named $firstPage.. Did you maybe mean $firstPage?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
52
     *
53
     * @return $this
54
     */
55
    public function setFirstPage($firstPage)
56
    {
57
        $this->setArgument(sprintf('-dFirstPage=%d', $firstPage));
58
59
        return $this;
60
    }
61
62
    /**
63
     * Get LastPage parameter value
64
     *
65
     * @return string|null
66
     */
67
    public function getLastPage()
68
    {
69
        return $this->getArgumentValue('-dLastPage');
70
    }
71
72
    /**
73
     * Set LastPage parameter
74
     * Stops processing after the designated page of the document.
75
     * 
76
     * @param int $lastPage.
0 ignored issues
show
There is no parameter named $lastPage.. Did you maybe mean $lastPage?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
77
     *
78
     * @return $this
79
     */
80
    public function setLastPage($lastPage)
81
    {
82
        $this->setArgument(sprintf('-dLastPage=%d', $lastPage));
83
84
        return $this;
85
    }
86
87
    /**
88
     * TODO
89
     *
90
     * -dFIXEDMEDIA
91
     *     Causes the media size to be fixed after initialization, forcing pages of other sizes or orientations to be
92
     *     clipped. This may be useful when printing documents on a printer that can handle their requested paper size
93
     *     but whose default is some other size. Note that -g automatically sets -dFIXEDMEDIA, but -sPAPERSIZE= does
94
     *     not.
95
     *
96
     * -dFIXEDRESOLUTION
97
     *     Causes the media resolution to be fixed similarly. -r automatically sets -dFIXEDRESOLUTION.
98
     *
99
     * -dPSFitPage
100
     *     The page size from the PostScript file setpagedevice operator, or one of the older statusdict page size
101
     *     operators (such as letter or a4) will be rotated, scaled and centered on the "best fit" page size from those
102
     *     availiable in the InputAttributes list. The -dPSFitPage is most easily used to fit pages when used with the
103
     *     -dFIXEDMEDIA option.
104
     *
105
     *     This option is also set by the -dFitPage option.
106
     *
107
     * -dORIENT1=true
108
     * -dORIENT1=false
109
     *     Defines the meaning of the 0 and 1 orientation values for the setpage[params] compatibility operators. The
110
     *     default value of ORIENT1 is true (set in gs_init.ps), which is the correct value for most files that use
111
     *     setpage[params] at all, namely, files produced by badly designed applications that "know" that the output
112
     *     will be printed on certain roll-media printers: these applications use 0 to mean landscape and 1 to mean
113
     *     portrait. -dORIENT1=false declares that 0 means portrait and 1 means landscape, which is the convention used
114
     *     by a smaller number of files produced by properly written applications.
115
     *
116
     * -dDEVICEWIDTHPOINTS=w
117
     * -dDEVICEHEIGHTPOINTS=h
118
     *     Sets the initial page width to w or initial page height to h respectively, specified in 1/72" units.
119
     *
120
     * -sDEFAULTPAPERSIZE=a4
121
     *     This value will be used to replace the device default papersize ONLY if the default papersize for the device
122
     *     is 'letter' or 'a4' serving to insulate users of A4 or 8.5x11 from particular device defaults (the
123
     *     collection of contributed drivers in Ghostscript vary as to the default size).
124
     *
125
     * -dFitPage
126
     *     This is a "convenience" operator that sets the various options to perform page fitting for specific file
127
     *     types.
128
     *
129
     *     This option sets the -dEPSFitPage, -dPDFFitPage, and the -dFitPage options.
130
     */
131
}
132