From 9533677c14b2138a43c9d74c03b2a2f30a97ac05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Apr 2026 23:19:11 +0200 Subject: [PATCH 1/2] FIX #GHSA-prg3-w5r4-h7g3 --- htdocs/fourn/ajax/getSupplierPrices.php | 42 ++++++++++++++++++------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 08385b342a4..b4f409b8287 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -19,7 +19,7 @@ */ /** - * \file /htdocs/fourn/ajax/getSupplierPrices.php + * \file htdocs/fourn/ajax/getSupplierPrices.php * \brief File to return an Ajax response to get list of possible prices for margin calculation */ @@ -54,6 +54,29 @@ $prices = array(); // Load translation files required by the page $langs->loadLangs(array("stocks", "margins", "products")); +if (!isModEnabled('product') && !isModEnabled('service')) { + accessforbidden("Not allowed"); +} +if (!$user->hasRight('fournisseur', 'lire')) { + accessforbidden("Not allowed"); +} + +$object = new ProductFournisseur($db); + +if ($idprod > 0) { + $object->fetch($idprod); + + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', 0, 'product&product', '', '', 'rowid'); +} + + /* * View @@ -64,15 +87,12 @@ top_httphead(); //print ''."\n"; if ($idprod > 0) { - $producttmp = new ProductFournisseur($db); - $producttmp->fetch($idprod); - $sorttouse = 's.nom, pfp.quantity, pfp.price'; if (GETPOST('bestpricefirst')) { $sorttouse = 'pfp.unitprice, s.nom, pfp.quantity, pfp.price'; } - $productSupplierArray = $producttmp->list_product_fournisseur_price($idprod, $sorttouse); // We list all price per supplier, and then firstly with the lower quantity. So we can choose first one with enough quantity into list. + $productSupplierArray = $object->list_product_fournisseur_price($idprod, $sorttouse); // We list all price per supplier, and then firstly with the lower quantity. So we can choose first one with enough quantity into list. if (is_array($productSupplierArray)) { foreach ($productSupplierArray as $productSupplier) { if (getDolGlobalInt("DISABLE_BAD_REPUTATION_PRODUCT_PRICE") && $productSupplier->supplier_reputation == "DONOTORDER") { @@ -107,11 +127,11 @@ if ($idprod > 0) { // After best supplier prices and before costprice if (isModEnabled('stock')) { // Add price for pmp - $price = $producttmp->pmp; + $price = $object->pmp; if (empty($price) && getDolGlobalString('PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY')) { // get pmp for subproducts if any - $producttmp->get_sousproduits_arbo(); - $prods_arbo=$producttmp->get_arbo_each_prod(); + $object->get_sousproduits_arbo(); + $prods_arbo = $object->get_arbo_each_prod(); if (!empty($prods_arbo)) { $price = 0; foreach ($prods_arbo as $child) { @@ -126,11 +146,11 @@ if ($idprod > 0) { } // Add price for costprice (at end) - $price = $producttmp->cost_price; + $price = $object->cost_price; if (empty($price) && getDolGlobalString('PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY')) { // get costprice for subproducts if any - $producttmp->get_sousproduits_arbo(); - $prods_arbo=$producttmp->get_arbo_each_prod(); + $object->get_sousproduits_arbo(); + $prods_arbo = $object->get_arbo_each_prod(); if (!empty($prods_arbo)) { $price = 0; foreach ($prods_arbo as $child) { From e3e97aea486e88c2ca5dbab66215038ff052b444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Apr 2026 23:02:57 +0200 Subject: [PATCH 2/2] Doc --- SECURITY.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index dbcf379226f..6c2940d315b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,13 +12,19 @@ Security report are valid only on any current stable version for the last 5 majo To report a vulnerability, for a private report, you can: -- Send your report as an issue on https://github.com/Dolibarr/dolibarr/issues or on GitHub Vulnerability Disclosure Program tool (VDP): https://github.com/Dolibarr/dolibarr/security/advisories (recommended) +- Send your report as an issue on https://github.com/Dolibarr/dolibarr/issues or on GitHub Vulnerability Disclosure Program tool (VDP): https://github.com/Dolibarr/dolibarr/security/advisories (recommended). Do 1 report only per vulnerability. Reports combining several vulnerabilities, as well as reports generated using IA will be rejected. + +NOTE: This is a private vulnerability report process: Advisories are sent to users by our internal channel (RSS at https://cti.dolibarr.org/index-security.rss), we do not publish CVE reports. + + - Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary (in such a case, the issue may be created by the developer that will fix the vulnerability or the Release Manager). +NOTE: This is a private vulnerability report process: Advisories are sent to users by our internal channel (RSS at https://cti.dolibarr.org/index-security.rss), we do not publish CVE reports. + ## Hunting vulnerabilities on Dolibarr