Amazon Ergo 1.0 · 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 Opus 5.5.
- Gold bugs found
- 2 of 7
- Comments published
- 3
- Comments matching a bug
- 2
- Comments not matching
- 1
- Cost of this PR
- $4.188
Published comments (3)
HTML in choice alternatives bypasses sanitization — Markup hidden inside a `{n,choice,...}` alternative is replaced with `...` by `normalizeValue()` before sanitization, so payloads such as `onerror=alert(1)` pass while remaining in the raw message. Sanitize the alternative text, or strip only the choice syntax while retaining its content.
Fallback regex misses numeric locale regions, validating file against itself — A numeric locale such as `messages_es_419.properties` resolves `englishFile` to itself, so values are validated against themselves and `santizeAnchors()` trusts the file's own anchors, allowing arbitrary anchor HTML. Include numeric region codes in the fallback suffix pattern or use locale-aware fallback resolution.
Lithuanian totpStep1 message contains Italian text — Users selecting Lithuanian now see an Italian instruction. Restore `totpStep1` with a Lithuanian translation instead of the copied string. **Also found in:** - `themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71-71`