Project

General

Profile

Actions

Bug #14523

closed

PHP error when using an unsupported alias type in Advanced Rule Settings

Added by Sengor K over 1 year ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
pfBlockerNG
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
24.11
Affected Version:
All
Affected Plus Version:
23.05
Affected Architecture:
amd64

Description

Confirmed on both 2.6, 2.7-RC and 23.05 using pfBlockerNG-Devel 3.2.0_5 and 3.2.0_4. Removing pfBlockerNG-devel package after disabling 'keep settings', reinstalling and restoring config from pfSense backup did not help.

While using custom destination alias in Advanced Inbound/Outbound Firewall Rule Settings, upon saving the Alias is lost from the pfBlockerNG rule entry and this error is returned:

PHP ERROR: Type: 1, File: /usr/local/www/pfblockerng/pfblockerng_category_edit.php, Line: 447, Message: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:447
Stack trace:
#0 {main}

Actions #1

Updated by Sengor K about 1 year ago

I have narrowed it down to situation where 'Custom Source' alias name cannot be saved when using 'Host' type aliases (it can be saved when using Network type aliases). The 'Enable' checkbox is remembered across saves however the alias is forgotten with the aforementioned error message.

Actions #2

Updated by Marcos M 7 months ago

  • Subject changed from Error with pfblockerng_category_edit to PHP error when using an unsuported alias type in Advanced Rule Settings
  • Status changed from New to Pull Request Review
  • Assignee set to Marcos M
  • Target version set to 2.8.0
  • Plus Target Version set to 24.08

https://gitlab.netgate.com/pfSense/FreeBSD-ports/-/merge_requests/400

This adds input validation to make sure the aliases specified are of the correct type.

Actions #3

Updated by Marcos M 7 months ago

  • Subject changed from PHP error when using an unsuported alias type in Advanced Rule Settings to PHP error when using an unsupported alias type in Advanced Rule Settings
Actions #4

Updated by Marcos M 6 months ago

  • Status changed from Pull Request Review to Feedback
Actions #5

Updated by Christopher Cope 6 months ago

The patch is working on:

24.03-RELEASE (amd64)
built on Thu Apr 18 23:54:00 UTC 2024
FreeBSD 15.0-CURRENT
However, there is a typo in the error message:

Settings: Advanced Destination Inbound Alias error - Must use an alias type of Netowrk or Port

Actions #6

Updated by Marcos M 6 months ago

  • Status changed from Feedback to Resolved

Typo is now fixed.

Actions #7

Updated by Jim Pingle 2 months ago

  • Plus Target Version changed from 24.08 to 24.11
Actions

Also available in: Atom PDF