system: audit staticroute' config access for #10027

This commit is contained in:
Franco Fichtner 2026-04-07 16:34:27 +02:00
parent 700d6a00d2
commit faa7dab419
4 changed files with 4 additions and 8 deletions

View file

@ -125,10 +125,7 @@ function pf_firewall($fw)
* interface in question to avoid problems with complicated routing
* topologies
*/
if (
isset($config['filter']['bypassstaticroutes']) && isset($config['staticroutes']['route']) &&
count($config['staticroutes']['route'])
) {
if (isset($config['filter']['bypassstaticroutes']) && count(config_read_array('staticroutes', 'route', false))) {
$ifdetails = $fw->getIfconfigDetails();
$GatewaysList = $fw->getGateways()->gatewaysIndexedByName(false, true);

View file

@ -1158,11 +1158,10 @@ function is_URL($url)
function get_staticroutes($returnsubnetsonly = false)
{
global $aliastable;
$allstaticroutes = [];
$allsubnets = [];
foreach (config_read_array('staticroutes', 'route') as $route) {
foreach (config_read_array('staticroutes', 'route', false) as $route) {
if (is_subnet($route['network'])) {
$allstaticroutes[] = $route;
$allsubnets[] = $route['network'];

View file

@ -193,6 +193,7 @@ class SettingsController extends ApiMutableModelControllerBase
return $this->addBase("gateway_item", "gateway_item");
}
/* XXX consider removing $cfg use -- everything should have a model now */
public function delGatewayAction($uuid)
{
$result = ["result" => "failed"];

View file

@ -126,7 +126,6 @@ class Alias extends BaseModel
$sources[] = [['nat', 'outbound', 'rule'], ['destination', 'network']];
$sources[] = [['nat', 'outbound', 'rule'], ['dstport']];
$sources[] = [['nat', 'outbound', 'rule'], ['target']];
$sources[] = [['staticroutes', 'route'], ['network']];
$sources[] = [['OPNsense', 'Firewall', 'Filter', 'onetoone', 'rule'], ['source_net']];
$sources[] = [['OPNsense', 'Firewall', 'Filter', 'onetoone', 'rule'], ['destination_net']];
$sources[] = [['OPNsense', 'Firewall', 'Filter', 'rules', 'rule'], ['source_net']];