GPT-6.1 Sol · 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
2 of 2
Comments published
5
Comments matching a bug
2
Comments not matching
3
Cost of this PR
$2.873

Published comments (5)

mediumbugjs/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188

MessageFormat syntax breaks validation messages in both React UI bundles — Attribute names and bounds remain uninterpolated, and choice expressions appear literally because `ThemeResource.getLocalizationTexts` returns strings without MessageFormat processing. Keep i18next-compatible `{{0}}`, `{{1}}`, and `{{2}}` placeholders and avoid ChoiceFormat syntax in `error-invalid-multivalued-size` in both React UI bundles.

mediumsecuritymisc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:124-126

Choice-expression removal bypasses translation anchor validation — Translations can bypass anchor restrictions because `value.replaceAll` hides choice branches from validation, while `LinkExpirationFormatterMethod` renders them into emails and the runtime sanitizer allows off-site links. Validate every branch’s contents instead of discarding entire choice expressions.

mediumbugmisc/theme-verifier/src/test/resources/illegalHtmlTag_en.properties:17

Malformed HTML fixture masks regressions in forbidden-tag validation — `verifyIllegalHtmlTagDetected` can pass even if `POLICY_SOME_HTML` allows `div`, because repairing the malformed closing tag still triggers a validation error. Give `key` a well-formed forbidden element so the test isolates the tag restriction.

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

Lithuanian OTP setup instructions are in Italian in login and account bundles — Users selecting Lithuanian receive the first OTP setup step in Italian through `loginTotpStep1`. Replace it with a Lithuanian translation and correct `totpStep1` in the account `messages_lt.properties` bundle too. **Also found in:** - `themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101-101`

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

Overlapping prefix and suffix scans crash malformed HTML verification — Overlapping scans make `sanitized.substring` throw `StringIndexOutOfBoundsException` for malformed HTML such as `<p>x</p></p>`, aborting verification instead of reporting it. Bound `end` by the unmatched lengths remaining after `start` in both `sanitized` and `value`.

Gold bugs found (2)

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.
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 (0)

None.