Skip to content

Fix error popup text display #14277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

lukebakken
Copy link
Collaborator

When validation fails for a policy parameter, the resulting popup can't be read due to one extra binary encoding as well as code that escapes HTML entites. Since the EJS template uses <%= ... %> for the popup, it will display the text as-is, and not render any HTML.

The following definitions import, when imported into a 4.x broker via the management UI, will reproduce the issue:
defs-pp.json

Popup display when current main code is used:
image

Popup display when this PR is applied:
image

You can also observe this behavior in a 4.x broker by going to Admin -> Policies and creating a policy with ha-mode: all

When validation fails for a policy parameter, the resulting popup can't
be read due to one extra binary encoding as well as code that escapes
HTML entites. Since the EJS template uses `<%= >` for the popup, it will
display the text as-is, and not render any HTML.
@lukebakken lukebakken self-assigned this Jul 24, 2025
@michaelklishin michaelklishin modified the milestones: 4.1.3, 4.2.0 Jul 24, 2025
@michaelklishin
Copy link
Collaborator

michaelklishin commented Jul 24, 2025

FTR, the removal of the escaping functions is safe: the policy or runtime parameter keys and values are validated, and unknown values are reported as pre-formatted, quoted string values.

The EJS part should also be safe, as Luke explains in the PR description.

I have tried it with <script> tags in various places, they are not evaluated in the error messages in the UI.

However, this also means that we should not backport this change.

@michaelklishin michaelklishin merged commit 84e0478 into rabbitmq:main Jul 24, 2025
557 of 562 checks passed
@michaelklishin
Copy link
Collaborator

@lukebakken thank you!

@lukebakken lukebakken deleted the lukebakken/fix-popup-text-formatting branch July 24, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants