Kimi K3.1 Pro · 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
- 6
- Comments matching a bug
- 2
- Comments not matching
- 4
- Cost of this PR
- $1.468
Published comments (6)
Multivalued-size error uses ICU syntax unsupported by i18next — `setUserProfileServerError` uses plain i18next, so the single-brace placeholders and `{2,choice,...}` render literally instead of formatting the error. Use `{{0}}`-style placeholders and plain plural wording here and in admin-ui's `messages_en.properties`, or configure ICU formatting at both consumers.
TOTP setup instructions are Italian in the Lithuanian message resources — The `totpStep1` replacement makes Lithuanian users see Italian instructions during TOTP setup, and `login/messages/messages_lt.properties` contains the same text. Restore Lithuanian translations in both message resources.
totpStep1 contains Traditional Chinese in the zh_CN bundle — Replace the value with Simplified Chinese, such as `在您的手机上安装以下应用程序之一:`.
Choice replacement hides HTML from `VerifyMessageProperties` — An `onerror` payload inside `{2,choice,...}` can be reduced to `...` and never reach sanitization. Restrict `value.replaceAll` to numeric `<` operators, or sanitize each choice branch so embedded HTML is verified.
`santizeAnchors` lets unsafe anchor URLs bypass sanitization — An English `javascript:` URL can pass verification because `santizeAnchors` deletes matching anchors before `PolicyFactory.sanitize` and compares the value with itself after stripping. Validate anchors with an `a`/`href` policy and safe URL protocols instead of removing them.
Auto-closed HTML tags cause StringIndexOutOfBoundsException — Auto-closing `<p>` to `<p></p>` can overlap the common prefix and suffix, giving `value.substring` a begin index past its end index and throwing `StringIndexOutOfBoundsException`. Cap the suffix scan at `value.length() - start` and `sanitized.length() - start` so this input reports a validation message.
Gold bugs found (2)
Gold bugs missed (0)
None.