Claude Opus 5.5 · 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
2 of 2
Comments published
4
Comments matching a bug
2
Comments not matching
2
Cost of this PR
$0.947

Published comments (4)

mediumbugmisc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:101-111

Overlapping prefix/suffix counters crash substring in diff message — When the changed text repeats nearby characters (e.g. `abab` sanitized to `ab`), `sanitized.substring` gets begin > end and throws `StringIndexOutOfBoundsException`, crashing the verifier instead of reporting the problem. Cap `end` at `Math.min(value.length(), sanitized.length()) - start`.

mediumbugjs/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138

MessageFormat placeholders and choice syntax not rendered by i18next — The admin UI interpolates with i18next, which ignores MessageFormat syntax, so users see literal `{0}` and `{2,choice,...}` text. Restore `{{0}}`/`{{1}}`/`{{2}}` placeholders in this admin-ui bundle.

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

MessageFormat placeholders won't be interpolated by i18next in account UI — The account console renders this bundle through i18next, so `{0}`, `{1}`, `{2}` and `{2,choice,...}` show up as raw text, unlike every other key here, which uses `{{0}}`. Keep i18next syntax such as `{{0}}`, or use i18next plurals.

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

Lithuanian bundle has Italian text for loginTotpStep1 — Lithuanian users see an Italian sentence on the OTP setup page. Replace the `loginTotpStep1` value with a Lithuanian translation, such as `Įdiekite vieną iš šių programėlių savo mobiliajame telefone:`. **Also found in:** - `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101-101`

Gold bugs found (2)

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.
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 (0)

None.