Input validation for numbered DHCP options in static mappings
Bug: Incorrectly formatted values in Additional BOOTP/DHCP Options for Static DHCP Mappings cause dhcpd to crash. For example, the Option
43:Text:"Raspberry Pi Boot "
will save as expected and apply, but dhcpd logs will show a failure.
Oct 19 12:41:43 dhcpd 86624 exiting. Oct 19 12:41:43 dhcpd 86624 process and the information we find helpful for debugging. Oct 19 12:41:43 dhcpd 86624 before submitting a bug. These pages explain the proper Oct 19 12:41:43 dhcpd 86624 bugs on either our web page at www.isc.org or in the README file Oct 19 12:41:43 dhcpd 86624 than a configuration issue please read the section on submitting Oct 19 12:41:43 dhcpd 86624 If you think you have received this message due to a bug rather Oct 19 12:41:43 dhcpd 86624 Configuration file errors encountered -- exiting Oct 19 12:41:43 dhcpd 86624 ^ Oct 19 12:41:43 dhcpd 86624 option custom-s_lan_0-0 ""Raspberry Oct 19 12:41:43 dhcpd 86624 /etc/dhcpd.conf line 47: semicolon expected.
Fix: Perform input validation in the Additional BOOTP/DHCP Options fields for Static DHCP Mappings entries in services_dhcp_edit.php:158 just as is currently being done in services_dhcp.php:477 .
Not a PHP developer in the slightest so don't really know where to start to actually implement and test any sort of input validation, but if someone wanted to walk me through some steps to get started, I'd be happy to take a crack at it and submit a pull request.
Updated by Christian McDonald 11 months ago
- Assignee set to Christian McDonald
- Target version set to 2.7.0
- Plus Target Version set to 23.01
Updated by Danilo Zrenjanin 11 months ago
- File clipboard-202210271205-fgbxc.png clipboard-202210271205-fgbxc.png added
- Status changed from Feedback to Resolved
2.7.0-DEVELOPMENT (amd64) built on Thu Oct 27 06:05:35 UTC 2022 FreeBSD 14.0-CURRENT
I couldn't save the config with quotation marks in the text field.
The following input errors were detected: Text type cannot include quotation marks.
I am marking this ticket resolved.