Fix prevent edit by external users - reported by VulnCheck

This commit is contained in:
Laurent Destailleur 2026-08-16 06:29:55 +02:00
parent 08527d0e76
commit 4cf305ebb9

View file

@ -2401,6 +2401,10 @@ class Thirdparties extends DolibarrApi
throw new RestException(403);
}
if (!DolibarrApi::_checkAccessToResource('societe', $id)) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$sql = "SELECT rowid, fk_user_creat, date_creation FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".((int) $id)." AND site = '".$this->db->escape($site)."'";
$result = $this->db->query($sql);
@ -2499,6 +2503,10 @@ class Thirdparties extends DolibarrApi
throw new RestException(403);
}
if (!DolibarrApi::_checkAccessToResource('societe', $id)) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".((int) $id)." AND site = '".$this->db->escape($site)."'";
$result = $this->db->query($sql);
@ -2563,6 +2571,10 @@ class Thirdparties extends DolibarrApi
throw new RestException(403);
}
if (!DolibarrApi::_checkAccessToResource('societe', $id)) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".((int) $id)." AND site = '".$this->db->escape($site)."'";
$result = $this->db->query($sql);