Security advisory GHSA-8v7v-6mmm-xjxm: Dolibarr SQL injection vulnerability in accountancy/customer/card.php
Package: dolibarr/dolibarr (composer), vulnerable version: 11.0.4, fixed in: 11.0.5
CWE: CWE-89
Files changed by the fix:
htdocs/accountancy/customer/card.php
htdocs/accountancy/expensereport/card.php
htdocs/accountancy/supplier/card.php
htdocs/comm/mailing/info.php
htdocs/compta/paiement/info.php
htdocs/variants/ajax/get_attribute_values.php

Fix diff:
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index 0a39fbc825460..591606a7e26c3 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -34,8 +34,8 @@
 $cancel = GETPOST('cancel', 'alpha');
 $backtopage = GETPOST('backtopage', 'alpha');
 
-$codeventil = GETPOST('codeventil');
-$id = GETPOST('id');
+$codeventil = GETPOST('codeventil', 'int');
+$id = GETPOST('id', 'int');
 
 // Security check
 if ($user->socid > 0)
diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php
index 36d587e0c99c9..9d7c504354f30 100644
--- a/htdocs/accountancy/expensereport/card.php
+++ b/htdocs/accountancy/expensereport/card.php
@@ -38,8 +38,8 @@
 $cancel = GETPOST('cancel', 'alpha');
 $backtopage = GETPOST('backtopage', 'alpha');
 
-$codeventil = GETPOST('codeventil');
-$id = GETPOST('id');
+$codeventil = GETPOST('codeventil', 'int');
+$id = GETPOST('id', 'int');
 
 // Security check
 if ($user->socid > 0)
diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php
index 6140f90fe8d72..699459ad63a86 100644
--- a/htdocs/accountancy/supplier/card.php
+++ b/htdocs/accountancy/supplier/card.php
@@ -38,8 +38,8 @@
 $cancel = GETPOST('cancel', 'alpha');
 $backtopage = GETPOST('backtopage', 'alpha');
 
-$codeventil = GETPOST('codeventil');
-$id = GETPOST('id');
+$codeventil = GETPOST('codeventil', 'int');
+$id = GETPOST('id', 'int');
 
 // Security check
 if ($user->socid > 0)
diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php
index 3dfe0c4264c15..070d46f610474 100644
--- a/htdocs/comm/mailing/info.php
+++ b/htdocs/comm/mailing/info.php
@@ -27,7 +27,7 @@
 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php';
 
-$id = GETPOST('id');
+$id = GETPOST('id', 'int');
 
 // Load translation files required by the page
 $langs->load("mails");
diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php
index 3da6a95a1e846..00c3440b86818 100644
--- a/htdocs/compta/paiement/info.php
+++ b/htdocs/compta/paiement/info.php
@@ -31,7 +31,7 @@
 // Load translation files required by the page
 $langs->loadLangs(array('bills', 'companies'));
 
-$id = GETPOST('id');
+$id = GETPOST('id', 'int');
 $ref = GETPOST('ref', 'alpha');
 $action = GETPOST('action', 'alpha');
 $confirm = GETPOST('confirm', 'alpha');
diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php
index 866bac1ef78d9..ee45ad18b23f4 100644
--- a/htdocs/variants/ajax/get_attribute_values.php
+++ b/htdocs/variants/ajax/get_attribute_values.php
@@ -28,7 +28,7 @@
 
 header('Content-Type: application/json');
 
-$id = GETPOST('id');
+$id = GETPOST('id', 'int');
 
 if (!$id) {
     print json_encode(array(