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

Published comments (3)

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

Choice-format normalization hides embedded markup from sanitizer — Dropping the whole `{N,choice,...}` segment in `normalizeValue` lets embedded markup like `<img src=x onerror=alert(1)>` bypass the sanitizer for `error-invalid-multivalued-size` and `linkExpirationFormatter.timePeriodUnit*`. Neutralize only the `<` characters in the choice pattern so choice literals are still sanitized.

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

Lithuanian account messages totpStep1 replaced with Italian text — Lithuanian users of the account and login TOTP setup pages now see Italian instructions. Restore the Lithuanian translation in `totpStep1`; the same wrong-language string is also in `messages_lt.properties` under the login theme.

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

error-invalid-multivalued-size uses MessageFormat syntax breaking i18next — i18next only interpolates `{{ }}`, so `error-invalid-multivalued-size` displays raw `{0}` and `{2,choice,...}` text in the admin UI and conflicts with existing translations. Keep `{{0}}`/`{{2}}` here and in the account `messages_en.properties`; the `choice` form belongs only in server-side theme bundles. **Also found in:** - `js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188-188`

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.