GLM-5.3 · Balanced

add-html-sanitizer-for-translated-message-resources-keycloak

Keycloak · Java · M · 100–299 lines · 6 files

The normal review, with one generalist agent. Judge: Claude Haiku 5.5.

Gold bugs found
1 of 2
Comments published
3
Comments matching a bug
1
Comments not matching
2
Cost of this PR
$2.065

Published comments (3)

mediumsecuritymisc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:124-127

Choice block stripping hides injected HTML from the sanitizer — Because `[^}]*` deletes the whole choice block before `santizeAnchors` and `policy.sanitize` run, hidden anchor markup passes verification yet `MessageFormat` re-emits it at runtime where `kcSanitize` still permits `a[href]`. Strip only the numeric `N<` separators so any other `<` is flagged.

mediumbugjs/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188

MessageFormat placeholders in client-side bundle are never substituted by i18next — `error-invalid-multivalued-size` is rendered client-side by `setUserProfileServerError` in `js/libs/ui-shared/src/user-profile/utils.ts` using stock i18next, which only substitutes `{{n}}`, so English users see literal `{0}` and `{2,choice,…}`. Restore `{{n}}` placeholders in both UI bundles — this file and `js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties` — keeping choice syntax only in the server-side base properties. **Also found in:** - `js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138-3138`

mediumbugthemes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71

Lithuanian loginTotpStep1 replaced with Italian text in TOTP setup — Lithuanian users see Italian text on the TOTP setup page, and the same Italian string was pasted into `totpStep1` in `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties`. Replace both with a Lithuanian translation, e.g. "Įdiekite vieną iš šių programėlių į savo mobilųjį telefoną:", as done for the sibling locales. **Also found in:** - `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101-101`

Gold bugs found (1)

mediumThe account and admin UI bundles now use Java MessageFormat placeholders and choice syntax for error-invalid-multivalued-size, but i18next expects {{n}}, so the UI shows literal {0}/{1}/{2} and the raw choice text.

Gold bugs missed (1)

mediumThe diff-trimming code computes common prefix and suffix independently, so they can overlap and substring throws StringIndexOutOfBoundsException, crashing the verifier instead of reporting the illegal HTML.