RockteMQ-AI commented on issue #2252:
URL: 
https://github.com/apache/rocketmq-dashboard/issues/2252#issuecomment-5303067585

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   **Branch:** `rocketmq-studio`
   
   The surrogate-pair splitting in `CredentialUtils.mask()` has been verified. 
The method uses `value.substring(0, VISIBLE_CREDENTIAL_CHARS)` and 
`value.substring(value.length() - VISIBLE_CREDENTIAL_CHARS)`, which operate on 
`char` indices. If a supplementary Unicode character (e.g., emoji or CJK 
Extension-B) falls at the boundary, the substring splits the surrogate pair, 
producing malformed UTF-16 output.
   
   **Root Cause:** `String.substring()` works on `char` units, not code points. 
A supplementary character occupies 2 `char`s (a surrogate pair), and splitting 
between them creates invalid lone surrogates.
   
   **Impact:** Credential values containing supplementary Unicode characters 
are displayed with corrupted masking, which may cause display issues or 
downstream encoding errors.
   
   **Severity:** Low — affects only credentials containing supplementary 
Unicode characters (rare but valid).
   
   **Verified at:** 
`server/src/main/java/org/apache/rocketmq/studio/common/util/CredentialUtils.java:mask()`
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to