MiniMax M3 · Heavy

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

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

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
1 of 2
Comments published
5
Comments matching a bug
1
Comments not matching
4
Cost of this PR
$0.588

Published comments (5)

mediumbugmisc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:70-79

verifySafeHtml throws RuntimeException instead of MojoExecutionException — Rethrow as `MojoExecutionException` so callers and Maven see the documented type.

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

containsHtml misses uppercase HTML tags, wrongly applying POLICY_NO_HTML — `containsHtml()`'s regex `<[a-z]+[^>]*>` misses uppercase tags, so English sources with `<A HREF>` are misread as `POLICY_NO_HTML` and translations get flagged `Illegal HTML`. Compile the pattern with `Pattern.CASE_INSENSITIVE`. **Also found in:** - `misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:139-143`

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

substring wrap-around causes StringIndexOutOfBoundsException in verifySafeHtml — In `verifySafeHtml()` the independent forward `start` and backward `end` scans can both reach `value.length()`, making `value.substring(start, value.length() - end)` throw `StringIndexOutOfBoundsException`. Clamp `start` to `value.length() - end` before building the diagnostic message.

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

loginTotpStep1 has Italian text instead of Lithuanian translation — `loginTotpStep1` in `messages_lt.properties` currently holds Italian text, breaking the Lithuanian locale. Replace it with a Lithuanian translation consistent with neighbouring `_lt` entries.

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

totpStep1 uses Traditional Chinese characters in Simplified Chinese locale — Switch the wording to Simplified characters consistent with the surrounding entries.

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.