Issues (608)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

class/CaddyAttributes.php (3 issues)

Severity
1
<?php
2
3
namespace XoopsModules\Oledrion;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * oledrion
17
 *
18
 * @copyright   {@link https://xoops.org/ XOOPS Project}
19
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
20
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
21
 */
22
23
use XoopsModules\Oledrion;
24
25
/**
26
 * Gestion des options (attributs) produits dans les commandes
27
 */
28
29
/**
30
 * Class Caddy_attributes
31
 */
32
class CaddyAttributes extends OledrionObject
33
{
34
    /**
35
     * constructor
36
     *
37
     * normally, this is called from child classes only
38
     */
39
    public function __construct()
40
    {
41
        $this->initVar('ca_id', XOBJ_DTYPE_INT, null, false);
42
        $this->initVar('ca_cmd_id', XOBJ_DTYPE_INT, null, false);
43
        $this->initVar('ca_caddy_id', XOBJ_DTYPE_INT, null, false);
44
        $this->initVar('ca_attribute_id', XOBJ_DTYPE_INT, null, false);
45
        $this->initVar('ca_attribute_values', XOBJ_DTYPE_OTHER, null, false);
46
        $this->initVar('ca_attribute_names', XOBJ_DTYPE_OTHER, null, false);
47
        $this->initVar('ca_attribute_prices', XOBJ_DTYPE_OTHER, null, false);
48
    }
49
50
    /**
51
     * Retourne une option de l'attribut
52
     *
53
     * @param  string $valueToGet
54
     * @param  string $format
55
     * @return array
56
     * @since 2.3.2009.03.11
57
     */
58
    public function getOption($valueToGet, $format = 'e')
59
    {
60
        $names = [];
61
        if ('' !== xoops_trim($this->getVar($valueToGet, $format))) {
62
            $names = explode(Constants::OLEDRION_ATTRIBUTE_SEPARATOR, $this->getVar($valueToGet, $format));
63
        }
64
65
        return $names;
66
    }
67
68
    /**
69
     * Ajout d'une option à l'attribut (soit une option vide soit une option valorisée)
70
     *
71
     * @param  string $name
72
     * @param  string $value
73
     * @param  string $price
74
     * @return bool
75
     * @since 2.3.2009.03.16
76
     */
77
    private function appendOption($name, $value, $price = '')
78
    {
79
        $names  = $values = $prices = [];
0 ignored issues
show
The assignment to $values is dead and can be removed.
Loading history...
The assignment to $names is dead and can be removed.
Loading history...
80
        $format = 'e';
81
        $names  = $this->getOption('ca_attribute_names', $format);
82
        $values = $this->getOption('ca_attribute_values', $format);
83
        if (Oledrion\Utility::getModuleOption('use_price')) {
84
            $prices = $this->getOption('ca_attribute_prices', $format);
85
        }
86
        $names[]  = $name;
87
        $values[] = $value;
88
        if (Oledrion\Utility::getModuleOption('use_price')) {
89
            $prices[] = $price;
90
        }
91
        $this->setVar('ca_attribute_names', implode(Constants::OLEDRION_ATTRIBUTE_SEPARATOR, $names));
92
        $this->setVar('ca_attribute_values', implode(Constants::OLEDRION_ATTRIBUTE_SEPARATOR, $values));
93
        if (Oledrion\Utility::getModuleOption('use_price')) {
94
            $this->setVar('ca_attribute_prices', implode(Constants::OLEDRION_ATTRIBUTE_SEPARATOR, $prices));
95
        }
96
97
        return true;
98
    }
99
100
    /**
101
     * Ajoute une nouvelle option à l'attribut
102
     *
103
     * @param  string $name
104
     * @param  string $value
105
     * @param  string $price
106
     * @return bool
107
     * @since 2.3.2009.03.16
108
     */
109
    public function addOption($name, $value, $price = '')
110
    {
111
        return $this->appendOption($name, $value, $price);
112
    }
113
114
    /**
115
     * Retourne les informations formatées de l'attribut pour affichage dans la facture
116
     *
117
     * @param  Products $product Le produit concerné par l'attribut
118
     * @param  string   $format
119
     * @return array
120
     * @since 2.3.2009.03.23
121
     */
122
    public function renderForInvoice(Products $product, $format = 's')
123
    {
124
        $names = $prices = $ret = [];
0 ignored issues
show
The assignment to $names is dead and can be removed.
Loading history...
125
        $names = $this->getOption('ca_attribute_names', $format);
126
        if (Oledrion\Utility::getModuleOption('use_price')) {
127
            $prices = $this->getOption('ca_attribute_prices', $format);
128
        }
129
130
        $oledrionCurrency = Oledrion\Currency::getInstance();
131
        $counter          = 0;
132
        foreach ($names as $name) {
133
            $price = 0;
134
            if (Oledrion\Utility::getModuleOption('use_price')) {
135
                if (isset($prices[$counter])) {
136
                    $price = Oledrion\Utility::getAmountWithVat((float)$prices[$counter], $product->getVar('product_vat_id'));
137
                    $price = $oledrionCurrency->amountForDisplay($price);
138
                }
139
            }
140
            $ret[] = ['ca_attribute_name' => $name, 'ca_attribute_price_formated' => $price];
141
            ++$counter;
142
        }
143
144
        return $ret;
145
    }
146
}
147