Skip to content

Commit 6750eee

Browse files
committed
docs: add warning about XSS risk
1 parent d16fec7 commit 6750eee

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

user_guide_src/source/libraries/validation.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ or the value that was validated you can add the ``{field}``, ``{param}`` and ``{
530530
On a field with the human name Username and a rule of ``min_length[6]`` with a value of “Pizza”, an error would display: “Supplied value (Pizza) for Username must have
531531
at least 6 characters.”
532532

533+
.. warning:: If you get the error messages with ``getErrors()`` or ``getError()``, the messages are not HTML escaped. If you use user input data like ``({value})`` to make the error message, it might contain HTML tags. If you don't escape the messages before displying them, XSS attacks are possible.
534+
533535
.. note:: When using label-style error messages, if you pass the second parameter to ``setRules()``, it will be overwritten with the value of the first parameter.
534536

535537
Translation Of Messages And Validation Labels

0 commit comments

Comments
 (0)