DeepSeek V4.1 Flash · 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.628

Published comments (5)

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

Choice-format blocks hide HTML from message sanitizer — Because `normalizeValue` strips the `{n,choice,...}` block before sanitizing, HTML hidden in `error-invalid-multivalued-size` on both sides is erased and passes, enabling XSS. Sanitize the block content before substituting the placeholder instead of discarding it.

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

Lithuanian TOTP setup message replaced with Italian text — Lithuanian users now see an Italian sentence on the TOTP setup page. Restore a Lithuanian translation of `loginTotpStep1` here and of `totpStep1` in `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties`.

mediumbugmisc/theme-verifier/src/test/java/org/keycloak/themeverifier/VerifyMessagePropertiesTest.java:36-46

Tests never exercise allowed HTML translation branch — Both `illegalHtmlTag_en.properties` and `noHtml_de.properties` bypass the permissive branch, so breaking `containsHtml(englishValue)` would leave all tests green while legal `<b>` translations fail. Add an English/German fixture pair with an allowed tag asserting `verify()` returns empty.

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

Multivalued size error message uses Java MessageFormat syntax i18next cannot render — The admin console renders this key with i18next (`user-profile/utils.ts:79`), which ignores `{0}` and the `MessageFormat` choice, so users see the literal placeholder text. Keep `error-invalid-multivalued-size` in `{{n}}` form. **Also found in:** - `js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188-188`

mediumbugmisc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:74-80

Missing English bundle aborts verification with raw RuntimeException — A translation file without a matching `messages_en.properties` makes `verifySafeHtml` throw a raw `RuntimeException` that escapes the `IOException` catch and aborts the build. Check `Files.exists` and report the file through `messages` instead.

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.