Bug #12891
closedTrailing space in Acme Account Keys "name" breaks UI functions
0%
Description
If any ACME account key is entered into the UI with a trailing space in the name, the pfSense UI becomes unable to handle that entry (i.e. becomes unable to edit, delete, or copy the entry).
pfSense will store trailing space (or spaces) in the config, e.g.
<name>LE Staging v2 Account </name>
However, when attempting to view/edit/delete/copy the entry, the name of the key is passed to the PHP function without the trailing space, thus it is a mismatch for the stored item name.
e.g.
.../acme/acme_accountkeys_edit.php?id=LE%20Staging%20v2%20Account
instead of the stored name:
.../acme/acme_accountkeys_edit.php?id=LE%20Staging%20v2%20Account%20
Clicking 'edit' in the UI shows blank values in the 'edit' view as if they had been directed to id=foo.
It then becomes impossible for a user to recover from within the UI (as by deletion or editing).
Steps to reproduce:
From .../acme/acme_accountkeys.php:
click the 'edit' icon for any account key.
In the detail view for the key, add a trailing space.
Save the entry.
click the 'edit' icon again. You will not be able to edit the entry.
click the 'delete' icon. You will not be able to delete the entry.
click the 'copy' icon. You will not be able to copy the entry.
Validate the nature of the mismatch by manually passing the item's proper URL by appending an encoded space (as above) to edit the 'problem' entry in the UI. Remove the space and hit save.
The UI again behaves as expected.
I think the desired behavior is to to trim trailing white space before writing the name to the config, but if not, the actual item name should be passed.
Updated by Viktor Gurov over 2 years ago
- Assignee set to Viktor Gurov
Updated by Jim Pingle over 2 years ago
- Status changed from New to In Progress
- Assignee changed from Viktor Gurov to Jim Pingle
Updated by Jim Pingle over 2 years ago
- Status changed from In Progress to Pull Request Review
This approach is a more comprehensive fix: https://gitlab.netgate.com/pfSense/FreeBSD-ports/-/merge_requests/193
Updated by Jim Pingle over 2 years ago
- Status changed from Pull Request Review to Feedback
Fix merged.
Updated by Jim Pingle over 2 years ago
Commit: https://github.com/pfsense/FreeBSD-ports/commit/29bab84437fcdde206f205610d341302093fa4f3
Package update is live on 22.01/2.6.0.
Updated by Danilo Zrenjanin over 2 years ago
- Status changed from Feedback to Resolved
I tested against the 0.7.1_1 Acme version. It works as expected. I could edit, remove, and copy the account key with trailing space in its name.
I am marking this ticket resolved.