Issues (48)

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/Archive/Archive.php (1 issue)

Labels
Severity

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
/*
4
 * This file is part of Zippy.
5
 *
6
 * (c) Alchemy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Alchemy\Zippy\Archive;
13
14
use Alchemy\Zippy\Adapter\AdapterInterface;
15
use Alchemy\Zippy\Resource\ResourceManager;
16
use Alchemy\Zippy\Adapter\Resource\ResourceInterface;
17
18
/**
19
 * Represents an archive
20
 */
21
class Archive implements ArchiveInterface
22
{
23
    /**
24
     * The path to the archive
25
     *
26
     * @var string
27
     */
28
    protected $path;
29
30
    /**
31
     * The archive adapter
32
     *
33
     * @var AdapterInterface
34
     */
35
    protected $adapter;
36
37
    /**
38
     * An array of archive members
39
     *
40
     * @var MemberInterface[]
41
     */
42
    protected $members = array();
43
44
    /**
45
     * @var ResourceInterface
46
     */
47
    protected $resource;
48
49
    /**
50
     *
51
     * @var ResourceManager
52
     */
53
    protected $manager;
54
55
    /**
56
     * Constructor
57
     *
58
     * @param ResourceInterface $resource Path to the archive
59
     * @param AdapterInterface  $adapter  An archive adapter
60
     * @param ResourceManager   $manager  The resource manager
61
     */
62
    public function __construct(ResourceInterface $resource, AdapterInterface $adapter, ResourceManager $manager)
63
    {
64
        $this->resource = $resource;
65
        $this->adapter = $adapter;
66
        $this->manager = $manager;
67
    }
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public function count()
73
    {
74
        return count($this->getMembers());
75
    }
76
77
    /**
78
     * Returns an Iterator for the current archive
79
     *
80
     * This method implements the IteratorAggregate interface.
81
     *
82
     * @return \ArrayIterator|MemberInterface[] An iterator
83
     */
84
    public function getIterator()
85
    {
86
        return new \ArrayIterator($this->getMembers());
87
    }
88
89
    /**
90
     * @inheritdoc
91
     */
92
    public function getMembers()
93
    {
94
        return $this->members = $this->adapter->listMembers($this->resource);
95
    }
96
97
    /**
98
     * @inheritdoc
99
     */
100
    public function addMembers($sources, $recursive = true)
101
    {
102
        $this->adapter->add($this->resource, $sources, $recursive);
103
104
        return $this;
105
    }
106
107
    /**
108
     * @inheritdoc
109
     */
110
    public function removeMembers($sources)
111
    {
112
        $this->adapter->remove($this->resource, $sources);
113
114
        return $this;
115
    }
116
117
    /**
118
     * @inheritdoc
119
     */
120
    public function extract($toDirectory)
121
    {
122
        $this->adapter->extract($this->resource, $toDirectory);
123
124
        return $this;
125
    }
126
127
    /**
128
     * @inheritdoc
129
     */
130
    public function extractMembers($members, $toDirectory = null)
131
    {
132
        $this->adapter->extractMembers($this->resource, $members, $toDirectory);
0 ignored issues
show
It seems like $members defined by parameter $members on line 130 can also be of type array<integer,object<Alc...chive\MemberInterface>>; however, Alchemy\Zippy\Adapter\Ad...rface::extractMembers() does only seem to accept string|array<integer,string>, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
133
134
        return $this;
135
    }
136
}
137