Issues (3103)

Branch: master

Security Analysis    not enabled

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.

Base/Container/ApiLoader/RepositoryFactory.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
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\Base\Container\ApiLoader;
8
9
use eZ\Publish\Core\FieldType\FieldTypeRegistry;
10
use eZ\Publish\Core\Repository\Permission\LimitationService;
11
use eZ\Publish\Core\Repository\ProxyFactory\ProxyDomainMapperFactoryInterface;
12
use eZ\Publish\Core\Repository\User\PasswordHashServiceInterface;
13
use eZ\Publish\Core\Repository\Helper\RelationProcessor;
14
use eZ\Publish\Core\Repository\Mapper;
15
use eZ\Publish\Core\Search\Common\BackgroundIndexer;
16
use eZ\Publish\SPI\Persistence\Handler as PersistenceHandler;
17
use eZ\Publish\SPI\Repository\Strategy\ContentThumbnail\ThumbnailStrategy;
18
use eZ\Publish\SPI\Search\Handler as SearchHandler;
19
use eZ\Publish\API\Repository\Repository;
20
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
21
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
22
use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException;
23
24
class RepositoryFactory implements ContainerAwareInterface
25
{
26
    use ContainerAwareTrait;
27
28
    /** @var string */
29
    private $repositoryClass;
30
31
    /**
32
     * Policies map.
33
     *
34
     * @var array
35
     */
36
    protected $policyMap = [];
37
38
    public function __construct(
39
        $repositoryClass,
40
        array $policyMap
41
    ) {
42
        $this->repositoryClass = $repositoryClass;
43
        $this->policyMap = $policyMap;
44
    }
45
46
    /**
47
     * Builds the main repository, heart of eZ Publish API.
48
     *
49
     * This always returns the true inner Repository, please depend on ezpublish.api.repository and not this method
50
     * directly to make sure you get an instance wrapped inside Event / Cache / * functionality.
51
     */
52
    public function buildRepository(
53
        PersistenceHandler $persistenceHandler,
54
        SearchHandler $searchHandler,
55
        BackgroundIndexer $backgroundIndexer,
56
        RelationProcessor $relationProcessor,
57
        FieldTypeRegistry $fieldTypeRegistry,
58
        PasswordHashServiceInterface $passwordHashService,
59
        ThumbnailStrategy $thumbnailStrategy,
60
        ProxyDomainMapperFactoryInterface $proxyDomainMapperFactory,
61
        Mapper\ContentDomainMapper $contentDomainMapper,
62
        Mapper\ContentTypeDomainMapper $contentTypeDomainMapper,
63
        LimitationService $limitationService
64
    ): Repository {
65
        return new $this->repositoryClass(
66
            $persistenceHandler,
67
            $searchHandler,
68
            $backgroundIndexer,
69
            $relationProcessor,
70
            $fieldTypeRegistry,
71
            $passwordHashService,
72
            $thumbnailStrategy,
73
            $proxyDomainMapperFactory,
74
            $contentDomainMapper,
75
            $contentTypeDomainMapper,
76
            $limitationService,
77
            [
78
                'role' => [
79
                    'policyMap' => $this->policyMap,
80
                ],
81
                'languages' => $this->container->getParameter('languages'),
82
            ],
83
        );
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ')'
Loading history...
84
    }
85
86
    /**
87
     * Returns a service based on a name string (content => contentService, etc).
88
     *
89
     * @param \eZ\Publish\API\Repository\Repository $repository
90
     * @param string $serviceName
91
     *
92
     * @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentException
93
     *
94
     * @return mixed
95
     */
96
    public function buildService(Repository $repository, $serviceName)
97
    {
98
        $methodName = 'get' . $serviceName . 'Service';
99
        if (!method_exists($repository, $methodName)) {
100
            throw new InvalidArgumentException($serviceName, 'No such service');
101
        }
102
103
        return $repository->$methodName();
104
    }
105
}
106