net/upnp: fix ACL entry validation and error messages#5371
net/upnp: fix ACL entry validation and error messages#5371peloyeje wants to merge 1 commit intoopnsense:masterfrom
Conversation
Trim ACL input before validation and saving to config to prevent trailing whitespace from causing false validation failures. Replace "User specified permissions" with "ACL entry" in validation error messages to match the UI label.
|
From a validation standpoint the project‘s view is that trim() doesn’t often help but mostly obscures data paths. It’s more of a premature optimization that bypasses validation. MVC can deal with this slightly better and since this is an old static PHP page we’d also like to keep it as it was. Cheers, |
Hi @fichtner Thank you for the quick feedback. Cheers |
Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
Describe the problem
Two issues with ACL entry validation on the UPnP settings page (
/services_upnp.php):explode(' ', ...)on an ACL entry with trailing whitespace (e.g.allow 1024-65535 192.168.1.0/24 1024-65535) produces 5 tokens instead of 4.Describe the proposed solution
trim()ACL input before validation and before saving to configThis is my first contribution to this project, happy to address any feedback!