Issues (3)

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/Options/ServiceOptions.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
3
namespace BsbPhingService\Options;
4
5
use RuntimeException;
6
use Symfony\Component\Process\ProcessBuilder;
7
use Zend\Stdlib\AbstractOptions;
8
9
class ServiceOptions extends AbstractOptions
10
{
11
12
    /**
13
     * Path to php binary
14
     *
15
     * @var string
16
     */
17
    private $phpBin = null;
18
19
    /**
20
     * Path to phing binary
21
     *
22
     * @var string
23
     */
24
    private $phingBin = null;
25
26
    /**
27
     * @param array $options
28
     */
29 19
    public function __construct(array $options = null)
30
    {
31 19
        parent::__construct($options);
32 19
    }
33
34
    /**
35
     * Sets the php executable
36
     *
37
     * Set it with a value of 'null' to automaticly discover the path
38
     *
39
     * @param null $path
40
     */
41 3
    public function setPhpBin($path = null)
42
    {
43 3
        $this->phpBin = $path;
44 3
    }
45
46
    /**
47
     * Get the path to the php executable
48
     *
49
     * Attempt auto discovery via 'which php' if null
50
     *
51
     * @return string
52
     */
53 3
    public function getPhpBin()
54
    {
55 3
        if ($this->phpBin === null) {
56 1
            $builder = new ProcessBuilder();
57 1
            $builder->setPrefix('which');
58 1
            $builder->setArguments(array('php'));
59
60 1
            $process = $builder->getProcess();
61 1
            $process->run();
62
63 1
            if ($process->getExitCodeText() == 'OK') {
64 1
                $this->phpBin = trim($process->getOutput());
65 1
            }
66 1
        }
67
68 3
        return $this->phpBin;
69
    }
70
71
    /**
72
     * Set path to the phing binary
73
     *
74
     * @param string $phingBin
75
     */
76 3
    public function setPhingBin($phingBin = null)
77
    {
78 3
        $this->phingBin = $phingBin;
79 3
    }
80
81
    /**
82
     * Get path to the phing binary
83
     *
84
     * Attempt auto discovery from composer if null
85
     *
86
     * @return string
87
     */
88 9
    public function getPhingBin()
89
    {
90 9
        if ($this->phingBin === null && file_exists('./composer.json')) {
91 7
            @$composer = json_decode(file_get_contents('./composer.json'), true);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
92 7
            if (isset($composer['bin-dir'])) {
93 1
                $this->phingBin = $composer['bin-dir'] . '/phing';
94 1
            }
95 7
        }
96
97 9
        if ($this->phingBin === null && getenv('COMPOSER_BIN_DIR') !== false) {
98 1
            $this->phingBin = getenv('COMPOSER_BIN_DIR') . '/phing';
99 1
        }
100
101 9
        if ($this->phingBin === null) {
102 5
            $this->phingBin = './vendor/bin/phing';
103 5
        }
104
105 9
        return $this->phingBin;
106
    }
107
}
108