Claude Sonnet 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
1 of 2
Comments published
3
Comments matching a bug
1
Comments not matching
2
Cost of this PR
$0.653

Published comments (3)

mediumbugthemes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101

Lithuanian totpStep1 contains Italian text instead of Lithuanian — Lithuanian users see Italian text in the TOTP setup step. Replace `totpStep1` with a Lithuanian translation, and fix `loginTotpStep1` in the login `messages_lt.properties`, which has the same Italian sentence.

mediumbugthemes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112

zh_CN totpStep1 uses Traditional Chinese text instead of Simplified — Simplified Chinese users see Traditional characters and wording in the TOTP setup step. Change `totpStep1` to the Simplified text, "在您的手机上安装以下应用程序之一:".

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

Overlapping prefix/suffix trimming causes StringIndexOutOfBoundsException — When the matched prefix and suffix overlap, `substring` throws `StringIndexOutOfBoundsException`, so the verifier crashes instead of reporting the illegal HTML. Cap `end` at the shorter length of `value` and `sanitized` minus `start`.

Gold bugs found (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.

Gold bugs missed (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.