Project

General

Profile

Actions

Bug #12124

closed

Creating or editing aliases fails with multiple hosts separated by spaces

Added by Casin Mirad almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Aliases / Tables
Target version:
Start date:
07/12/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default
Affected Version:
2.5.x
Affected Architecture:
All

Description

Normally you can input multiple host/network aliases on the first form input if you separate each with an space.

This work ok in pfsense 2.4.1, but in 2.5.2 (also in 2.5.1) if you input a rather large (say 280+ chars string) amount of IPs/host/networks separed by an space in the same form input, the process fails with an error.

I've tracked the issue to the idn_to_ascii php function returning an invalid value with a large string input.

The following patch resolve the issue by disabling idn to ascii convertion:

--- /usr/local/pfSense/include/www/alias-utils.inc
+++ /usr/local/pfSense/include/www/alias-utils.inc
@ -344,7 +344,7 @
$detail_text = sprintf(gettext("Entry added %s"), date('r'));
}

- $address_items = explode(" ", trim(alias_idn_to_ascii($post["address{$x}"])));
+ $address_items = explode(" ", trim($post["address{$x}"]));
foreach ($address_items as $address_item) {
$iprange_type = is_iprange($address_item);
if ($iprange_type == 4) {

I think the problem is trying to pass idn_to_ascii the whole string, maybe passing the individual exploded strings one by one to idn_to_ascii does not trigger the issue.

Actions

Also available in: Atom PDF