You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "messere1 (via GitHub)" <gi...@apache.org> on 2026/08/11 16:07:31 UTC

[I] [studio][Bug] Translation parameters can be corrupted by replacement tokens [rocketmq-dashboard]

messere1 opened a new issue, #1913:
URL: https://github.com/apache/rocketmq-dashboard/issues/1913

   ## Bug description
   `LangContext.t()` interpolates parameters with `String.replace(token, String(value))`. JavaScript interprets replacement patterns such as `$&`, ``$` ``, and `$'` in the replacement string instead of inserting them literally.
   
   As a result, valid user-controlled names can be corrupted in translated labels and confirmation messages. For example, interpolating `orders$&` into `Delete {name}?` renders `Delete orders{name}?` rather than preserving the resource name. The current implementation also replaces only the first occurrence of a placeholder.
   
   ## Expected behavior
   Translation parameters should be inserted literally and every occurrence of the corresponding placeholder should be replaced.
   
   ## Suggested fix
   Use literal splitting/joining (or a replacement callback) and add regression coverage for replacement-pattern characters.
   
   ## Affected branch
   `rocketmq-studio`


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [studio][Bug] Translation parameters can be corrupted by replacement tokens [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1913:
URL: https://github.com/apache/rocketmq-dashboard/issues/1913#issuecomment-5255717991

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   Verified against the `rocketmq-studio` branch. The bug is in `web/src/i18n/LangContext.tsx` line 46:
   
   ```ts
   text = text.replace(`{${k}}`, String(v));
   ```
   
   Two problems:
   1. **`String.replace()` with a string pattern only replaces the first occurrence** — if a translation has multiple `{name}` placeholders, only the first is substituted.
   2. **Special replacement patterns (`$&`, `$'`) are interpreted** — user-controlled values containing these sequences corrupt the output. For example, a resource named `orders$&` interpolated into `Delete {name}?` produces `Delete orders{name}?`.
   
   **Severity:** medium — affects any user-controlled string displayed in translated UI text (confirmation dialogs, labels).
   **Impact:** `LangContext.t()` consumers across the Studio frontend.
   
   Suggested fix: use `split`/`join` or a replacement callback function to avoid pattern interpretation and handle all occurrences.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by github-manager-bot*
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [studio][Bug] Translation parameters can be corrupted by replacement tokens [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #1913: [studio][Bug] Translation parameters can be corrupted by replacement tokens
URL: https://github.com/apache/rocketmq-dashboard/issues/1913


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [studio][Bug] Translation parameters can be corrupted by replacement tokens [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1913:
URL: https://github.com/apache/rocketmq-dashboard/issues/1913#issuecomment-5335814487

   This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org