Add HTML sanitizer for translated message resources
Tier 2 medium java · local · real merged PR from keycloak/keycloak #37429
Ground-truth defects
In verifySafeHtml the prefix length `start` and suffix length `end` are computed independently with no `start+end <= value.length()` guard, so when the OWASP sanitizer balances mis-nested allowed tags (e.g. `<p><b>x</p>` → `<p><b>x</b></p>`) the overlapping prefix/suffix make `value.substring(start, value.length()-end)` have beginIndex > endIndex, throwing StringIndexOutOfBoundsException exactly on the illegal-HTML case it should report.
The change under review
diff (truncated — full diff)
@@ -185,7 +185,7 @@ webauthn-help-text=Use your Passkey to sign in. webauthn-passwordless-display-name=Passkey webauthn-passwordless-help-text=Use your Passkey for passwordless sign in. passwordless=Passwordless -error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s). +error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}. recovery-authn-code=My recovery authentication codes recovery-authn-codes-display-name=Recovery authentication codes recovery-authn-codes-help-text=These codes can be used to regain your access in case your other 2FA means are not available. @@ -1252,7 +1252,7 @@ onDragCancel=已取消拖动。列表未更改。 removeUser=移除用户 ownerManagedAccess=启用用户管理访问 userModelAttributeNameHelp=从 LDAP 导入用户时要添加的模型属性的名称 -templateHelp=用于格式化要导入的用户名的模板。替换包含在 ${} 中。例如:'${ALIAS}.${CLAIM.sub}'。ALIAS 是供应商别名。CLAIM.<NAME > 引用 ID 或访问令牌声明。可以通过将 |uppercase 或 |lowercase 附加到替换值来将替换转换为大写或小写,例如“${CLAIM.sub | lowercase}”。 +templateHelp=用于格式化要导入的用户名的模板。替换包含在 ${} 中。例如:'${ALIAS}.${CLAIM.sub}'。ALIAS 是供应商别名。CLAIM.<NAME> 引用 ID 或访问令牌声明。可以通过将 |uppercase 或 |lowercase 附加到替换值来将替换转换为大写或小写,例如“${CLAIM.sub | lowercase}”。 permissions=权限 emptyExecutionInstructions=您可以通过添加子流程或执行器来开始定义此流程 offlineSessionSettings=离线会话设置 @@ -3135,7 +3135,7 @@ bruteForceMode.PermanentLockout=Lockout permanently bruteForceMode.TemporaryLockout=Lockout temporarily bruteForceMode.PermanentAfterTemporaryLockout=Lockout permanently after temporary lockout bruteForceMode=Brute Force Mode -error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s). +error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}. multivalued=Multivalued multivaluedHelp=If this attribute supports multiple values. This setting is an indicator and does not enable any validation. to the attribute. For that, make sure to use any of the built-in validators to properly validate the size and the values. @@ -72,6 +72,17 @@ <version>2.2</version> <scope>test</scope> </dependency> + <dependency> + <groupId>com.googlecode.owasp-java-html-sanitizer</groupId> + <artifactId>owasp-java-html-sanitizer</artifactId> + <version>20240325.1</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <version>1.13.0</version> + <scope>compile</scope> + </dependency> </dependencies> @@ -17,15 +17,22 @@ package org.keycloak.themeverifier; import org.apache.maven.plugin.MojoExecutionException; +import org.owasp.html.PolicyFactory; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.StringReader; import java.nio.file.Files; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.MissingResourceException; +import java.util.Objects; +import java.util.PropertyResourceBundle; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class VerifyMessageProperties { @@ -41,12 +48,129 @@ public class VerifyMessageProperties { try { String contents = Files.readString(file.toPath()); verifyNoDuplicateKeys(contents); + verifySafeHtml(); } catch (IOException e) { throw new MojoExecutionException("Can not read file " + file, e); } return messages; } + PolicyFactory POLICY_SOME_HTML = new org.owasp.html.HtmlPolicyBuilder() + .allowElements( + "br", "p", "strong", "b" + ).toFactory(); + + PolicyFactory POLICY_NO_HTML = new org.owasp.html.HtmlPolicyBuilder().toFactory(); + + private void verifySafeHtml() { + PropertyResourceBundle bundle; + try (FileInputStream fis = new FileInputStream(file)) { + bundle = new PropertyResourceBundle(fis); + } catch (IOException e) { + throw new RuntimeException("unable to read file " + file, e); + } + + PropertyResourceBundle bundleEnglish; + String englishFile = file.getAbsolutePath().replaceAll("resources-community", "resources") + .replaceAll("_[a-zA-Z-_]*\\.properties", "_en.properties"); + try (FileInputStream fis = new FileInputStream(englishFile)) { + bundleEnglish = new PropertyResourceBundle(fis); + } catch (IOException e) { + throw new RuntimeException("unable to read file " + englishFile, e); + } + + bundle.getKeys().asIterator().forEachRemaining(key -> { + String value = bundle.getString(key); + value = normalizeValue(key, value); + String englishValue = getEnglishValue(key, bundleEnglish); + englishValue = normalizeValue(key, englishValue); + + value = santizeAnchors(key, value, englishValue); + + // Only if the English source string contains HTML we also allow HTML in the translation + PolicyFactory policy = containsHtml(englishValue) ? POLICY_SOME_HTML : POLICY_NO_HTML; + String sanitized = policy.sanitize(value); + + // Sanitizer will escape HTML entities for quotes and also for numberic tags like '<1>' + sanitized = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(sanitized); + // Sanitizer will add them when there are double curly braces + sanitized = sanitized.replace("<!-- -->", ""); + + if (!Objects.equals(sanitized, value)) { + + // Strip identical characters from the beginning and the end to show where the difference is + int start = 0; + while (start < sanitized.length() && start < value.length() && value.charAt(start) == sanitized.charAt(start)) { + start++; + } + int end = 0; + while (end < sanitized.length() && end < value.length() && value.charAt(value.length() - end - 1) == sanitized.charAt(sanitized.length() - end - 1)) { + end++; + } + + messages.add("Illegal HTML in key " + key + " for file " + file + ": '" + value.substring(start, value.length() - end) + "' vs. '" + sanitized.substring(start, sanitized.length() - end) + "'"); + } + + }); + } + + private String normalizeValue(String key, String value) { + if (key.equals("templateHelp")) { + // Allow "CLAIM.<NAME>" here + value = value.replaceAll("CLAIM\\.<[A-Z]*>", ""); + } else if (key.equals("optimizeLookupHelp")) { + // Allow "<Extensions>" here + value = value.replaceAll("<Extensions>", ""); + } else if (key.startsWith("linkExpirationFormatter.timePeriodUnit") || key.equals("error-invalid-multivalued-size")) { + // The problem is the "<" that appears in the choice + value = value.replaceAll("\\{[0-9]+,choice,[^}]*}", "..."); + } + + // Unescape HTML entities, as we later also unescape HTML entities in the sanitized value + value = org.apache.commons.text.StringEscapeUtils.unescapeHtml4(value); + + if (file.getAbsolutePath().contains("email")) { + // TODO: move the RTL information for emails + value = value.replaceAll(Pattern.quote(" style=\"direction: rtl;\""), ""); + } + return value; + } + + Pattern HTML_TAGS = Pattern.compile("<[a-z]+[^>]*>"); + + private boolean containsHtml(String englishValue) { + return HTML_TAGS.matcher(englishValue).find(); + } + + private static final Pattern ANCHOR_PATTERN = Pattern.compile("</?a[^>]*>"); + + /** + * Allow only those anchor tags from the source key to also appear in the target key. + */ + private String santizeAnchors(String key, String value, String englishValue) { + Matcher matcher = ANCHOR_PATTERN.matcher(value); + Matcher englishMatcher = ANCHOR_PATTERN.matcher(englishValue); + while (matcher.find()) { + if (englishMatcher.find() && Objects.equals(matcher.group(), englishMatcher.group())) { + value = value.replaceFirst(Pattern.quote(englishMatcher.group()), ""); + } else { + messages.add("Didn't find anchor tag " + matcher.group() + " in original string"); + break; + } + } + return value; + } + + private static String getEnglishValue(String key, PropertyResourceBundle bundleEnglish) { + String englishValue; + try { + englishValue = bundleEnglish.getString(key); + } catch (MissingResourceException ex) { + englishValue = ""; + } + return englishValue; + } + private void verifyNoDuplicateKeys(String contents) throws IOException { BufferedReader bufferedReader = new BufferedReader(new StringReader(contents)); String line; @@ -29,8 +29,26 @@ class VerifyMessagePropertiesTest { @Test void verifyDuplicateKeysDetected() throws MojoExecutionException { - List<String> verify = getFile("duplicate_keys.properties").verify(); - MatcherAssert.assertThat(verify, Matchers.contains(Matchers.containsString("Duplicate keys in file"))); + List<String> verify = getFile("duplicateKeys_en.properties").verify(); + MatcherAssert.assertThat(verify, Matchers.hasItem(Matchers.containsString("Duplicate keys in file"))); + } + + @Test + void verifyIllegalHtmlTagDetected() throws MojoExecutionException { + List<String> verify = getFile("illegalHtmlTag_en.properties").verify(); + MatcherAssert.assertThat(verify, Matchers.hasItem(Matchers.containsString("Illegal HTML"))); + } + + @Test + void verifyNoHtmlAllowed() throws MojoExecutionException { + List<String> verify = getFile("noHtml_de.properties").verify(); + MatcherAssert.assertThat(verify, Matchers.hasItem(Matchers.containsString("Illegal HTML"))); + } + + @Test + void verifyNoChangedAnchors() throws MojoExecutionException { + List<String> verify = getFile("changedAnchor_de.properties").verify(); + MatcherAssert.assertThat(verify, Matchers.hasItem(Matchers.containsString("Didn't find anchor tag"))); } private static VerifyMessageProperties getFile(String fixture) { new file mode 100644 @@ -0,0 +1,17 @@ +# +# Copyright 2025 Red Hat, Inc. and/or its affiliates +# and other contributors as indicated by the @author tags. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +key=Some <a href="http://malicious.com">link</a> \ No newline at end of file new file mode 100644 @@ -0,0 +1,17 @@ +# +# Copyright 2025 Red Hat, Inc. and/or its affiliates +# and other contributors as indicated by the @author tags. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +key=Some <a href="http://example.com">link</a> \ No newline at end of file similarity index 100% rename from misc/theme-verifier/src/test/resources/duplicate_keys.properties rename to misc/theme-verifier/src/test/resources/duplicateKeys_en.properties new file mode 100644 @@ -0,0 +1,17 @@ +# +# Copyright 2025 Red Hat, Inc. and/or its affiliates +# and other contributors as indicated by the @author tags. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +key=Some <div>tag</div \ No newline at end of file new file mode 100644 @@ -0,0 +1,17 @@ +# +# Copyright 2025 Red Hat, Inc. and/or its affiliates +# and other contributors as indicated by the @author tags. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +key=Some <b>HTML</b> \ No newline at end of file new file mode 100644 @@ -0,0 +1,17 @@ +# +# Copyright 2025 Red Hat, Inc. and/or its affiliates +# and other contributors as indicated by the @author tags. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +key=No HTML \ No newline at end of file @@ -138,7 +138,7 @@ revoke=Kumoa oikeudet configureAuthenticators=Konfiguroitu kaksivaiheinen kirjautuminen mobile=Mobiili -totpStep1=Asenna <a href="https://freeotp.github.io/" target="_blank">FreeOTP</a> tai Google Authenticator ohjelma laiteellesi. Kummatkin sovellukset ovat saatavilla <a href="https://play.google.com">Google Play</a> ja Apple App Store kaupoissa. +totpStep1=Asenna jokin seuraavista sovelluksista matkapuhelimeesi: totpStep2=Avaa sovellus ja skannaa QR-koodi tai kirjoita avain. totpStep3=Täytä saamasi kertaluontoinen koodisi allaolevaan kenttään ja paina Tallenna. totpStep3DeviceName=Anna laitteelle nimi, jotta voit hallinnoida OTP-laitteitasi. @@ -98,7 +98,7 @@ revoke=Atšaukti įgaliojimą configureAuthenticators=Sukonfigūruotas autentifikatorius mobile=Mobilus -totpStep1=Įdiekite <a href="https://freeotp.github.io/" target="_blank">FreeOTP</a> arba Google Authenticator savo įrenginyje. Programėlės prieinamos <a href="https://play.google.com">Google Play</a> ir Apple App Store. +totpStep1=Installa una delle seguenti applicazioni sul tuo cellulare: totpStep2=Atidarykite programėlę ir nuskenuokite barkodą arba įveskite kodą. totpStep3=Įveskite programėlėje sugeneruotą vieną kartą galiojantį kodą ir paspauskite Saugoti norėdami prisijungti. @@ -98,7 +98,7 @@ revoke=Zrušiť oprávnenie configureAuthenticators=Nakonfigurované autentifikátory mobile=Mobilný -totpStep1=Nainštalujte vo svojom zariadení <a href="https://freeotp.github.io/" target="_blank"> FreeOTP </a> alebo Google Authenticator. Obidve aplikácie sú k dispozícii v <a href="https://play.google.com"> Google Play </a> a Apple App Store. +totpStep1=Nainštalujte si do mobilu jednu z nasledujúcich aplikácií: totpStep2=Otvorte aplikáciu a naskenujte čiarový kód alebo zadajte kľúč. totpStep3=Zadajte jednorazový kód poskytnutý aplikáciou a kliknutím na tlačidlo Uložiť dokončíte nastavenie. @@ -93,7 +93,7 @@ revoke=Upphäv rättighet configureAuthenticators=Konfigurerade autentiserare mobile=Mobil -totpStep1=Installera <a href="https://freeotp.github.io/" target="_blank">FreeOTP</a> eller Google Authenticator på din enhet. Båda applikationerna finns tillgängliga på <a href="https://play.google.com">Google Play</a> och Apple App Store. +totpStep1=Installera en av följande applikationer på din mobil: totpStep2=Öppna applikationen och skanna streckkoden eller skriv i nyckeln. totpStep3=Fyll i engångskoden som tillhandahålls av applikationen och klicka på Spara för att avsluta inställningarna. @@ -109,7 +109,7 @@ revoke=收回授权 configureAuthenticators=配置的认证者 mobile=手机 -totpStep1=在你的设备上安装 <a href="https://fedorahosted.org/freeotp/" target="_blank">FreeOTP</a> 或者 Google Authenticator.两个应用可以从 <a href="https://play.google.com">Google Play</a> 和 Apple App Store下载。 +totpStep1=在您的手機上安裝以下應用程式之一: totpStep2=打开应用扫描二维码输入验证码 totpStep3=输入应用提供的一次性验证码单击保存 @@ -6,7 +6,7 @@ emailTestBody=Dette er en test besked emailTestBodyHtml=<p>Dette er en test besked</p> identityProviderLinkSubject=Link {0} identityProviderLinkBody=Nogen vil forbinde din "{1}" konto med "{0}" kontoen som er tilknyttet brugeren {2}. Hvis dette var dig, bedes du klikke på forbindet herunder for at forbinde de to konti\n\n{3}\n\nDette link vil udløbe efter {5}.\n\nHvis du ikke vil forbinde disse konti, kan du bare ignore denne besked. Hvis du vælger at forbinde de to konti, kan du logge ind som {1} via {0}. -identityProviderLinkBodyHtml=<p>Nogen vil forbinde din <b>{1}</b> konto med <b>{0}</b> kontoen som er tilknyttet brugeren {2}. Hvis dette var dig, bedes du klikke på forbindet herunder for at forbinde de to konti</p><p><a href="{3}">Bekræft</a></p><p>Dette link vil udløbe efter {5}.</p><p>nHvis du ikke vil forbinde disse konti, kan du bare ignore denne besked. Hvis du vælger at forbinde de to konti, kan du logge ind som {1} via {0}. +identityProviderLinkBodyHtml=<p>Nogen vil forbinde din <b>{1}</b> konto med <b>{0}</b> kontoen som er tilknyttet brugeren {2}. Hvis dette var dig, bedes du klikke på forbindet herunder for at forbinde de to konti</p><p><a href="{3}">Bekræft</a></p><p>Dette link vil udløbe efter {5}.</p><p>nHvis du ikke vil forbinde disse konti, kan du bare ignore denne besked. Hvis du vælger at forbinde de to konti, kan du logge ind som {1} via {0}.</p> passwordResetSubject=Gendan adgangskode passwordResetBody=Nogen har forsøgt at nulstille adgangskoden til {2}. Hvis dette var dig, bedes du klikke på linket herunder for at nulstille adgangskoden.\n\n{0}\n\nDette link og kode vil udløbe efter {3}.\n\nHvis du ikke ønsker at nulstille din adgangskode, kan du se bort fra denne besked. passwordResetBodyHtml=<p>Nogen har forsøgt at nulstille adgangskoden til {2}. Hvis dette var dig, bedes du klikke på linket herunder for at nulstille adgangskoden.</p><p><a href="{0}">Nulstil adgangskode</a></p><p>Dette link og kode vil udløbe efter {3}.</p><p>Hvis du ikke ønsker at nulstille din adgangskode, kan du se bort fra denne besked.</p> @@ -3,7 +3,7 @@ emailVerificationBody=شخصی با این آدرس ایمیل یک حساب {2} emailVerificationBodyHtml=<p>شخصی با این آدرس ایمیل یک حساب {2} ایجاد کرده است. اگر این شما بودید، برای تأیید آدرس ایمیل خود روی پیوند زیر کلیک کنید</p><p><a href="{0}">پیوند به تأیید آدرس ایمیل</a></p><p>این پیوند در {3} منقضی میشود.</p><p>اگر شما این حساب را ایجاد نکردهاید، فقط این پیام را نادیده بگیرید.</p> emailUpdateConfirmationSubject=تایید ایمیل جدید emailUpdateConfirmationBody=برای بهروزرسانی حساب {2} خود با آدرس ایمیل {1}، روی پیوند زیر کلیک کنید\n\n{0}\n\nاین پیوند ظرف {3} منقضی میشود.\n\nاگر نمیخواهید ادامه دهید این تغییر، فقط این پیام را نادیده بگیرید. -emailUpdateConfirmationBodyHtml=<p>برای بهروزرسانی حساب {2} خود با آدرس ایمیل {1}، روی پیوند زیر کلیک کنید</p><p><a href="{0}">{0}</a></p>< p>این پیوند در مدت {3} منقضی میشود.</p><p>اگر نمیخواهید به این اصلاح ادامه دهید، فقط این پیام را نادیده بگیرید.</p> +emailUpdateConfirmationBodyHtml=<p>برای بهروزرسانی حساب {2} خود با آدرس ایمیل {1}، روی پیوند زیر کلیک کنید</p><p><a href="{0}">{0}</a></p><p>این پیوند در مدت {3} منقضی میشود.</p><p>اگر نمیخواهید به این اصلاح ادامه دهید، فقط این پیام را نادیده بگیرید.</p> emailTestSubject=[KEYCLOAK] - پیام آزمایشی SMTP emailTestBody=این یک پیام آزمایشی است emailTestBodyHtml=<p>این یک پیام آزمایشی است</p> @@ -3,7 +3,7 @@ emailVerificationBody=Ezzel az e-mail címmel valaki létrehozott egy {2} tartom emailVerificationBodyHtml=<p>Ezzel az e-mail címmel valaki létrehozott egy {2} tartomány felhasználói fiókot. Amennyiben a fiókot Ön hozta létre, kérem, kattintson a lenti hivatkozásra, hogy megerősítse fiókját és ezt az e-mail címet.</p><p><a href="{0}">Hivatkozás a fiók és az e-mail cím megerősítéséhez</a></p><p>A hivatkozás érvényét veszti {3} múlva.</p><p>Ha nem ön hozta létre a felhasználói fiókot, akkor kérem, hagyja figyelmen kívül ezt az üzenetet.</p> emailUpdateConfirmationSubject=Új e-mail cím megerősítése emailUpdateConfirmationBody=Valaki módosítani szeretné az Ön "{2}" tartományi fiókjának e-mail címét. Amennyiben az e-mail cím módosítását Ön kezdeményezte, kérem, kattintson a lenti hivatkozásra a jóváhagyáshoz\n\n{0}\n\nA hivatkozás érvényét veszti {3} múlva.\n\nHa nem ön kérte az e-mail cím megváltoztatását, akkor kérem, hagyja figyelmen kívül ezt az üzenetet, az e-mail címe nem fog megváltozni. -***emailUpdateConfirmationBodyHtml=<p>Valaki módosítani szeretné az Ön <b>{2}</b> tartományi fiókjának e-mail címét. Amennyiben az e-mail cím módosítását Ön kezdeményezte, kérem, kattintson a lenti hivatkozásra a jóváhagyáshoz</p><p><a href="{0}">{0}</a></p><p>A hivatkozás érvényét veszti {3} múlva.</p><p>Ha nem ön kérte az e-mail cím megváltoztatását, akkor kérem, hagyja figyelmen kívül ezt az üzenetet, az e-mail címe nem fog megváltozni.</p> +emailUpdateConfirmationBodyHtml=<p>Valaki módosítani szeretné az Ön <b>{2}</b> tartományi fiókjának e-mail címét. Amennyiben az e-mail cím módosítását Ön kezdeményezte, kérem, kattintson a lenti hivatkozásra a jóváhagyáshoz</p><p><a href="{0}">{0}</a></p><p>A hivatkozás érvényét veszti {3} múlva.</p><p>Ha nem ön kérte az e-mail cím megváltoztatását, akkor kérem, hagyja figyelmen kívül ezt az üzenetet, az e-mail címe nem fog megváltozni.</p> emailTestSubject=[KEYCLOAK] - SMTP teszt üzenet emailTestBody=Ez egy KEYCLOAK teszt üzenet. emailTestBodyHtml=<p>Ez egy KEYCLOAK teszt üzenet.</p> @@ -1,15 +1,15 @@ emailVerificationSubject=El. pašto patvirtinimas emailVerificationBody=Paskyra {2} sukurta naudojant šį el. pašto adresą. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą\n\n{0}\n\nŠi nuoroda galioja {1} min.\n\nJei paskyros nekūrėte, tuomet ignuoruokite šį laišką. -emailVerificationBodyHtml=<p>Paskyra {2} sukurta naudojant šį el. pašto adresą. Jei tao buvote Jūs, tuomet paspauskite žemiau esančią nuorodą</p><p><a href=LT"{0}">{0}</a></p><p>Ši nuoroda galioja {1} min.</p><p>nJei paskyros nekūrėte, tuomet ignuoruokite šį laišką.</p> +emailVerificationBodyHtml=<p>Paskyra {2} sukurta naudojant šį el. pašto adresą. Jei tao buvote Jūs, tuomet paspauskite žemiau esančią nuorodą</p><p><a href="{0}">{0}</a></p><p>Ši nuoroda galioja {1} min.</p><p>nJei paskyros nekūrėte, tuomet ignuoruokite šį laišką.</p> identityProviderLinkSubject=Sąsaja {0} identityProviderLinkBody=Kažas pageidauja susieti Jūsų "{1}" paskyrą su "{0}" {2} naudotojo paskyrą. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą norėdami susieti paskyras\n\n{3}\n\nŠi nuoroda galioja {4} min.\n\nJei paskyrų susieti nenorite, tuomet ignoruokite šį laišką. Jei paskyras susiesite, tuomet prie {1} galėsiste prisijungti per {0}. -identityProviderLinkBodyHtml=<p>žas pageidauja susieti Jūsų <b>{1}</b> paskyrą su <b>{0}</b> {2} naudotojo paskyrą. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą norėdami susieti paskyras</p><p><a href=LT"{3}">{3}</a></p><p>Ši nuoroda galioja {4} min.</p><p>Jei paskyrų susieti nenorite, tuomet ignoruokite šį laišką. Jei paskyras susiesite, tuomet prie {1} galėsiste prisijungti per {0}.</p> +identityProviderLinkBodyHtml=<p>žas pageidauja susieti Jūsų <b>{1}</b> paskyrą su <b>{0}</b> {2} naudotojo paskyrą. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą norėdami susieti paskyras</p><p><a href="{3}">{3}</a></p><p>Ši nuoroda galioja {4} min.</p><p>Jei paskyrų susieti nenorite, tuomet ignoruokite šį laišką. Jei paskyras susiesite, tuomet prie {1} galėsiste prisijungti per {0}.</p> passwordResetSubject=Slaptažodžio atkūrimas passwordResetBody=Kažkas pageidauja pakeisti Jūsų paskyros {2} slaptažodį. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą slaptažodžio pakeitimui.\n\n{0}\n\nŠi nuoroda ir kodas galioja {1} min.\n\nJei nepageidajate keisti slaptažodžio, tuomet ignoruokite šį laišką ir niekas nebus pakeista. -passwordResetBodyHtml=<p>Kažkas pageidauja pakeisti Jūsų paskyros {2} slaptažodį. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą slaptažodžio pakeitimui.</p><p><a href=LT"{0}">Kredencialų nustatymo iš naujo nuoroda</a></p><p>Ši nuoroda ir kodas galioja {1} min.</p><p>Jei nepageidajate keisti slaptažodžio, tuomet ignoruokite šį laišką ir niekas nebus pakeista.</p> +passwordResetBodyHtml=<p>Kažkas pageidauja pakeisti Jūsų paskyros {2} slaptažodį. Jei tai buvote Jūs, tuomet paspauskite žemiau esančią nuorodą slaptažodžio pakeitimui.</p><p><a href="{0}">Kredencialų nustatymo iš naujo nuoroda</a></p><p>Ši nuoroda ir kodas galioja {1} min.</p><p>Jei nepageidajate keisti slaptažodžio, tuomet ignoruokite šį laišką ir niekas nebus pakeista.</p> executeActionsSubject=Atnaujinkite savo paskyrą executeActionsBody=Sistemos administratorius pageidauja, kad Jūs atnaujintumėte savo {2} paskyrą. Paspauskite žemiau esančią nuorodą paskyros duomenų atnaujinimui.\n\n{0}\n\nŠi nuoroda galioja {1} min.\n\nJei Jūs neasate tikri, kad tai administratoriaus pageidavimas, tuomet ignoruokite šį laišką ir niekas nebus pakeista. -executeActionsBodyHtml=<p>Sistemos administratorius pageidauja, kad Jūs atnaujintumėte savo {2} paskyrą. Paspauskite žemiau esančią nuorodą paskyros duomenų atnaujinimui.</p><p><a href=LT"{0}">{0}</a></p><p>Ši nuoroda galioja {1} min.</p><p>Jei Jūs neasate tikri, kad tai administratoriaus pageidavimas, tuomet ignoruokite šį laišką ir niekas nebus pakeista.</p> +executeActionsBodyHtml=<p>Sistemos administratorius pageidauja, kad Jūs atnaujintumėte savo {2} paskyrą. Paspauskite žemiau esančią nuorodą paskyros duomenų atnaujinimui.</p><p><a href="{0}">{0}</a></p><p>Ši nuoroda galioja {1} min.</p><p>Jei Jūs neasate tikri, kad tai administratoriaus pageidavimas, tuomet ignoruokite šį laišką ir niekas nebus pakeista.</p>
Leaderboard for this case
medium · 3 of 9 bots fully caught it (33% solve rate) · 33% avg coverage.
| # | Bot | Result | Caught | Coverage | Findings | False alarms |
|---|---|---|---|---|---|---|
| 1 | Claude Code (Opus 5.5) | solved | 1/1 | 100.0% | 7 | 0 |
| 2 | Drape (Deep Review) | solved | 1/1 | 100.0% | 8 | 0 |
| 3 | Mjolnir (Opus 5.5) | solved | 1/1 | 100.0% | 9 | 0 |
| 4 | cursor | miss | 0/1 | 0.0% | 3 | 0 |
| 5 | Drape (Review) | miss | 0/1 | 0.0% | 4 | 0 |
| 6 | Mjolnir (Sonnet 5.5) | miss | 0/1 | 0.0% | 3 | 0 |
| 7 | Cubic | miss | 0/1 | 0.0% | 8 | 1 |
| 8 | greptile | miss | 0/1 | 0.0% | 3 | 1 |
| 9 | qodo | miss | 0/1 | 0.0% | 6 | 1 |
Bot results
Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✓ | off by one |
The admin UI loads messages through i18next (i18n.ts, no custom interpolation format) and ui-shared passes error params as an object to t(), so only {{0}} placeholders get filled in. The changed line now uses MessageFormat {0}/choice syntax, which i18next will not interpolate. [grounded: diff] [consensus 3/3: valid=3]
The account UI message file uses {{0}} i18next placeholders elsewhere (error-invalid-length-too-short). The new MessageFormat syntax will not be interpolated, so users see raw placeholders. [grounded: diff] [consensus 3/3: valid=3]
The Lithuanian account messages file now holds an Italian sentence for totpStep1. [grounded: diff] [consensus 3/3: valid=3]
The Lithuanian login messages file now holds Italian text for loginTotpStep1. [grounded: diff] [consensus 3/3: valid=3]
The new zh_CN text uses Traditional Chinese characters (手機, 安裝, 應用程式), which is the wrong script for Simplified Chinese. [grounded: diff] [consensus 3/3: valid=3]
The English file path is built with replaceAll over the whole absolute path, and a missing counterpart throws an uncaught RuntimeException that fails the build instead of adding a validation message. The behaviour is real, but no file shown in this change triggers it. [grounded: diff] [consensus 3/5: valid=3, uncertain=2]
raw comments (7)
The admin UI renders these messages with i18next, which uses `{{0}}` placeholders (every other error in this file does). The change switches to Java MessageFormat syntax (`{0}`, `{2,choice,...}`), which i18next does not interpolate. Users will see the literal text 'Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.' instead of the real values.
Same problem in the account UI. It is also i18next-based and this file uses `{{0}}` placeholders elsewhere (e.g. error-invalid-length-too-short). With MessageFormat `{0}`/choice syntax, the multivalued-size validation error shows raw placeholders and choice patterns to end users.
The Lithuanian `totpStep1` translation was replaced with Italian text ('Installa una delle seguenti applicazioni sul tuo cellulare:'), so Lithuanian users get an Italian sentence on the OTP setup page.
The Lithuanian `loginTotpStep1` translation was replaced with Italian text ('Installa una delle seguenti applicazioni sul tuo cellulare:'), so the Lithuanian login OTP setup page shows Italian.
The Simplified Chinese (`zh_CN`) `totpStep1` was replaced with Traditional Chinese text ('在您的手機上安裝以下應用程式之一:', using 手機/安裝/應用程式), which is the wrong script for this locale.
The loops that trim the common prefix and suffix are not limited so the two can't overlap. If the matching prefix and suffix overlap in `sanitized` (e.g. value '<b><' sanitized to '<' gives start=1, end=1), then `sanitized.substring(start, sanitized.length() - end)` throws StringIndexOutOfBoundsException. The Maven plugin then fails with an unrelated exception instead of reporting the illegal HTML.
The English counterpart path is built with a regex on the whole absolute path, and a missing file is a hard RuntimeException. Any messages_*.properties file that has no messages_en.properties sibling under the 'resources' mapping (e.g. a community-only theme, or a directory not named resources-community) makes the whole build fail with an uncaught exception instead of a validation message. Also, `replaceAll("resources-community", "resources")` rewrites every occurrence of that string anywhere in the path, not just the theme directory.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
The Lithuanian file now holds Italian text for loginTotpStep1, so Lithuanian users see the wrong language. [grounded: diff] [consensus 5/5: valid=5]
account-ui translates this key on the client with i18next t(key, params), using the default {{var}} interpolation (ui-shared utils.ts). Every other message in this file uses {{0}}. Single-brace MessageFormat placeholders will show up as literal text. [grounded: diff] [consensus 5/5: valid=5]
The new code throws RuntimeException instead of MojoExecutionException. The build still fails either way, so the impact is only a less clean error path. [grounded: diff] [consensus 5/5: valid=5]
admin-ui uses i18next with the default double-brace interpolation and has no ICU plugin. The old {{0}} syntax worked; the new single-brace and choice syntax will render literally. [grounded: diff] [consensus 5/5: valid=5]
This is a version-management suggestion, not a behavior bug. The module also has no parent pom, so it cannot use the root property anyway. [grounded: diff] [consensus 5/5: minor=5]
The typo was already there before this change. The diff only changed <br/> to <br />. [invalid: contradiction] [consensus 5/5: invalid=5]
The Lithuanian account file now has Italian text for totpStep1. [grounded: diff] [consensus 5/5: valid=5]
The new zh_CN value is written in Traditional Chinese characters (手機, 安裝, 應用程式) instead of Simplified. [grounded: diff] [consensus 5/5: valid=5]
raw comments (9)
<!-- cubic:v=63c4aa4d-b61f-475a-801c-a13e37834a4b -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":9} -->
P2: The new `loginTotpStep1` value in the Lithuanian file is Italian text (`Installa una delle seguenti applicazioni sul tuo cellulare:`), not Lithuanian. Lithuanian users will see the TOTP setup step in the wrong language. Replace it with a Lithuanian translation such as "Įdiekite vieną iš šių programų savo mobiliajame įrenginyje:".
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties, line 71:
<comment>The new `loginTotpStep1` value in the Lithuanian file is Italian text (`Installa una delle seguenti applicazioni sul tuo cellulare:`), not Lithuanian. Lithuanian users will see the TOTP setup step in the wrong language. Replace it with a Lithuanian translation such as "Įdiekite vieną iš šių programų savo mobiliajame įrenginyje:".</comment>
<file context>
@@ -68,7 +68,7 @@ country=Šalis
gssDelegationCredential=GSS prisijungimo duomenų delegavimas
-loginTotpStep1=Įdiekite <a href="https://freeotp.github.io/" target="_blank">FreeOTP</a> arba Google Authenticator savo įrenginyje. Programėlės prieinamos <a href="https://play.google.com">Google Play</a> ir Apple App Store.
+loginTotpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
loginTotpStep2=Atidarykite programėlę ir nuskenuokite barkodą arba įveskite kodą.
loginTotpStep3=Įveskite programėlėje sugeneruotą vieną kartą galiojantį kodą ir paspauskite Saugoti norėdami prisijungti.
</file context>
```
</details>
```suggestion
loginTotpStep1=Įdiekite vieną iš šių programų savo mobiliajame įrenginyje:
```
<!-- cubic:v=a764d3fe-ba39-4b1e-8523-1e3c1d6fa419 -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":6} -->
P2: The new value switches `error-invalid-multivalued-size` to Java MessageFormat syntax (`{0}`, `{2,choice,...}`), but this file is consumed by the account console's React i18next client, which loads the raw values and interpolates with double braces only (src/i18n.ts backend + default interpolation). Every other message in this file uses `{{n}}` (e.g. `error-invalid-length-too-short='{{0}}' ...`). Under i18next, `{0}`, `{1}`, `{2}` and the `{2,choice,0#values|1#value|1<values}` clause are not interpreted, so the rendered error would show the literal text "Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}." with no values substituted and no pluralization. Keep the message consistent with the file's i18next `{{n}}` convention (or migrate the whole message set at once if a server-side MessageFormat path is intended, since then all remaining `{{0}}` messages in this file would render braces literally).
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties, line 188:
<comment>The new value switches `error-invalid-multivalued-size` to Java MessageFormat syntax (`{0}`, `{2,choice,...}`), but this file is consumed by the account console's React i18next client, which loads the raw values and interpolates with double braces only (src/i18n.ts backend + default interpolation). Every other message in this file uses `{{n}}` (e.g. `error-invalid-length-too-short='{{0}}' ...`). Under i18next, `{0}`, `{1}`, `{2}` and the `{2,choice,0#values|1#value|1<values}` clause are not interpreted, so the rendered error would show the literal text "Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}." with no values substituted and no pluralization. Keep the message consistent with the file's i18next `{{n}}` convention (or migrate the whole message set at once if a server-side MessageFormat path is intended, since then all remaining `{{0}}` messages in this file would render braces literally).</comment>
<file context>
@@ -185,7 +185,7 @@ webauthn-help-text=Use your Passkey to sign in.
webauthn-passwordless-help-text=Use your Passkey for passwordless sign in.
passwordless=Passwordless
-error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s).
+error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
recovery-authn-code=My recovery authentication codes
recovery-authn-codes-display-name=Recovery authentication codes
</file context>
```
</details>
```suggestion
error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s).
```
<!-- cubic:v=02a3f103-49eb-4a75-93ce-f781c1b301ef -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":8} -->
P2: When the derived English bundle is missing or unreadable, this catch throws an unchecked `RuntimeException`, so the verifier aborts outside its declared Maven error path. Propagate the checked exception or wrap it in `MojoExecutionException` from `verifySafeHtml()`.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java, line 79:
<comment>When the derived English bundle is missing or unreadable, this catch throws an unchecked `RuntimeException`, so the verifier aborts outside its declared Maven error path. Propagate the checked exception or wrap it in `MojoExecutionException` from `verifySafeHtml()`.</comment>
<file context>
@@ -41,12 +48,129 @@ public List<String> verify() throws MojoExecutionException {
+ try (FileInputStream fis = new FileInputStream(englishFile)) {
+ bundleEnglish = new PropertyResourceBundle(fis);
+ } catch (IOException e) {
+ throw new RuntimeException("unable to read file " + englishFile, e);
+ }
+
</file context>
```
</details>
<!-- cubic:v=c37993d2-6ad7-41c7-9e51-9f8aba54e800 -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":7} -->
P2: The ICU MessageFormat syntax `{0}` and `{2,choice,0#values|1#value|1<values}` will not be interpolated. Both admin-ui (`js/apps/admin-ui/src/i18n/i18n.ts`) and account-ui (`js/apps/account-ui/src/i18n.ts`) use i18next with the default `{{var}}` interpolation and no MessageFormat plugin or formatter, so `{0}`, `{1}`, `{2}` are not placeholders and the `choice` expression is not parsed. The previous `{{0}}`/`{{1}}`/`{{2}}` syntax matched i18next. As written, this error renders literally as "Attribute {0} must have at least {1} and at most {2} {2,choice,...}" for users. Keep i18next-compatible placeholders, or add ICU MessageFormat support to the i18next setup in the same change.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties, line 3138:
<comment>The ICU MessageFormat syntax `{0}` and `{2,choice,0#values|1#value|1<values}` will not be interpolated. Both admin-ui (`js/apps/admin-ui/src/i18n/i18n.ts`) and account-ui (`js/apps/account-ui/src/i18n.ts`) use i18next with the default `{{var}}` interpolation and no MessageFormat plugin or formatter, so `{0}`, `{1}`, `{2}` are not placeholders and the `choice` expression is not parsed. The previous `{{0}}`/`{{1}}`/`{{2}}` syntax matched i18next. As written, this error renders literally as "Attribute {0} must have at least {1} and at most {2} {2,choice,...}" for users. Keep i18next-compatible placeholders, or add ICU MessageFormat support to the i18next setup in the same change.</comment>
<file context>
@@ -3135,7 +3135,7 @@ bruteForceMode.PermanentLockout=Lockout permanently
bruteForceMode.PermanentAfterTemporaryLockout=Lockout permanently after temporary lockout
bruteForceMode=Brute Force Mode
-error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s).
+error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
multivalued=Multivalued
multivaluedHelp=If this attribute supports multiple values. This setting is an indicator and does not enable any validation.
</file context>
```
</details>
```suggestion
error-invalid-multivalued-size=Attribute {{0}} must have at least {{1}} and at most {{2}} value(s).
```
<!-- cubic:v=e19ceda2-91c7-400e-b581-34c5196fb5ae -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":5} -->
P3: The sanitizer version is hard-coded here while the root pom manages the identical artifact under ${owasp.html.sanitizer.version} (currently also 20240325.1). When the root property is bumped (e.g., a security fix), theme-verifier silently stays on the old sanitizer, so the verifier and the server can diverge. Consider referencing the shared version or noting why this standalone module pins it separately.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At misc/theme-verifier/pom.xml, line 78:
<comment>The sanitizer version is hard-coded here while the root pom manages the identical artifact under ${owasp.html.sanitizer.version} (currently also 20240325.1). When the root property is bumped (e.g., a security fix), theme-verifier silently stays on the old sanitizer, so the verifier and the server can diverge. Consider referencing the shared version or noting why this standalone module pins it separately.</comment>
<file context>
@@ -72,6 +72,17 @@
+ <dependency>
+ <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
+ <artifactId>owasp-java-html-sanitizer</artifactId>
+ <version>20240325.1</version>
+ </dependency>
+ <dependency>
</file context>
```
</details>
<!-- cubic:v=efa0da86-c905-462a-8c68-7aadfc7918c0 -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":9} -->
P3: This touched line still contains a typo: "Anahatarınızı" should be "Anahtarınızı" (Anahtar = key, as correctly used on the next line webauthn-error-api-get). Since the PR is re-editing these translation lines anyway, fix the user-visible error text in the same pass.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At themes/src/main/resources-community/theme/base/login/messages/messages_tr.properties, line 469:
<comment>This touched line still contains a typo: "Anahatarınızı" should be "Anahtarınızı" (Anahtar = key, as correctly used on the next line webauthn-error-api-get). Since the PR is re-editing these translation lines anyway, fix the user-visible error text in the same pass.</comment>
<file context>
@@ -466,11 +466,11 @@ webauthn-unsupported-browser-text= WebAuthn tarayıcınız tarafından desteklen
webauthn-error-title= Geçiş Anahtarı hatası,
-webauthn-error-registration= Geçiş Anahatarınızı kaydederken hata oluştu.<br/> {0},
-webauthn-error-api-get= Geçiş Anahtarınızı doğrularken hata oluştu.<br/> {0},
+webauthn-error-registration= Geçiş Anahatarınızı kaydederken hata oluştu.<br /> {0},
+webauthn-error-api-get= Geçiş Anahtarınızı doğrularken hata oluştu.<br /> {0},
webauthn-error-different-user= İlk doprulanan kullanıcı ile Geçiş Anahtarı işe doğrulanan kullanıcı aynı değil..,
</file context>
```
</details>
```suggestion
webauthn-error-registration= Geçiş Anahtarınızı kaydederken hata oluştu.<br /> {0},
```
<!-- cubic:v=b53108d3-06e9-44f1-97a7-d51df5ae8502 -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":10} -->
P3: Lithuanian users will see an Italian sentence for the first TOTP setup step. Replace this copied Italian value with a Lithuanian translation.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties, line 101:
<comment>Lithuanian users will see an Italian sentence for the first TOTP setup step. Replace this copied Italian value with a Lithuanian translation.</comment>
<file context>
@@ -98,7 +98,7 @@ revoke=Atšaukti įgaliojimą
configureAuthenticators=Sukonfigūruotas autentifikatorius
mobile=Mobilus
-totpStep1=Įdiekite <a href="https://freeotp.github.io/" target="_blank">FreeOTP</a> arba Google Authenticator savo įrenginyje. Programėlės prieinamos <a href="https://play.google.com">Google Play</a> ir Apple App Store.
+totpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
totpStep2=Atidarykite programėlę ir nuskenuokite barkodą arba įveskite kodą.
totpStep3=Įveskite programėlėje sugeneruotą vieną kartą galiojantį kodą ir paspauskite Saugoti norėdami prisijungti.
</file context>
```
</details>
```suggestion
totpStep1=Įdiekite vieną iš šių programų savo mobiliajame telefone:
```
<!-- cubic:v=cb9474e5-61de-4d9d-aca8-55ea8a5524e5 -->
<!-- cubic:review-run=44a10ce9-3e3c-564a-98df-850a2e69f44f -->
<!-- metadata:{"confidence":10} -->
P3: Simplified-Chinese users will see Traditional-Chinese characters in the first TOTP setup instruction. Use a Simplified-Chinese translation for `messages_zh_CN.properties`.
<details>
<summary>Prompt for AI agents</summary>
```text
Check if this issue is valid — if so, understand the root cause and fix it. At themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties, line 112:
<comment>Simplified-Chinese users will see Traditional-Chinese characters in the first TOTP setup instruction. Use a Simplified-Chinese translation for `messages_zh_CN.properties`.</comment>
<file context>
@@ -109,7 +109,7 @@ revoke=收回授权
configureAuthenticators=配置的认证者
mobile=手机
-totpStep1=在你的设备上安装 <a href="https://fedorahosted.org/freeotp/" target="_blank">FreeOTP</a> 或者 Google Authenticator.两个应用可以从 <a href="https://play.google.com">Google Play</a> 和 Apple App Store下载。
+totpStep1=在您的手機上安裝以下應用程式之一:
totpStep2=打开应用扫描二维码输入验证码
totpStep3=输入应用提供的一次性验证码单击保存
</file context>
```
</details>
```suggestion
totpStep1=在您的手机上安装以下应用程序之一:
```
<!-- cubic:review-summary:start -->
**8 issues found** across 48 files
<!-- cubic:review-summary:end -->
<details>
<summary>Prompt for AI agents (unresolved issues)</summary>
```text
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="misc/theme-verifier/pom.xml">
<violation number="1" location="misc/theme-verifier/pom.xml:78">
P3: The sanitizer version is hard-coded here while the root pom manages the identical artifact under ${owasp.html.sanitizer.version} (currently also 20240325.1). When the root property is bumped (e.g., a security fix), theme-verifier silently stays on the old sanitizer, so the verifier and the server can diverge. Consider referencing the shared version or noting why this standalone module pins it separately.</violation>
</file>
<file name="themes/src/main/resources-community/theme/base/login/messages/messages_tr.properties">
<violation number="1" location="themes/src/main/resources-community/theme/base/login/messages/messages_tr.properties:469">
P3: This touched line still contains a typo: "Anahatarınızı" should be "Anahtarınızı" (Anahtar = key, as correctly used on the next line webauthn-error-api-get). Since the PR is re-editing these translation lines anyway, fix the user-visible error text in the same pass.</violation>
</file>
<file name="themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties">
<violation number="1" location="themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71">
P2: The new `loginTotpStep1` value in the Lithuanian file is Italian text (`Installa una delle seguenti applicazioni sul tuo cellulare:`), not Lithuanian. Lithuanian users will see the TOTP setup step in the wrong language. Replace it with a Lithuanian translation such as "Įdiekite vieną iš šių programų savo mobiliajame įrenginyje:".</violation>
</file>
<file name="js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties">
<violation number="1" location="js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188">
P2: The new value switches `error-invalid-multivalued-size` to Java MessageFormat syntax (`{0}`, `{2,choice,...}`), but this file is consumed by the account console's React i18next client, which loads the raw values and interpolates with double braces only (src/i18n.ts backend + default interpolation). Every other message in this file uses `{{n}}` (e.g. `error-invalid-length-too-short='{{0}}' ...`). Under i18next, `{0}`, `{1}`, `{2}` and the `{2,choice,0#values|1#value|1<values}` clause are not interpreted, so the rendered error would show the literal text "Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}." with no values substituted and no pluralization. Keep the message consistent with the file's i18next `{{n}}` convention (or migrate the whole message set at once if a server-side MessageFormat path is intended, since then all remaining `{{0}}` messages in this file would render braces literally).</violation>
</file>
<file name="misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java">
<violation number="1" location="misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:79">
P2: When the derived English bundle is missing or unreadable, this catch throws an unchecked `RuntimeException`, so the verifier aborts outside its declared Maven error path. Propagate the checked exception or wrap it in `MojoExecutionException` from `verifySafeHtml()`.</violation>
</file>
<file name="js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties">
<violation number="1" location="js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138">
P2: The ICU MessageFormat syntax `{0}` and `{2,choice,0#values|1#value|1<values}` will not be interpolated. Both admin-ui (`js/apps/admin-ui/src/i18n/i18n.ts`) and account-ui (`js/apps/account-ui/src/i18n.ts`) use i18next with the default `{{var}}` interpolation and no MessageFormat plugin or formatter, so `{0}`, `{1}`, `{2}` are not placeholders and the `choice` expression is not parsed. The previous `{{0}}`/`{{1}}`/`{{2}}` syntax matched i18next. As written, this error renders literally as "Attribute {0} must have at least {1} and at most {2} {2,choice,...}" for users. Keep i18next-compatible placeholders, or add ICU MessageFormat support to the i18next setup in the same change.</violation>
</file>
<file name="themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties">
<violation number="1" location="themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101">
P3: Lithuanian users will see an Italian sentence for the first TOTP setup step. Replace this copied Italian value with a Lithuanian translation.</violation>
</file>
<file name="themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties">
<violation number="1" location="themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112">
P3: Simplified-Chinese users will see Traditional-Chinese characters in the first TOTP setup instruction. Use a Simplified-Chinese translation for `messages_zh_CN.properties`.</violation>
</file>
```
</details>
<sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/54/ai_pr_review_github_delivery_6d268f770ad1dd500234c0be5e7a2661ff298a9953da9401d61885d2a987580c?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F54)</sub>
<!-- cubic:review-post:ai_pr_review_github_delivery_6d268f770ad1dd500234c0be5e7a2661ff298a9953da9401d61885d2a987580c:28476474280c97c5e355354116b7db516db679f0:44a10ce9-3e3c-564a-98df-850a2e69f44f -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
The admin UI's i18next instance (js/apps/admin-ui/src/i18n/i18n.ts) uses the default `{{ }}` interpolation, and ui-shared passes the error params as an object straight to t(). Nothing converts `{0}` or the `choice` syntax, so the raw pattern is shown. The old `{{0}}` form did interpolate. [grounded: diff] [consensus 5/5: valid=5]
The Lithuanian bundles' totpStep1 and loginTotpStep1 were replaced with Italian text, so lt users would see Italian. [grounded: diff] [consensus 5/5: valid=5]
The new zh_CN value uses Traditional characters (手機, 安裝, 應用程式), while the neighbouring steps are in Simplified. [grounded: diff] [consensus 5/5: valid=5]
raw comments (4)
### JS UI uses Java message format
**High Severity**
<!-- DESCRIPTION START -->
The English `error-invalid-multivalued-size` strings in the Account and Admin UI bundles were changed from i18next placeholders (`{{0}}`) to Java `MessageFormat` syntax (`{0}` and `{2,choice,...}`). Those UIs load messages through `ThemeResource` and interpolate with i18next, which does not understand single-brace placeholders or `choice` format, so English users will see the raw pattern instead of a filled-in validation error.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 6899e0e0-c295-4549-b166-a44b0dd69bc7 -->
<!-- LOCATIONS START
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties#L187-L188
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties#L3137-L3138
LOCATIONS END -->
<details>
<summary>Additional Locations (1)</summary>
- [`js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties#L3137-L3138`](https://github.com/drape-io/crbench-cursor-2026-09/blob/943fd0055f2832cb26e39124f097b4c7e5fd8b83/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties#L3137-L3138)
</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFlMDEwOThiLTEzMDctNGVmMy04ZjFlLTZkMjM1MTNkMGE1ZiIsImVuY3J5cHRpb25LZXkiOiJfTy1yaGVWbzdkNTJDVnJtNVduLTczOHpDQjYtazl6WVN1VEdBU0VkbEw4IiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFlMDEwOThiLTEzMDctNGVmMy04ZjFlLTZkMjM1MTNkMGE1ZiIsImVuY3J5cHRpb25LZXkiOiJfTy1yaGVWbzdkNTJDVnJtNVduLTczOHpDQjYtazl6WVN1VEdBU0VkbEw4IiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByTnVtYmVyIjo1NiwiY29tbWl0U2hhIjoiOTQzZmQwMDU1ZjI4MzJjYjI2ZTM5MTI0ZjA5N2I0YzdlNWZkOGI4MyIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 943fd0055f2832cb26e39124f097b4c7e5fd8b83. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
### Lithuanian TOTP text is Italian
**Medium Severity**
<!-- DESCRIPTION START -->
The Lithuanian `totpStep1` and `loginTotpStep1` strings were replaced with Italian copy (`Installa una delle seguenti applicazioni sul tuo cellulare:`) instead of Lithuanian. Users on the `lt` locale will see the wrong language on the TOTP setup steps in both account and login themes.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 6c43c611-aff0-43f0-969d-2e375e5ed87f -->
<!-- LOCATIONS START
themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties#L100-L101
themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties#L70-L71
LOCATIONS END -->
<details>
<summary>Additional Locations (1)</summary>
- [`themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties#L70-L71`](https://github.com/drape-io/crbench-cursor-2026-09/blob/943fd0055f2832cb26e39124f097b4c7e5fd8b83/themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties#L70-L71)
</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjkwY2RmMzJmLTZiNGQtNDFmYi1iMDI1LWRhMWQ4MjNkMzdlYSIsImVuY3J5cHRpb25LZXkiOiJaMC1OZDZiNTdPRmpKanRzeE0xeHREU25zd0hoYlp0cExkTmVHTlpieHMwIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjkwY2RmMzJmLTZiNGQtNDFmYi1iMDI1LWRhMWQ4MjNkMzdlYSIsImVuY3J5cHRpb25LZXkiOiJaMC1OZDZiNTdPRmpKanRzeE0xeHREU25zd0hoYlp0cExkTmVHTlpieHMwIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByTnVtYmVyIjo1NiwiY29tbWl0U2hhIjoiOTQzZmQwMDU1ZjI4MzJjYjI2ZTM5MTI0ZjA5N2I0YzdlNWZkOGI4MyIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 943fd0055f2832cb26e39124f097b4c7e5fd8b83. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
### Simplified Chinese uses Traditional script
**Low Severity**
<!-- DESCRIPTION START -->
The new `zh_CN` `totpStep1` value uses Traditional Chinese characters (`手機`, `安裝`, `應用程式`) in the Simplified Chinese bundle. Adjacent steps in the same file remain Simplified, so account TOTP setup shows mixed scripts for that locale.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 61dc5d92-da6c-420f-99ff-e112f02cded3 -->
<!-- LOCATIONS START
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties#L111-L112
LOCATIONS END -->
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJmZDRiMjg1LTQwMzItNDYzYi1iYmU3LTIyM2E3Y2MyZjVkNSIsImVuY3J5cHRpb25LZXkiOiJqc001SS1rYWJQbGZxcHkwVU9FdDdZNWNNejRQdVRjaUkwWFZjdlhzTGVNIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjJmZDRiMjg1LTQwMzItNDYzYi1iYmU3LTIyM2E3Y2MyZjVkNSIsImVuY3J5cHRpb25LZXkiOiJqc001SS1rYWJQbGZxcHkwVU9FdDdZNWNNejRQdVRjaUkwWFZjdlhzTGVNIiwiYnJhbmNoIjoidDIta2V5Y2xvYWstMzc0MjkiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByTnVtYmVyIjo1NiwiY29tbWl0U2hhIjoiOTQzZmQwMDU1ZjI4MzJjYjI2ZTM5MTI0ZjA5N2I0YzdlNWZkOGI4MyIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 943fd0055f2832cb26e39124f097b4c7e5fd8b83. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo1YzQwOWE0OC01ZGYyLTRmNWEtODI2Mi1hMWVmMzQ1ZjZmNmIiLCJlbmNyeXB0aW9uS2V5IjoiQXpxZXNZbTA0OXY0NkY4X293U2NFYkdOVm9pVXpxYzlfb19qM1l0blhSWSIsImJyYW5jaCI6InQyLWtleWNsb2FrLTM3NDI5IiwicmVwb093bmVyIjoiZHJhcGUtaW8iLCJyZXBvTmFtZSI6ImNyYmVuY2gtY3Vyc29yLTIwMjYtMDkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
<sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
<sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 943fd0055f2832cb26e39124f097b4c7e5fd8b83. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✓ | off by one |
The admin UI translates server errors with i18next t() using a params object (ui-shared utils), and i18n.ts keeps the default {{ }} interpolation prefix. Changing {{0}} to {0} plus Java choice syntax means the raw template is shown. [grounded: diff] [consensus 3/3: valid=3]
The account UI is also i18next-based and every other entry in the file uses {{0}}. The change to single braces and Java choice syntax breaks interpolation there. [grounded: diff] [consensus 3/3: valid=3]
The new code throws an unchecked RuntimeException when the derived _en file is missing. This bypasses the IOException→MojoExecutionException handling. The build fails either way, so the impact is low. [grounded: tree misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java] [consensus 3/3: valid=3]
The key parameter is unused and the file is not included, while the mojo merges messages from all files. As a result, a failure cannot be traced to its source. [grounded: tree misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java] [consensus 3/5: valid=3, minor=2]
手機/安裝/應用程式 are Traditional Chinese characters, but they were added to the Simplified Chinese zh_CN bundle. [grounded: diff] [consensus 3/3: valid=3]
For these keys, the entire choice block, including the branch text, is replaced before sanitizing. Any HTML inside a branch therefore goes unchecked, which is a gap in the new verifier. [grounded: tree misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java] [consensus 3/3: valid=3]
The check looks at the whole absolute path, so a parent directory containing 'email' applies the RTL-style exemption to non-email files. This is an edge case with limited effect. [grounded: tree misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java] [consensus 3/3: valid=3]
raw comments (8)
**Admin UI shows raw `{0}` and choice syntax**
The admin UI translates this message with i18next, which only fills in `{{0}}`-style placeholders. With single braces and Java's `{2,choice,...}` syntax, the user sees the template text instead of the attribute name and counts. Keep `{{0}}`/`{{1}}`/`{{2}}` in the UI bundles; use i18next plurals instead of Java choice syntax.
```
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138 error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2993 error-invalid-length-too-long='{{0}}' must have maximal length of {{2}}.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2994 error-invalid-length-too-short='{{0}}' must have minimal length of {{1}}.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2995 error-invalid-length='{{0}}' must have a length between {{1}} and {{2}}.
js/apps/admin-ui/src/i18n/i18n.ts:16 interpolation: {
js/apps/admin-ui/src/i18n/i18n.ts:17 escapeValue: false,
js/apps/admin-ui/src/i18n/i18n.ts:18 },
```
**Account UI shows raw `{0}` and choice syntax**
The account console uses i18next, which only fills `{{0}}` placeholders. With `{0}` and a Java `{2,choice,...}`, the multivalued-size error shows its template text, unlike every other error in this file. Restore `{{0}}`/`{{1}}`/`{{2}}` and drop the MessageFormat choice here.
```
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188 error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:14 error-username-invalid-character='{{0}}' contains invalid character.
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:27 error-invalid-length-too-short='{{0}}' must have minimal length of {{1}}.
```
**Missing English file aborts the whole verification**
If a `messages_xx.properties` has no `_en` file at the computed path, `verifySafeHtml` throws an unchecked RuntimeException. This bypasses the mojo's error collection and the `MojoExecutionException` handling in `verify()`. Report a validation message (or throw IOException/MojoExecutionException) when the English file is missing.
```
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:73 PropertyResourceBundle bundleEnglish;
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:74 String englishFile = file.getAbsolutePath().replaceAll("resources-community", "resources")
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:75 .replaceAll("_[a-zA-Z-_]*\\.properties", "_en.properties");
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:76 try (FileInputStream fis = new FileInputStream(englishFile)) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:52 } catch (IOException e) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:53 throw new MojoExecutionException("Can not read file " + file, e);
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:54 }
```
**Anchor error doesn't say which file or key**
The 'Didn't find anchor tag' message leaves out the file and key. The `key` parameter is passed in but never used, so with hundreds of translation files nobody can locate the offending entry. Include `key` and `file` in the message.
```
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:157 messages.add("Didn't find anchor tag " + matcher.group() + " in original string");
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:111 messages.add("Illegal HTML in key " + key + " for file " + file + ": '" + value.substring(start, value.length() - end) + "' vs. '" + sanitized.substring(start, sanitized.length() - end) + "'");
```
**Error-message trimming can crash with StringIndexOutOfBounds**
When the common prefix and suffix overlap (e.g. sanitized is a prefix of the value and both end in `>`), `start` exceeds `sanitized.length() - end` and `substring` throws instead of reporting. Bound the `end` loop by `min(value.length(), sanitized.length()) - start`.
```
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:99 if (!Objects.equals(sanitized, value)) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:101 // Strip identical characters from the beginning and the end to show where the difference is
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:102 int start = 0;
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:103 while (start < sanitized.length() && start < value.length() && value.charAt(start) == sanitized.charAt(start)) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:104 start++;
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:105 }
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:106 int end = 0;
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:107 while (end < sanitized.length() && end < value.length() && value.charAt(value.length() - end - 1) == sanitized.charAt(sanitized.length() - end - 1)) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:108 end++;
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:109 }
```
**Traditional Chinese text in Simplified Chinese bundle**
The new `totpStep1` text uses Traditional characters (手機, 安裝, 應用程式), but the file is the Simplified Chinese (zh_CN) bundle. It looks copied from zh_TW. Use Simplified characters: 在您的手机上安装以下应用程序之一:
```
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112 totpStep1=在您的手機上安裝以下應用程式之一:
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:113 totpStep2=打开应用扫描二维码输入验证码
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:114 totpStep3=输入应用提供的一次性验证码单击保存
```
**HTML inside choice formats is never checked**
For `linkExpirationFormatter.timePeriodUnit*` and `error-invalid-multivalued-size`, every `{N,choice,...}` block is replaced with "..." before sanitizing. Any tags a translation puts inside a choice branch are hidden from the check. Strip only the `<` comparison operators in the choice, not the branch text.
```
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:124 } else if (key.startsWith("linkExpirationFormatter.timePeriodUnit") || key.equals("error-invalid-multivalued-size")) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:125 // The problem is the "<" that appears in the choice
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:126 value = value.replaceAll("\\{[0-9]+,choice,[^}]*}", "...");
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:127 }
```
**Email detection matches the checkout path**
Whether to strip the RTL style is decided from the whole absolute path. If any parent folder name contains "email", the exemption applies to every theme file, not just email messages. Check the theme type directory (for example `/email/messages/`) instead of the whole path.
```
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:132 if (file.getAbsolutePath().contains("email")) {
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:133 // TODO: move the RTL information for emails
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:134 value = value.replaceAll(Pattern.quote(" style=\"direction: rtl;\""), "");
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:135 }
```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
The diff replaces the Lithuanian loginTotpStep1 in messages_lt.properties with an Italian sentence, so Lithuanian users will see Italian on the OTP setup page. [grounded: diff] [consensus 3/3: valid=3]
The diff replaces the Lithuanian totpStep1 in the base account messages_lt.properties with Italian text. [grounded: diff] [consensus 3/3: valid=3]
The js/apps bundles are loaded by i18next using its default {{ }} interpolation (admin-ui i18n.ts sets no custom delimiters), and sibling keys use {{0}}. Changing these entries from {{0}} to Java {0} plus a choice clause means the placeholders will show up literally in the UI. [grounded: diff] [consensus 3/3: valid=3]
The new zh_CN value uses Traditional characters (手機, 安裝, 應用程式) in the Simplified Chinese bundle, and the rest of the file uses Simplified. [grounded: diff] [consensus 3/3: valid=3]
raw comments (4)
**Lithuanian TOTP instruction replaced with Italian text**
`loginTotpStep1` in the Lithuanian login bundle was changed to an Italian sentence. Lithuanian users now see Italian text on the OTP setup page. Use a Lithuanian translation of 'Install one of the following applications on your mobile:'.
```
themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71 loginTotpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
```
**Lithuanian totpStep1 shows Italian text**
The Lithuanian base account bundle serves this Italian sentence for totpStep1 (keycloak.v3 inherits base via parent=base), so any account theme rendering the key in lt shows Italian. Restore a Lithuanian translation.
```
themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101 totpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
```
**UI message uses wrong placeholder syntax**
The admin-ui and account-ui English `error-invalid-multivalued-size` switched from i18next `{{0}}` to Java `{0}` plus a `{2,choice,...}` clause. i18next supports neither, so they show literally. Keep `{{0}}`-style placeholders and plain 'value(s)' wording in the js/apps files; use the choice format only in server-side themes.
```
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138 error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188 error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2989 error-empty=Please specify value of '{{0}}'.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2990 error-invalid-blank=Please specify value of '{{0}}'.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2991 error-invalid-date='{{0}}' is invalid date.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2992 error-invalid-email=Invalid email address.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2993 error-invalid-length-too-long='{{0}}' must have maximal length of {{2}}.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:2994 error-invalid-length-too-short='{{0}}' must have minimal length of {{1}}.
js/apps/account-ui/maven-resources-community/theme/keycloak.v3/account/messages/messages_fr.properties:188 error-invalid-multivalued-size=L'attribut {{0}} doit avoir au moins {{1}} et au plus {{2}} valeur(s).
```
**Simplified Chinese file gets Traditional Chinese text**
totpStep1 in messages_zh_CN was replaced with Traditional Chinese (zh_TW) text ('您的手機上安裝以下應用程式之一'), copied from the wrong locale. Use the Simplified wording, e.g. 请在您的手机上安装以下应用程序之一:
```
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112 totpStep1=在您的手機上安裝以下應用程式之一:
```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
The Lithuanian account and login bundles now hold Italian text for the TOTP step, so Lithuanian users see the wrong language. This change introduced it. [grounded: diff] [consensus 3/3: valid=3]
The new zh_CN string uses Traditional Chinese characters (手機, 應用程式), while the rest of the bundle is Simplified Chinese. [grounded: diff] [consensus 3/3: valid=3]
The validator's stated job is to allow only anchors that exist in the English source, which blocks injected or changed links. It is not meant to require every anchor to appear in the translation. Leaving a link out is not a security problem, so this is a feature request rather than a defect. [invalid: contradiction] [consensus 3/5: invalid=3, valid=2]
raw comments (4)
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> **Lithuanian Text Is Italian**
This Lithuanian TOTP instruction was replaced with Italian text (`Installa una delle seguenti applicazioni...`), so Lithuanian users see the wrong language during authenticator setup. The same incorrect replacement appears in the login flow at `themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71`.
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> **Wrong Chinese Writing System**
This simplified-Chinese bundle now uses traditional characters (`您的手機上安裝…應用程式`), while the surrounding messages remain simplified Chinese. This gives `zh_CN` users an inconsistent and incorrect locale experience during TOTP setup.
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> **Missing Anchors Go Undetected**
This loop only examines anchors present in the translation, so it reports nothing when a translation omits an English anchor entirely. Action messages such as verification and password-reset emails can therefore pass validation after silently losing their clickable link. Please also check for unmatched anchors remaining in the English value and cover the omitted-anchor case with a test.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
<h3>Greptile Summary</h3>
This PR adds HTML-safety validation to the theme message verifier and repairs malformed or outdated localized message markup across account, admin, email, and login themes.
- Introduces OWASP sanitizer-based validation against English source messages.
- Adds tests for illegal HTML, changed anchors, HTML added only by translations, and duplicate keys.
- Normalizes WebAuthn line-break markup, fixes malformed email HTML, removes obsolete TOTP links, and corrects plural formatting.
- Two locale replacements contain language/locale regressions, and omitted source anchors remain undetected.
<h3>Confidence Score: 4/5</h3>
The PR appears safe to merge after non-blocking localization corrections and improved coverage for omitted anchors.
The verifier enhancement and markup repairs are generally sound, but two localized TOTP instructions regress language consistency and the new anchor check can accept translations that remove action links.
**Files Needing Attention:** themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties, themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties, themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties, misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java
<details><summary><h3>Important Files Changed</h3></summary>
| Filename | Overview |
|----------|----------|
| misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java | Adds source-aware HTML validation, but its anchor comparison does not detect anchors omitted by a translation. |
| misc/theme-verifier/src/test/java/org/keycloak/themeverifier/VerifyMessagePropertiesTest.java | Expands verifier coverage for malformed HTML and changed anchors, but lacks the omitted-anchor case. |
| misc/theme-verifier/pom.xml | Adds the HTML sanitizer and entity-unescaping dependencies used by the verifier. |
| themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties | Removes obsolete TOTP links but replaces the Lithuanian instruction with Italian text. |
| themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties | Replaces the Lithuanian login TOTP instruction with the same Italian sentence. |
| themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties | Removes obsolete TOTP links but introduces traditional-Chinese wording into the simplified-Chinese bundle. |
| themes/src/main/resources/theme/base/login/messages/messages_en.properties | Normalizes WebAuthn break tags and improves pluralized multivalue validation text. |
| themes/src/main/resources-community/theme/base/email/messages/messages_lt.properties | Repairs malformed anchor attributes in several Lithuanian HTML email templates. |
</details>
<!-- greptile_other_comments_section -->
<sub>Reviews (1): Last reviewed commit: ["Update js/apps/account-ui/maven-resource..."](https://github.com/drape-io/crbench-greptile-2026-09/commit/36a9d99c936fe2df904ece0ab1806c38e129fdf5) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284629)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✓ | exact |
The account and admin UIs use i18next with its default {{ }} interpolation, and setUserProfileServerError passes the params as keys 0/1/2. Before this change the message used {{0}}. With {0}, nothing gets substituted and the choice syntax shows up as literal text. [grounded: diff] [consensus 3/3: valid=3]
The Lithuanian bundle now contains an Italian sentence. [grounded: diff] [consensus 3/3: valid=3]
The new zh_CN value is in Traditional Chinese, while the rest of the file is Simplified. [grounded: diff] [consensus 3/3: valid=3]
The new error message leaves out the key and file, unlike the sibling 'Illegal HTML' message, so a failure can't be traced to its source. This is a diagnostic-quality problem only. [grounded: diff] [consensus 3/4: valid=3, minor=1]
This is the same issue as finding 0: i18next's default {{ }} interpolation won't substitute {0} or evaluate the choice format. [grounded: diff] [consensus 3/3: valid=3]
The Lithuanian login bundle (and the account bundle) now contain Italian text. [grounded: diff] [consensus 3/3: valid=3]
The zh_CN bundle now has a Traditional Chinese string. [grounded: diff] [consensus 3/3: valid=3]
This duplicates finding 4: the message has no key or file, so failures are hard to trace. [grounded: diff] [consensus 3/4: valid=3, minor=1]
raw comments (9)
[P2] Account and admin UIs now show raw `{0}` placeholders and choice syntax for this message
js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188 (also js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138) The account UI and admin UI translate these bundles with i18next. Both use its default `{{…}}` interpolation (js/apps/account-ui/src/i18n.ts, js/apps/admin-ui/src/i18n/i18n.ts), and `ThemeResource` serves the properties without converting placeholders. That is why every other parameterized key in these files uses `{{0}}`. Switching `error-invalid-multivalued-size` to `{0}`/`{1}`/`{2}` plus a Java `{2,choice,…}` pattern means i18next interpolates nothing. When `MultiValueValidator` fails in these UIs, users see the literal text `Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1‹values}.` instead of the attribute name and limits.
[P2] Lithuanian account bundle's totpStep1 was replaced with Italian text
themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101 The Lithuanian `totpStep1` was replaced with `Installa una delle seguenti applicazioni sul tuo cellulare:`, which is Italian. Lithuanian users of the account console will see an Italian sentence on the TOTP setup step. The value should be a Lithuanian translation, or the key should be removed so it falls back to English.
[P3] Simplified Chinese account bundle's totpStep1 was replaced with Traditional Chinese
themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties:112 The new `zh_CN` value `在您的手機上安裝以下應用程式之一:` uses Traditional characters and Taiwan vocabulary (手機, 應用程式); it looks copied from the zh_TW bundle. The rest of the zh_CN file is Simplified Chinese, so users of that locale get a mixed-script page. A Simplified equivalent would be something like `在您的手机上安装以下应用程序之一:`.
[P2] Error-message formatting can crash with StringIndexOutOfBoundsException
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:100-110 The `start` and `end` loops that trim the common prefix and suffix are computed independently, so they can overlap in the shorter string. In that case `sanitized.substring(start, sanitized.length() - end)` gets `begin › end` and throws. Example: a translation `‹x›‹b›c‹/b›` checked against an English string that contains HTML. The sanitizer returns `‹b›c‹/b›`, which gives `start=1` and `end=8`. The verifier then crashes the Maven build with an exception instead of reporting "Illegal HTML". This happens exactly when the check fails and an illegal tag sits next to an allowed one. Capping `end` at `min(value.length(), sanitized.length()) - start` would prevent it.
[P3] Anchor-mismatch message omits the key and file
misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java:156 `santizeAnchors` receives `key` but reports only `"Didn't find anchor tag … in original string"`. When the plugin runs over all theme and UI bundles, this message cannot be traced back to the properties file or key that failed. The "Illegal HTML" message includes both `key` and `file`; this one should too, so a failing build can be acted on.
[P1] Account/admin UI message switched from i18next placeholders to Java MessageFormat
The keycloak.v3 account bundle (and keycloak.v2 admin bundle at js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138) is consumed by i18next in the React apps. Those apps use `{{0}}` interpolation; the neighboring keys such as `error-invalid-length-too-short='{{0}}' ...` show this. `setUserProfileServerError` passes server error params as `{0: ..., 1: ..., 2: ...}` to `t()`. Once `error-invalid-multivalued-size` is changed to `{0}`/`{1}`/`{2}` with a `{2,choice,0#values|1#value|1‹values}` clause, i18next no longer substitutes the values and cannot evaluate the choice format. Any multivalued-size validation error in the account or admin console will therefore show the raw template text, braces included, and not the attribute name and limits. The MessageFormat version only works for the FreeMarker-rendered `themes/.../base/*` bundles.
[P2] Lithuanian TOTP step text replaced with an Italian sentence
`loginTotpStep1` in the Lithuanian login bundle is now "Installa una delle seguenti applicazioni sul tuo cellulare:", which is Italian. The same Italian string was also put into `totpStep1` in themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties:101. Lithuanian users setting up OTP will see Italian in the middle of an otherwise Lithuanian page. These lines replace the old Lithuanian text, which contained links, so they should be a Lithuanian translation of the English text.
[P3] zh_CN account TOTP step uses Traditional Chinese
The new `totpStep1` value "在您的手機上安裝以下應用程式之一:" is in Traditional Chinese (手機, 應用程式), but this is the Simplified Chinese (zh_CN) bundle. The login zh_CN bundle uses a Simplified wording for the same text at line 123 ("在您的移动设备中安装以下任意一个应用:"). This looks like the zh_TW string was copied into the zh_CN file by mistake.
[P3] Anchor-mismatch errors don't identify the file or key
`santizeAnchors` receives `key` but its error message is only "Didn't find anchor tag ‹a ...› in original string", with no key and no file. The plugin checks every `messages_*.properties` file across all theme resources and puts every error into one `MojoFailureException`. A failing build therefore gives no hint which translation file or key has the bad anchor. The "Illegal HTML" message in the same method includes both `key` and `file`, so this one appears to have just missed them.
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
The diff replaces the Lithuanian totpStep1 and loginTotpStep1 with Italian text. It also gives zh_CN totpStep1 Traditional Chinese characters (手機, 安裝). Users will see the wrong language. [grounded: diff] [consensus 3/3: valid=3]
The admin UI uses i18next with its default {{ }} interpolation (i18n.ts sets only escapeValue). setUserProfileServerError passes params as {0:...,1:...} to t(). Sibling keys use {{0}}, so after this change the single-brace placeholders and the choice clause are shown literally. [grounded: diff] [consensus 3/3: valid=3]
Same issue as finding 1. The i18next-rendered JS bundles use {{n}} placeholders, while MessageFormat {n} and choice syntax will not be interpolated client-side. [grounded: diff] [consensus 3/3: valid=3]
raw comments (3)
[P2] Lithuanian totpStep1 replaced with Italian text — themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties (totpStep1 line; same for loginTotpStep1 in login/messages/messages_lt.properties)
The anchor-stripping rewrite of `totpStep1` and `loginTotpStep1` in the Lithuanian files is "Installa una delle seguenti applicazioni sul tuo cellulare:", which is Italian. Lithuanian users will see Italian text in the OTP setup step in both the account and login themes. The account `messages_zh_CN.properties` has a similar problem: its new `totpStep1` uses Traditional Chinese (手機, 安裝, 應用程式) in a Simplified Chinese file.
[P2] Account-UI and admin-UI i18next messages switched from `{{n}}` to `{n}`
(also js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138) The other messages in these two JS bundles use i18next-style `{{0}}` placeholders, written quoted as `'{{0}}'` to survive MessageFormat. The edited `error-invalid-multivalued-size` now uses single-brace `{0}`, `{1}` and `{2}` plus a `{2,choice,...}` clause. i18next does not interpolate single braces and does not understand `choice`. If these bundles are rendered client-side, as the `{{n}}` convention suggests, users will see the literal text "Attribute {0} must have at least {1} ... {2,choice,...}" instead of the values. This applies to any language that falls back to these English strings. The change appears to have been made only to satisfy the new HTML verifier, since `{{0}}` made the sanitizer add `‹!-- --›`.
[P2] Account/Admin UI message switched from i18next `{{0}}` to MessageFormat syntax
These two UI bundles are rendered by i18next (the neighbouring keys such as `error-username-invalid-character='{{0}}'` and `error-invalid-length-too-short` use `{{0}}`/`{{1}}`). Rewriting `error-invalid-multivalued-size` to `{0}`/`{1}`/`{2}` plus `{2,choice,0#values|1#value|1‹values}` is not interpolated by i18next. When a multivalued attribute fails the size validation in the Account or Admin console, the user will see the literal text "Attribute {0} must have at least {1} and at most {2} {2,choice,...}". The unchanged translations in the same bundle (e.g. `messages_fr.properties` and `messages_pl.properties`) still use `{{0}}`, so the English file is now inconsistent with them. The server-side `themes/.../base/*` files can use MessageFormat, but the `js/apps/*` bundles should keep the i18next form. The same edit is in js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties:3138.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
| Defect | Severity | Found | Grade |
|---|---|---|---|
| d4 | medium | ✗ | — |
replaceAll matches the substring 'resources-community' inside 'maven-resources-community', which turns it into 'maven-resources'. That is the real English bundle directory (js/apps/admin-ui/maven-resources/.../messages_en.properties exists), so no nonexistent file is opened. [invalid: contradiction] [consensus 3/3: invalid=3]
The Lithuanian account bundle now has Italian text for totpStep1. [grounded: diff] [consensus 3/3: valid=3]
Both UIs use i18next with its default {{ }} interpolation, and the sibling admin-ui error keys all use {{0}}. The change from {{0}} to {0} plus a Java choice expression means the placeholders and choice syntax render as raw text. [grounded: diff] [consensus 3/3: valid=3]
The Lithuanian login bundle now has an Italian sentence for loginTotpStep1. [grounded: diff] [consensus 3/3: valid=3]
The zh_CN bundle gets a Traditional Chinese string, while the neighbouring lines use Simplified characters (e.g. 打开应用). [grounded: diff] [consensus 3/3: valid=3]
For the linkExpirationFormatter and error-invalid-multivalued-size keys, whole choice expressions are replaced with '...' before sanitizing. Any markup inside a choice branch therefore escapes the new verifier. The gap is limited to those keys. [grounded: diff] [consensus 3/3: valid=3]
raw comments (8)
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">
1\. Web translation builds crash <code>🐞 Bug</code> <code>☼ Reliability</code>
<pre>
<b><i>verifySafeHtml</i></b> derives the English bundle path by replacing only <b><i>resources-community</i></b>, which does
not match the web applications' <b><i>maven-resources-community</i></b> directory. When either application
verifies a translated bundle, <b><i>FileInputStream</i></b> targets a nonexistent English file and the resulting
unchecked exception terminates the Maven build.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
## Issue description
The English-bundle path conversion handles `resources-community` but not the `maven-resources-community` layout used by the web applications, causing translation verification to terminate while opening a nonexistent file.
## Fix Focus Areas
- misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[73-80]
- misc/theme-verifier/src/test/java/org/keycloak/themeverifier/VerifyMessagePropertiesTest.java[36-51]
## Recommended Fix
Derive the English bundle path for both `resources-community` and `maven-resources-community`, and add tests that reproduce both directory layouts. Report an English-bundle read failure through the verifier's normal checked failure path rather than wrapping it in an unchecked exception.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">
3\. Lithuanian account setup is italian <code>🐞 Bug</code> <code>≡ Correctness</code>
<pre>
The Lithuanian account bundle’s <b><i>totpStep1</i></b> value is replaced with the Italian sentence `Installa
una delle seguenti applicazioni sul tuo cellulare`. Lithuanian users configuring an authenticator
through account management see Italian for the first instruction before the remaining Lithuanian
TOTP setup steps.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
## Issue description
The Lithuanian account authenticator setup instruction contains an Italian translation, producing a mixed-language TOTP setup flow.
## Fix Focus Areas
- themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties[101-103]
## Recommended Fix
Replace the Italian `totpStep1` sentence with the approved, accurate Lithuanian translation of the updated English instruction to install one of the listed authenticator applications, while preserving the intentionally removed application links.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">
2\. Account users see unexpanded validation errors <code>🐞 Bug</code> <code>≡ Correctness</code>
<pre>
The account and admin UI English <b><i>error-invalid-multivalued-size</i></b> messages use Java <b><i>{0}</i></b>
placeholders and a <b><i>{2,choice,...}</i></b> expression even though both UIs pass server validation
parameters to i18next using numeric names. When a multi-valued profile attribute violates its
bounds, account settings and the administration console display the attribute name, limits, and
pluralization expression as raw formatting syntax.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
## Issue description
The account and admin UIs render this validation key with i18next, not Java `MessageFormat`, so `{0}` and `{2,choice,...}` remain literal text.
## Fix Focus Areas
- js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties[188-188]
- js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties[3138-3138]
## Recommended Fix
Restore i18next placeholder syntax (`{{0}}`, `{{1}}`, and `{{2}}`) in both English message bundles and remove the Java choice expression. Use non-pluralized wording such as `value(s)`, or implement pluralization through i18next-compatible plural keys and a count argument.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">
4\. Lithuanian login setup shows italian <code>🐞 Bug</code> <code>≡ Correctness</code>
<pre>
The Lithuanian login bundle sets <b><i>loginTotpStep1</i></b> to the Italian sentence `Installa una delle
seguenti applicazioni sul tuo cellulare:` between otherwise Lithuanian setup instructions. The login
TOTP template renders this key directly during sign-in authenticator enrollment, so Lithuanian users
encounter the mixed-language instruction while configuring an authenticator.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
## Issue description
The Lithuanian login-time authenticator setup instruction contains Italian text, creating a mixed-language enrollment flow.
## Fix Focus Areas
- themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties[71-73]
## Recommended Fix
Replace `loginTotpStep1` with the approved, accurate Lithuanian translation of the updated English instruction to install one of the listed authenticator applications, while preserving the intentionally removed application links.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">
5\. Simplified chinese setup mixes scripts <code>🐞 Bug</code> <code>≡ Correctness</code>
<pre>
The <b><i>zh_CN</i></b> account bundle’s <b><i>totpStep1</i></b> value uses Traditional Chinese forms such as <b><i>手機</i></b>, <b><i>安裝</i></b>,
and <b><i>應用程式</i></b>. Users selecting the mainland Chinese locale see this text beside Simplified Chinese
instructions such as <b><i>手机</i></b>, <b><i>打开</i></b>, and <b><i>输入</i></b>, so the first setup step does not match the rest of the
flow.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
## Issue description
The Simplified Chinese account authenticator instruction uses Traditional Chinese characters, making the TOTP setup flow inconsistent with the selected locale.
## Fix Focus Areas
- themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties[112-114]
## Recommended Fix
Replace the instruction with the approved Simplified Chinese translation, using wording consistent with the corresponding `zh_CN` login bundle and neighboring account messages. Keep Traditional Chinese wording in the separate `zh_TW` bundle.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">
6\. Pluralized markup bypasses theme checks <code>🐞 Bug</code> <code>⛨ Security</code>
<pre>
<b><i>normalizeValue</i></b> replaces every choice-format expression with <b><i>...</i></b> before <b><i>verifySafeHtml</i></b> selects
and applies its HTML policy. Any disallowed tag or altered anchor inside a translated plural branch
is removed from both the comparison input and sanitizer input, so the new verifier reports no
violation for that branch.
</pre>
<details>
<summary><strong>Agent Prompt</strong></summary>
```
Issue description
Choice-format contents are discarded before HTML and anchor validation, allowing unsafe markup in a plural branch to pass the theme verifier.
Fix Focus Areas
- misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[124-126]
Recommended Fix
Parse choice-format branches and validate each branch's text and markup instead of replacing the entire expression. Preserve or safely neutralize only the comparison operators required by choice syntax, while retaining any HTML for the sanitizer and anchor checks.
```
<code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
</details>
<h3>PR Summary by Qodo</h3>
Validate localized theme messages for unsafe HTML
<code>✨ Enhancement</code> <code>🐞 Bug fix</code> <code>🧪 Tests</code> <code>🕐 40+ Minutes</code>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<details>
<summary>AI Description</summary>
<dl>
<dd>
<br/>
><pre>
>• Adds English-aware HTML safety validation for localized theme message bundles.
>• Restricts translated markup and anchors to patterns permitted by English source messages.
>• Repairs existing bundles and tests unsafe tags, changed anchors, and duplicate keys.
></pre>
</dd>
</dl>
</details>
<details>
<summary>Diagram</summary>
<dl>
<dd>
<br/>
```mermaid
graph TD
A["Message Bundle"] --> B["Load English"] --> C["Normalize Values"] --> D["Check Anchors"] --> E{"English HTML"}
E -->|Allowed subset| F["Sanitize HTML"] --> G["Report Violations"]
E -->|No HTML| F
```
</dd>
</dl>
</details>
<details>
<summary>High-Level Assessment</summary>
<dl>
<dd>
<br/>
>The following are alternative approaches to this PR:
<details>
<summary><b>1. Custom markup parser</b></summary>
<dl>
<dd>
- ➕ Could preserve exact message formatting without sanitizer-specific normalization.
- ➕ Would avoid introducing another runtime dependency.
- ➖ Reimplementing HTML parsing and allowlisting is security-sensitive.
- ➖ Regex or ad hoc parsing would handle malformed markup less reliably.
</dd>
</dl>
</details>
<details>
<summary><b>2. Explicit per-key markup schema</b></summary>
<dl>
<dd>
- ➕ Would make allowed elements and anchors independent of English message content.
- ➕ Could provide clearer contracts for translators and tooling.
- ➖ Requires maintaining metadata for every message containing markup.
- ➖ Creates synchronization overhead whenever English templates change.
</dd>
</dl>
</details>
>**Recommendation:** Keep the OWASP sanitizer and English-baseline approach. It reuses a security-focused parser and prevents translations from introducing markup absent from the source; an explicit schema would be clearer long-term but is substantially more expensive to maintain. The key-specific normalization exceptions should remain narrowly scoped and covered by tests.
</dd>
</dl>
</details>
<details>
<summary> Files changed (48) <code> +343 / -105 </code> </summary>
<dl>
<dd>
<br/>
<details>
<summary>Enhancement (1) <code> +124 / -0 </code></summary>
<dl>
<dd>
<details>
<summary>VerifyMessageProperties.java<code>Validate localized messages against safe HTML policies</code> <code>+124/-0</code></summary>
<br/>
>Validate localized messages against safe HTML policies
>
><pre>
>• Loads each bundle and its English baseline, normalizes known non-HTML syntax, checks anchor parity, and sanitizes values with restricted policies. Reports focused differences when translated markup is unsafe or unsupported.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c9b90df19d737df4f7062b741b1d0f7e01d2afe3bed28afd6792012a3a412b18'>misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java</a>
</details>
</dd>
</dl>
</details>
<details>
<summary>Bug fix (39) <code> +103 / -103 </code></summary>
<dl>
<dd>
<details>
<summary>messages_en.properties<code>Correct multivalued attribute pluralization</code> <code>+1/-1</code></summary>
<br/>
>Correct multivalued attribute pluralization
>
><pre>
>• Replaces escaped placeholders with valid MessageFormat arguments and selects singular or plural wording from the maximum value.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-f8cdef1dece253e24f7d47897599c455d45793f8495ccd880d416b396af90fd7'>js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties</a>
</details>
<details>
<summary>messages_zh_CN.properties<code>Correct placeholder-like markup in Chinese help text</code> <code>+1/-1</code></summary>
<br/>
>Correct placeholder-like markup in Chinese help text
>
><pre>
>• Removes an unintended space from the documented 'CLAIM.<NAME>' placeholder so it can be normalized consistently.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-fe4194ea3ae1c56ea4ea6bf3f66ac41c6d288fe3311d52a11265904ecf6e3ea1'>js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_zh_CN.properties</a>
</details>
<details>
<summary>messages_en.properties<code>Correct admin multivalue validation message</code> <code>+1/-1</code></summary>
<br/>
>Correct admin multivalue validation message
>
><pre>
>• Uses valid MessageFormat placeholders and choice-based singular or plural wording.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c9ef637a710ad2a1ec0f86584796ce5fff7fa0c7a8702bcd020b29eef4e5af43'>js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties</a>
</details>
<details>
<summary>messages_fi.properties<code>Remove legacy links from Finnish OTP guidance</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Finnish OTP guidance
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-5d111abec981e7a4f4c9c4d57b66e4232d284063b3e0e98fc2074c7ab1014665'>themes/src/main/resources-community/theme/base/account/messages/messages_fi.properties</a>
</details>
<details>
<summary>messages_lt.properties<code>Remove legacy links from Lithuanian OTP guidance</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Lithuanian OTP guidance
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text mobile installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-d21e36be618f1d2e13d4033b8d287637a4b040da9b7ba41d36167e79ac94d346'>themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties</a>
</details>
<details>
<summary>messages_sk.properties<code>Remove legacy links from Slovak OTP guidance</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Slovak OTP guidance
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-7f4df8eb0a2e64f04f43ba88a4fcbf8aed1eef4800911b0cd9757ffbbebacfb9'>themes/src/main/resources-community/theme/base/account/messages/messages_sk.properties</a>
</details>
<details>
<summary>messages_sv.properties<code>Remove legacy links from Swedish OTP guidance</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Swedish OTP guidance
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-66ebe0fdb03165aaed571a2e64fa11323a482fab666b5d33bb68780fcb6aafa8'>themes/src/main/resources-community/theme/base/account/messages/messages_sv.properties</a>
</details>
<details>
<summary>messages_zh_CN.properties<code>Remove legacy links from Chinese OTP guidance</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Chinese OTP guidance
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-123e2feb586c4c469cc56c84250b25075d844bb46447745eec72893837ea22ca'>themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties</a>
</details>
<details>
<summary>messages_da.properties<code>Close Danish email paragraph markup</code> <code>+1/-1</code></summary>
<br/>
>Close Danish email paragraph markup
>
><pre>
>• Adds the missing closing paragraph tag to the identity-provider linking email.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-656a30f087f620c32f5790e67018a4102ad57ac2545aa21d22f72860cd6a00b3'>themes/src/main/resources-community/theme/base/email/messages/messages_da.properties</a>
</details>
<details>
<summary>messages_fa.properties<code>Correct malformed Persian paragraph tag</code> <code>+1/-1</code></summary>
<br/>
>Correct malformed Persian paragraph tag
>
><pre>
>• Removes an invalid space from an opening paragraph tag in the email update confirmation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-6090f825448e1818290f4f682b27ede81ce8cd45c8723c0f3d8974141d9d3e2f'>themes/src/main/resources-community/theme/base/email/messages/messages_fa.properties</a>
</details>
<details>
<summary>messages_hu.properties<code>Restore Hungarian email message key</code> <code>+1/-1</code></summary>
<br/>
>Restore Hungarian email message key
>
><pre>
>• Removes an accidental prefix from the HTML email update confirmation key so the bundle exposes the expected message.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-6a2e660b71cf35bcf1b24e098de56c30611c903472e1bceb13c73a75f37a5a69'>themes/src/main/resources-community/theme/base/email/messages/messages_hu.properties</a>
</details>
<details>
<summary>messages_lt.properties<code>Repair Lithuanian email anchor attributes</code> <code>+4/-4</code></summary>
<br/>
>Repair Lithuanian email anchor attributes
>
><pre>
>• Corrects malformed 'href' attributes in verification, identity linking, password reset, and required-action emails.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-89907e22aef1d3d14820f8175925746aedaeac9468dab706915d03d1a153231b'>themes/src/main/resources-community/theme/base/email/messages/messages_lt.properties</a>
</details>
<details>
<summary>messages_nl.properties<code>Repair Dutch email paragraph boundary</code> <code>+1/-1</code></summary>
<br/>
>Repair Dutch email paragraph boundary
>
><pre>
>• Corrects malformed closing and opening paragraph tags in the verification email.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-367179db7139c49e685edf1d9a22c04406d7dcaea9d8430f1d365c941b9397bb'>themes/src/main/resources-community/theme/base/email/messages/messages_nl.properties</a>
</details>
<details>
<summary>messages_no.properties<code>Remove HTML from Norwegian plain-text email</code> <code>+1/-1</code></summary>
<br/>
>Remove HTML from Norwegian plain-text email
>
><pre>
>• Removes bold tags from the plain-text identity-provider linking message while retaining markup in its HTML counterpart.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-7532f5fe8c19623b0c91d5b22b7b51f42231eabaa9f9537f619a7ad290de4b84'>themes/src/main/resources-community/theme/base/email/messages/messages_no.properties</a>
</details>
<details>
<summary>messages_tr.properties<code>Correct Turkish bold closing tags</code> <code>+1/-1</code></summary>
<br/>
>Correct Turkish bold closing tags
>
><pre>
>• Repairs malformed closing 'b' tags in the identity-provider linking email.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-5406b1be06aec1ac333aa50b109e76302d7aae0bb451e224e0d7e88ffa505c0f'>themes/src/main/resources-community/theme/base/email/messages/messages_tr.properties</a>
</details>
<details>
<summary>messages_uk.properties<code>Correct Ukrainian paragraph spacing</code> <code>+1/-1</code></summary>
<br/>
>Correct Ukrainian paragraph spacing
>
><pre>
>• Removes invalid whitespace from paragraph boundaries in the email update confirmation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-b1bcb141796db5ac7219003dedc6b067e6258c980fb1176f3a71382950a82691'>themes/src/main/resources-community/theme/base/email/messages/messages_uk.properties</a>
</details>
<details>
<summary>messages_ar.properties<code>Normalize Arabic WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Arabic WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-e96d6df7fcb69c31350a07d6cf1f6d5ff6c3cdeee6149567ae619b5f679cabec'>themes/src/main/resources-community/theme/base/login/messages/messages_ar.properties</a>
</details>
<details>
<summary>messages_ca.properties<code>Normalize Catalan WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Catalan WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-052ff36c44e96f763c0a7eb2279911c17f508ec59e558d849a530390985112e0'>themes/src/main/resources-community/theme/base/login/messages/messages_ca.properties</a>
</details>
<details>
<summary>messages_cs.properties<code>Normalize Czech WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Czech WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-8e35817f43e92bbad8649e08585764ef45362b1c730785b705a849653438bfd4'>themes/src/main/resources-community/theme/base/login/messages/messages_cs.properties</a>
</details>
<details>
<summary>messages_de.properties<code>Normalize German WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize German WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-acb3c26f89ea58820743142a1160c75364bdb9fec8620bc0dc5b13b2e8229e51'>themes/src/main/resources-community/theme/base/login/messages/messages_de.properties</a>
</details>
<details>
<summary>messages_el.properties<code>Normalize Greek WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Greek WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-54b8fdae4229f7ffec8e1d3d5cf61d45d87e7285232799d01d0225b10fcf0bb2'>themes/src/main/resources-community/theme/base/login/messages/messages_el.properties</a>
</details>
<details>
<summary>messages_es.properties<code>Normalize Spanish WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Spanish WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c7d7ef5ee38117fa4f8dc710ecd2ed8f1ec4e6fe9ab77ef42d19aacfbcd43841'>themes/src/main/resources-community/theme/base/login/messages/messages_es.properties</a>
</details>
<details>
<summary>messages_fa.properties<code>Normalize Persian WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Persian WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-f9248ffc8e81559d82d987347275dd6512be4c120a3d03f72d86451bc100115b'>themes/src/main/resources-community/theme/base/login/messages/messages_fa.properties</a>
</details>
<details>
<summary>messages_fi.properties<code>Normalize Finnish WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Finnish WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-d39d440417b101bc37fd1a3c40f9e99a7e3350ed4a0b51e19a9a062e4ea2d397'>themes/src/main/resources-community/theme/base/login/messages/messages_fi.properties</a>
</details>
<details>
<summary>messages_fr.properties<code>Normalize French WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize French WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-ada1823907d5e89cf9992ecc37dc981d45001d45938fa30b1476590e3a446648'>themes/src/main/resources-community/theme/base/login/messages/messages_fr.properties</a>
</details>
<details>
<summary>messages_hr.properties<code>Normalize Croatian WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Croatian WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-cacb1321e290090e922469db5ceb11973c70487a3f1cd7b65d41f2b680efa55a'>themes/src/main/resources-community/theme/base/login/messages/messages_hr.properties</a>
</details>
<details>
<summary>messages_ka.properties<code>Normalize Georgian WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Georgian WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn registration and authentication errors on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-9cdea9b23b19eb886a753489bf4767b036df1dd132a34139a42df887a9df1474'>themes/src/main/resources-community/theme/base/login/messages/messages_ka.properties</a>
</details>
<details>
<summary>messages_ko.properties<code>Normalize Korean WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Korean WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-306ff5799374f7c7578d7d7afce428904edff8e806c37f79c7b5f4431b22eae5'>themes/src/main/resources-community/theme/base/login/messages/messages_ko.properties</a>
</details>
<details>
<summary>messages_lt.properties<code>Remove legacy links from Lithuanian OTP setup</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Lithuanian OTP setup
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text mobile installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-af0284cbfac053a1ac93aa5b0a5e36d9d1130db39849c5298ad9c94df0c68805'>themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties</a>
</details>
<details>
<summary>messages_no.properties<code>Remove legacy links from Norwegian OTP setup</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Norwegian OTP setup
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-7acb64995124b26340dee331f4f7ebf465e70941b51cc0b8219d0ce114eb967f'>themes/src/main/resources-community/theme/base/login/messages/messages_no.properties</a>
</details>
<details>
<summary>messages_sk.properties<code>Repair Slovak login message markup and plurals</code> <code>+7/-7</code></summary>
<br/>
>Repair Slovak login message markup and plurals
>
><pre>
>• Removes an unmatched 'strong' tag, replaces linked OTP guidance, and uses the maximum argument for maximum-value pluralization. Also normalizes WebAuthn line breaks.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-957569314a6f698853f46a9037f1bd8c6886919599ecd165d1cb04d6da1ec48c'>themes/src/main/resources-community/theme/base/login/messages/messages_sk.properties</a>
</details>
<details>
<summary>messages_sv.properties<code>Remove legacy links from Swedish OTP setup</code> <code>+1/-1</code></summary>
<br/>
>Remove legacy links from Swedish OTP setup
>
><pre>
>• Replaces linked authenticator application guidance with a plain-text installation instruction.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-ca45d166d609b3d0f6343a42b8ee381a40964fbdd19a47704f898f6b51cdf639'>themes/src/main/resources-community/theme/base/login/messages/messages_sv.properties</a>
</details>
<details>
<summary>messages_th.properties<code>Normalize Thai WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Thai WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-36a2672e8731c63926d1078ae12769c1042b82916f058d8653a9ffcd3c2fdd48'>themes/src/main/resources-community/theme/base/login/messages/messages_th.properties</a>
</details>
<details>
<summary>messages_tr.properties<code>Normalize Turkish WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Turkish WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-dbf0e4e56bc498fbee4640cb6e0f2e7fa0e45f23adc0a5f7a0e89a284f15e9b5'>themes/src/main/resources-community/theme/base/login/messages/messages_tr.properties</a>
</details>
<details>
<summary>messages_uk.properties<code>Normalize Ukrainian WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Ukrainian WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-fd06b52ec7f6e3fa65e2da474a62723727fa0dc67f7bed2dda50bc0f9ae3cd0c'>themes/src/main/resources-community/theme/base/login/messages/messages_uk.properties</a>
</details>
<details>
<summary>messages_zh_CN.properties<code>Normalize Simplified Chinese WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Simplified Chinese WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-308bba049155ed0bf6a107230ec69e29af0c88f31f6523b6ddc7a4187ef71710'>themes/src/main/resources-community/theme/base/login/messages/messages_zh_CN.properties</a>
</details>
<details>
<summary>messages_zh_TW.properties<code>Normalize Traditional Chinese WebAuthn line breaks</code> <code>+4/-4</code></summary>
<br/>
>Normalize Traditional Chinese WebAuthn line breaks
>
><pre>
>• Standardizes WebAuthn error messages on sanitizer-compatible self-closing 'br' tags.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-76ac3e0d02bff5462fbaad4558162fc7f2869f645e0f784cf144cd8c995f8625'>themes/src/main/resources-community/theme/base/login/messages/messages_zh_TW.properties</a>
</details>
<details>
<summary>messages_en.properties<code>Add singular-aware admin validation wording</code> <code>+1/-1</code></summary>
<br/>
>Add singular-aware admin validation wording
>
><pre>
>• Uses a MessageFormat choice expression to select singular or plural wording from the maximum value.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-2829b6a223ad7a9fe5992661834596674056886072a261a15835bf3da8fbf500'>themes/src/main/resources/theme/base/admin/messages/messages_en.properties</a>
</details>
<details>
<summary>messages_en.properties<code>Normalize English login markup and plurals</code> <code>+5/-5</code></summary>
<br/>
>Normalize English login markup and plurals
>
><pre>
>• Standardizes WebAuthn line breaks and adds singular-aware wording to the multivalued attribute validation message.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-afced02b5b1f317ea4df72b8894afcad523ef311cfadb543e40c86cc76a520d3'>themes/src/main/resources/theme/base/login/messages/messages_en.properties</a>
</details>
</dd>
</dl>
</details>
<details>
<summary>Tests (7) <code> +105 / -2 </code></summary>
<dl>
<dd>
<details>
<summary>VerifyMessagePropertiesTest.java<code>Cover unsafe HTML and anchor validation</code> <code>+20/-2</code></summary>
<br/>
>Cover unsafe HTML and anchor validation
>
><pre>
>• Adds tests for illegal tags, HTML introduced only by translations, and changed anchor targets. Updates duplicate-key coverage for the renamed fixture and multiple possible findings.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-26b20cdb5bbdafcb18b0fa67eabaf9abe9681979989c300b911d70889ca6f024'>misc/theme-verifier/src/test/java/org/keycloak/themeverifier/VerifyMessagePropertiesTest.java</a>
</details>
<details>
<summary>changedAnchor_de.properties<code>Add changed-anchor translation fixture</code> <code>+17/-0</code></summary>
<br/>
>Add changed-anchor translation fixture
>
><pre>
>• Provides a localized message whose anchor target differs from the English source.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-f4aced084950a6de0b7a79c46d77959c60f98ec7192621a27d16243626932eb9'>misc/theme-verifier/src/test/resources/changedAnchor_de.properties</a>
</details>
<details>
<summary>changedAnchor_en.properties<code>Add anchor baseline fixture</code> <code>+17/-0</code></summary>
<br/>
>Add anchor baseline fixture
>
><pre>
>• Provides the English anchor expected by the changed-anchor validation test.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-e5bec03dbe141c4b1be413db41e9699520266d483987054e24597e80297a8ab0'>misc/theme-verifier/src/test/resources/changedAnchor_en.properties</a>
</details>
<details>
<summary>duplicateKeys_en.properties<code>Rename duplicate-key fixture for English lookup</code> <code>+0/-0</code></summary>
<br/>
>Rename duplicate-key fixture for English lookup
>
><pre>
>• Makes the existing duplicate-key fixture follow the '_en.properties' convention required by English-baseline loading.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-7682a3a5af8be4d67d6e196766a4e611e7bab6cca838000bcf237f94adefc1b7'>misc/theme-verifier/src/test/resources/duplicateKeys_en.properties</a>
</details>
<details>
<summary>illegalHtmlTag_en.properties<code>Add illegal HTML fixture</code> <code>+17/-0</code></summary>
<br/>
>Add illegal HTML fixture
>
><pre>
>• Provides malformed and unsupported 'div' markup for sanitizer validation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c3c08c3223aa8248de69c6e96d380f5c37a1f1c8374962c2e5bcab532fe4cf85'>misc/theme-verifier/src/test/resources/illegalHtmlTag_en.properties</a>
</details>
<details>
<summary>noHtml_de.properties<code>Add unexpected translated HTML fixture</code> <code>+17/-0</code></summary>
<br/>
>Add unexpected translated HTML fixture
>
><pre>
>• Introduces bold markup in a translation whose English source contains no HTML.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-a882ff781cee5ddb42de307d7345fa908893d79da498fcb181a250d93e39d939'>misc/theme-verifier/src/test/resources/noHtml_de.properties</a>
</details>
<details>
<summary>noHtml_en.properties<code>Add plain-text English fixture</code> <code>+17/-0</code></summary>
<br/>
>Add plain-text English fixture
>
><pre>
>• Provides the no-HTML baseline used to reject markup introduced by a translation.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-958fa9c891ec0b314edf987b7090d083f1a84124e274e08089fdc1de92815b14'>misc/theme-verifier/src/test/resources/noHtml_en.properties</a>
</details>
</dd>
</dl>
</details>
<details>
<summary>Other (1) <code> +11 / -0 </code></summary>
<dl>
<dd>
<details>
<summary>pom.xml<code>Add HTML sanitization dependencies</code> <code>+11/-0</code></summary>
<br/>
>Add HTML sanitization dependencies
>
><pre>
>• Adds OWASP Java HTML Sanitizer and Apache Commons Text for policy enforcement and HTML entity normalization.
></pre>
>
><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-a476847da175a6f8e926b3a8354fba783a804b7b36f9193f1c84d642da69c531'>misc/theme-verifier/pom.xml</a>
</details>
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<h3>Code Review by Qodo</h3>
<code>🐞 Bugs (6)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<br/>
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required">
<details>
<summary> 1. Web translation builds crash <code>🐞 Bug</code> <code>☼ Reliability</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
><b><i>verifySafeHtml</i></b> derives the English bundle path by replacing only <b><i>resources-community</i></b>, which does
>not match the web applications' <b><i>maven-resources-community</i></b> directory. When either application
>verifies a translated bundle, <b><i>FileInputStream</i></b> targets a nonexistent English file and the resulting
>unchecked exception terminates the Maven build.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[R74-76]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c9b90df19d737df4f7062b741b1d0f7e01d2afe3bed28afd6792012a3a412b18R74-R76)</code>
>
>```diff
>+ String englishFile = file.getAbsolutePath().replaceAll("resources-community", "resources")
>+ .replaceAll("_[a-zA-Z-_]*\\.properties", "_en.properties");
>+ try (FileInputStream fis = new FileInputStream(englishFile)) {
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The web applications place localized bundles under <b><i>maven-resources-community</i></b> but English bundles
>under <b><i>maven-resources</i></b>; the added replacement therefore leaves localized paths unchanged before
>attempting to open the English file. The verifier is inherited by these applications, and the new
>read failure is converted to a <b><i>RuntimeException</i></b> that the existing <b><i>verify()</i></b> catch does not
>handle.
></pre>
>
> <code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[48-54]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java/#L48-L54)</code>
> <code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[73-80]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java/#L73-L80)</code>
> <code>[js/apps/account-ui/pom.xml[19-33]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/account-ui/pom.xml/#L19-L33)</code>
> <code>[js/apps/account-ui/pom.xml[69-74]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/account-ui/pom.xml/#L69-L74)</code>
> <code>[js/apps/admin-ui/pom.xml[19-33]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/admin-ui/pom.xml/#L19-L33)</code>
> <code>[js/apps/admin-ui/pom.xml[69-74]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/admin-ui/pom.xml/#L69-L74)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>## Issue description
>The English-bundle path conversion handles `resources-community` but not the `maven-resources-community` layout used by the web applications, causing translation verification to terminate while opening a nonexistent file.
>
>## Fix Focus Areas
>- misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[73-80]
>- misc/theme-verifier/src/test/java/org/keycloak/themeverifier/VerifyMessagePropertiesTest.java[36-51]
>
>## Recommended Fix
>Derive the English bundle path for both `resources-community` and `maven-resources-community`, and add tests that reproduce both directory layouts. Report an English-bundle read failure through the verifier's normal checked failure path rather than wrapping it in an unchecked exception.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
<details>
<summary> 2. Account users see unexpanded validation errors <code>🐞 Bug</code> <code>≡ Correctness</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
>The account and admin UI English <b><i>error-invalid-multivalued-size</i></b> messages use Java <b><i>{0}</i></b>
>placeholders and a <b><i>{2,choice,...}</i></b> expression even though both UIs pass server validation
>parameters to i18next using numeric names. When a multi-valued profile attribute violates its
>bounds, account settings and the administration console display the attribute name, limits, and
>pluralization expression as raw formatting syntax.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties[188]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-f8cdef1dece253e24f7d47897599c455d45793f8495ccd880d416b396af90fd7R188-R188)</code>
>
>```diff
>+error-invalid-multivalued-size=Attribute {0} must have at least {1} and at most {2} {2,choice,0#values|1#value|1<values}.
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The validator emits this key with minimum and maximum parameters, which the account endpoint and
>admin REST resource serialize to their respective UIs; both shared profile-error handlers then
>invoke i18next with those parameters. Neither UI's i18n configuration includes Java MessageFormat
>processing, and existing account and admin translations consistently use i18next double-brace
>placeholders, showing that the Java placeholders and choice expression cannot be interpreted.
></pre>
>
> <code>[services/src/main/java/org/keycloak/userprofile/validator/MultiValueValidator.java[45-48]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/services/src/main/java/org/keycloak/userprofile/validator/MultiValueValidator.java/#L45-L48)</code>
> <code>[services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java[161-200]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java/#L161-L200)</code>
> <code>[js/libs/ui-shared/src/user-profile/utils.ts[64-88]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/libs/ui-shared/src/user-profile/utils.ts/#L64-L88)</code>
> <code>[js/apps/account-ui/src/i18n.ts[25-43]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/account-ui/src/i18n.ts/#L25-L43)</code>
> <code>[js/apps/account-ui/maven-resources-community/theme/keycloak.v3/account/messages/messages_ca.properties[218-218]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/account-ui/maven-resources-community/theme/keycloak.v3/account/messages/messages_ca.properties/#L218-L218)</code>
> <code>[services/src/main/java/org/keycloak/services/resources/admin/UserResource.java[210-217]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/services/src/main/java/org/keycloak/services/resources/admin/UserResource.java/#L210-L217)</code>
> <code>[services/src/main/java/org/keycloak/services/resources/admin/UserResource.java[260-275]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/services/src/main/java/org/keycloak/services/resources/admin/UserResource.java/#L260-L275)</code>
> <code>[js/apps/admin-ui/src/i18n/i18n.ts[13-34]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/admin-ui/src/i18n/i18n.ts/#L13-L34)</code>
> <code>[js/apps/admin-ui/src/user/EditUser.tsx[181-220]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/js/apps/admin-ui/src/user/EditUser.tsx/#L181-L220)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>## Issue description
>The account and admin UIs render this validation key with i18next, not Java `MessageFormat`, so `{0}` and `{2,choice,...}` remain literal text.
>
>## Fix Focus Areas
>- js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties[188-188]
>- js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties[3138-3138]
>
>## Recommended Fix
>Restore i18next placeholder syntax (`{{0}}`, `{{1}}`, and `{{2}}`) in both English message bundles and remove the Java choice expression. Use non-pluralized wording such as `value(s)`, or implement pluralization through i18next-compatible plural keys and a count argument.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
<br/>
<img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">
<details>
<summary> 3. Lithuanian account setup is Italian <code>🐞 Bug</code> <code>≡ Correctness</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
>The Lithuanian account bundle’s <b><i>totpStep1</i></b> value is replaced with the Italian sentence `Installa
>una delle seguenti applicazioni sul tuo cellulare`. Lithuanian users configuring an authenticator
>through account management see Italian for the first instruction before the remaining Lithuanian
>TOTP setup steps.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties[101]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-d21e36be618f1d2e13d4033b8d287637a4b040da9b7ba41d36167e79ac94d346R101-R101)</code>
>
>```diff
>+totpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The <b><i>totpStep1</i></b> value is Italian, while the immediately following instructions in the same
>Lithuanian bundle are Lithuanian; the English source identifies this key as the first authenticator
>installation step, and the identical sentence appears under the same key in the Italian account
>bundle.
></pre>
>
> <code>[themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties[101-103]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties/#L101-L103)</code>
> <code>[themes/src/main/resources/theme/base/account/messages/messages_en.properties[150-152]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources/theme/base/account/messages/messages_en.properties/#L150-L152)</code>
> <code>[themes/src/main/resources-community/theme/base/account/messages/messages_it.properties[138-138]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/account/messages/messages_it.properties/#L138-L138)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>## Issue description
>The Lithuanian account authenticator setup instruction contains an Italian translation, producing a mixed-language TOTP setup flow.
>
>## Fix Focus Areas
>- themes/src/main/resources-community/theme/base/account/messages/messages_lt.properties[101-103]
>
>## Recommended Fix
>Replace the Italian `totpStep1` sentence with the approved, accurate Lithuanian translation of the updated English instruction to install one of the listed authenticator applications, while preserving the intentionally removed application links.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
<details>
<summary> 4. Lithuanian login setup shows Italian <code>🐞 Bug</code> <code>≡ Correctness</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
>The Lithuanian login bundle sets <b><i>loginTotpStep1</i></b> to the Italian sentence `Installa una delle
>seguenti applicazioni sul tuo cellulare:` between otherwise Lithuanian setup instructions. The login
>TOTP template renders this key directly during sign-in authenticator enrollment, so Lithuanian users
>encounter the mixed-language instruction while configuring an authenticator.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties[71]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-af0284cbfac053a1ac93aa5b0a5e36d9d1130db39849c5298ad9c94df0c68805R71-R71)</code>
>
>```diff
>+loginTotpStep1=Installa una delle seguenti applicazioni sul tuo cellulare:
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The <b><i>loginTotpStep1</i></b> value is Italian and exactly matches the Italian login bundle’s translation,
>while the adjacent second and third login-TOTP steps are Lithuanian. The login configuration
>template renders this key directly in the authenticator enrollment flow, proving that the Italian
>text is displayed to Lithuanian users.
></pre>
>
> <code>[themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties[71-74]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties/#L71-L74)</code>
> <code>[themes/src/main/resources-community/theme/base/login/messages/messages_it.properties[92-92]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/login/messages/messages_it.properties/#L92-L92)</code>
> <code>[themes/src/main/resources/theme/base/login/login-config-totp.ftl[10-10]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources/theme/base/login/login-config-totp.ftl/#L10-L10)</code>
> <code>[themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties[71-73]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties/#L71-L73)</code>
> <code>[themes/src/main/resources/theme/base/login/login-config-totp.ftl[8-14]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources/theme/base/login/login-config-totp.ftl/#L8-L14)</code>
> <code>[themes/src/main/resources/theme/base/login/messages/messages_en.properties[127-130]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources/theme/base/login/messages/messages_en.properties/#L127-L130)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>## Issue description
>The Lithuanian login-time authenticator setup instruction contains Italian text, creating a mixed-language enrollment flow.
>
>## Fix Focus Areas
>- themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties[71-73]
>
>## Recommended Fix
>Replace `loginTotpStep1` with the approved, accurate Lithuanian translation of the updated English instruction to install one of the listed authenticator applications, while preserving the intentionally removed application links.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
<details>
<summary> 5. Simplified Chinese setup mixes scripts <code>🐞 Bug</code> <code>≡ Correctness</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
>The <b><i>zh_CN</i></b> account bundle’s <b><i>totpStep1</i></b> value uses Traditional Chinese forms such as <b><i>手機</i></b>, <b><i>安裝</i></b>,
>and <b><i>應用程式</i></b>. Users selecting the mainland Chinese locale see this text beside Simplified Chinese
>instructions such as <b><i>手机</i></b>, <b><i>打开</i></b>, and <b><i>输入</i></b>, so the first setup step does not match the rest of the
>flow.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties[112]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-123e2feb586c4c469cc56c84250b25075d844bb46447745eec72893837ea22caR112-R112)</code>
>
>```diff
>+totpStep1=在您的手機上安裝以下應用程式之一:
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The changed <b><i>totpStep1</i></b> value contains recognizably Traditional Chinese glyphs, while the
>neighboring <b><i>zh_CN</i></b> setup messages use Simplified Chinese and the corresponding <b><i>zh_CN</i></b> login
>instruction provides established Simplified Chinese wording; the repository also maintains a
>separate <b><i>zh_TW</i></b> bundle for Traditional Chinese.
></pre>
>
> <code>[themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties[110-114]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties/#L110-L114)</code>
> <code>[themes/src/main/resources-community/theme/base/login/messages/messages_zh_CN.properties[123-123]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/login/messages/messages_zh_CN.properties/#L123-L123)</code>
> <code>[themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties[112-114]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties/#L112-L114)</code>
> <code>[themes/src/main/resources-community/theme/base/account/messages/messages_zh_TW.properties[150-152]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/account/messages/messages_zh_TW.properties/#L150-L152)</code>
> <code>[themes/src/main/resources/theme/base/account/messages/messages_en.properties[150-152]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources/theme/base/account/messages/messages_en.properties/#L150-L152)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>## Issue description
>The Simplified Chinese account authenticator instruction uses Traditional Chinese characters, making the TOTP setup flow inconsistent with the selected locale.
>
>## Fix Focus Areas
>- themes/src/main/resources-community/theme/base/account/messages/messages_zh_CN.properties[112-114]
>
>## Recommended Fix
>Replace the instruction with the approved Simplified Chinese translation, using wording consistent with the corresponding `zh_CN` login bundle and neighboring account messages. Keep Traditional Chinese wording in the separate `zh_TW` bundle.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
<details><summary><ins><strong>View medium (1)</strong></ins></summary><br/>
<details>
<summary> 6. Pluralized markup bypasses theme checks <code>🐞 Bug</code> <code>⛨ Security</code></summary>
<br/>
> <details open>
><summary>Description</summary>
><br/>
>
><pre>
><b><i>normalizeValue</i></b> replaces every choice-format expression with <b><i>...</i></b> before <b><i>verifySafeHtml</i></b> selects
>and applies its HTML policy. Any disallowed tag or altered anchor inside a translated plural branch
>is removed from both the comparison input and sanitizer input, so the new verifier reports no
>violation for that branch.
></pre>
></details>
> <details>
><summary>Code</summary>
><br/>
>
><code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[R124-126]](https://github.com/drape-io/crbench-qodo-2026-09/pull/95/files#diff-c9b90df19d737df4f7062b741b1d0f7e01d2afe3bed28afd6792012a3a412b18R124-R126)</code>
>
>```diff
>+ } else if (key.startsWith("linkExpirationFormatter.timePeriodUnit") || key.equals("error-invalid-multivalued-size")) {
>+ // The problem is the "<" that appears in the choice
>+ value = value.replaceAll("\\{[0-9]+,choice,[^}]*}", "...");
>```
></details>
> <details>
><summary>Evidence</summary>
><br/>
>
><pre>
>The verifier calls <b><i>normalizeValue</i></b> on both translated and English values before anchor and
>sanitizer checks. Its new normalization branch deletes the entire <b><i>{n,choice,...}</i></b> content,
>including any markup that the subsequent policy would otherwise reject.
></pre>
>
> <code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[82-99]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java/#L82-L99)</code>
> <code>[misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[117-130]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java/#L117-L130)</code>
> <code>[themes/src/main/resources-community/theme/base/login/messages/messages_sk.properties[501-501]](https://github.com/drape-io/crbench-qodo-2026-09/blob/720f64022c06c32cf91dca333ddce810918c4906/themes/src/main/resources-community/theme/base/login/messages/messages_sk.properties/#L501-L501)</code>
></details>
> <details>
><summary>Agent prompt</summary>
><br/>
>
>```
>The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
>
>Issue description
>Choice-format contents are discarded before HTML and anchor validation, allowing unsafe markup in a plural branch to pass the theme verifier.
>
>Fix Focus Areas
>- misc/theme-verifier/src/main/java/org/keycloak/themeverifier/VerifyMessageProperties.java[124-126]
>
>Recommended Fix
>Parse choice-format branches and validate each branch's text and markup instead of replacing the entire expression. Preserve or safely neutralize only the comparison operators required by choice syntax, while retaining any HTML for the sanitizer and anchor checks.
>```
> <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>
></details>
<hr/>
</details>
</details>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<!-- qodo-context:start -->
<details><summary><strong>Context sources</strong></summary>
<div>Review mode: <code>🧠 Deep</code>: This changes a shared theme-verification tool with substantial new HTML/resource-bundle logic plus dozens of independent localization edits, creating multiple plausible, easy-to-miss defects across validation paths.</div>
<!-- qodo-context:end -->
</details>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<!-- qodo-daily-tip:start -->
<details>
<summary><strong>Tip of the day</strong></summary>
<br/>
<pre>💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper</pre>
<a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a>
</details>
<img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
<!-- qodo-daily-tip:end -->
<!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/720f64022c06c32cf91dca333ddce810918c4906 -->
<a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>