Validation of role template scripts is too strict for Painless scripts #62744
Labels
:Security/Authentication
Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Team:Security
Meta label for security team
PR #52636 introduces validation for role template scripts. The validation is done by attempting to execute the scripts with an empty input. If no error is encountered, the script is considered to be valid. This approach is chosen under the assumption that all scripts are Mustache. However this is true only for inline scripts. Stored scripts on the other hand can be in painless.
Unlike Mustache, which is very lenient for empty variables, Painless can throw NEP on empty variables if not guarded properly. It feels too aggressive asking user to always perform null checking in Painless just for validation purpose because some of the input parameters are guaranteed to be non-empty, e.g.
username
.In summary, we need to relax the validation for Painless scripts. Possible options are:
Relates: #48773
The text was updated successfully, but these errors were encountered: