certtools / intelmq-manager

IntelMQ Manager is a graphical interface to manage configurations for IntelMQ framework.
https://docs.intelmq.org/latest/user/manager/
102 stars 56 forks source link

BUG: configs.js: prevent frontend from converting numeric strings to numbers #301

Open monoidic opened 3 months ago

monoidic commented 3 months ago

intelmq-manager allows the user to fill in a configuration value with a numeric string by enclosing it in quotes, such as "200", and it is submitted correctly. When editing the configuration of the same bot later, the values, including the numeric string, are filled in with the current configuration values. However, this filled in value will not contain the quotes and will subsequently be considered a number. This can cause type errors if a string is expected for this value.

This patch detects numeric strings and adds quotation marks for them ahead of time when editing the configuration in intelmq-manager, preventing "200" from being silently converted to 200 on subsequent edits.