Issues (258)

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.

Bootstrap/Uninstall.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
 * (c) shopware AG <[email protected]>
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace ShopwarePlugins\Connect\Bootstrap;
9
10
use Shopware\Bundle\AttributeBundle\Service\CrudService;
11
use Shopware\Components\Model\ModelManager;
12
use Enlight_Components_Db_Adapter_Pdo_Mysql as Pdo;
13
14
/**
15
 * Uninstaller of the plugin.
16
 * Currently attribute columns will never be removed, as well as the plugin tables. This can be changed once
17
 * shopware supports asking the user, if he wants to remove the plugin permanently or temporarily
18
 *
19
 * Class Uninstall
20
 * @package ShopwarePlugins\Connect\Bootstrap
21
 */
22
class Uninstall
23
{
24
    /**
25
     * @var \Shopware_Plugins_Backend_SwagConnect_Bootstrap
26
     */
27
    protected $bootstrap;
28
29
    /**
30
     * @var Pdo
31
     */
32
    protected $db;
33
34
    /**
35
     * @var ModelManager
36
     */
37
    protected $modelManager;
38
39
    /**
40
     * @var Menu
41
     */
42
    private $menu;
43
44
    /**
45
     * Setup constructor.
46
     * @param \Shopware_Plugins_Backend_SwagConnect_Bootstrap $bootstrap
47
     * @param ModelManager $modelManager
48
     * @param Pdo $db
49
     * @param Menu $menu
50
     */
51 View Code Duplication
    public function __construct(
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
52
        \Shopware_Plugins_Backend_SwagConnect_Bootstrap $bootstrap,
53
        ModelManager $modelManager,
54
        Pdo $db,
55
        Menu $menu
56
    ) {
57
        $this->bootstrap = $bootstrap;
58
        $this->modelManager = $modelManager;
59
        $this->db = $db;
60
        $this->menu = $menu;
61
    }
62
63
    /**
64
     * @return bool
65
     */
66
    public function run()
67
    {
68
        $this->menu->remove();
69
        $this->deactivateConnectProducts();
70
        $this->removeEngineElement();
71
72
        return true;
73
    }
74
75
    /**
76
     * @return CrudService
77
     */
78
    public function getCrudService()
79
    {
80
        return $this->bootstrap->Application()->Container()->get('shopware_attribute.crud_service');
81
    }
82
83
    /**
84
     * Disabled all products imported from shopware Connect
85
     */
86
    public function deactivateConnectProducts()
87
    {
88
        $sql = '
89
        UPDATE s_articles
90
        INNER JOIN s_plugin_connect_items
91
          ON s_plugin_connect_items.article_id = s_articles.id
92
          AND shop_id IS NOT NULL
93
        SET s_articles.active = false
94
        ';
95
        $this->db->exec($sql);
96
    }
97
98
    /**
99
     * Remove an engine element so that the connectProductDescription is not displayed in the article anymore
100
     */
101
    public function removeEngineElement()
102
    {
103
        $repo = $this->modelManager->getRepository('Shopware\Models\Article\Element');
104
        $element = $repo->findOneBy(['name' => 'connectProductDescription']);
105
106
        if ($element) {
107
            $this->modelManager->remove($element);
108
            $this->modelManager->flush();
109
        }
110
    }
111
}
112