# LTR言語における双方向文字のセキュリティ修正

**URL:** <https://meta.discourse.org/t/bidirectional-characters-in-ltr-languages-post-security-fix/209819>\
**Category:** Product Support\
**Created:** [2021 年 11 月 22 日午前 7:33 UTC](https://meta.discourse.org/t/bidirectional-characters-in-ltr-languages-post-security-fix/209819 "2021-11-22T07:33:37Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![yaron](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yaron/32/119812_2.png) [@yaron](https://meta.discourse.org/u/yaron)\
**Post date:** [2021 年 11 月 22 日午前 7:33 UTC](https://meta.discourse.org/t/bidirectional-characters-in-ltr-languages-post-security-fix/209819/1 "2021-11-22T07:33:37Z")

</div>

以下のPRに出くわしました。

> <https://github.com/discourse/discourse/pull/15032>
>
> When rendering the markdown code blocks we replace the
> offending characters in …the output string with spans highlighting a textual
> representation of the character, along with a title attribute with
> information about why the character was highlighted.
> 
> The list of characters stripped by this fix, which are the bidirectional
> characters considered relevant, are:
> 
> U+202A
> U+202B
> U+202C
> U+202D
> U+202E
> U+2066
> U+2067
> U+2068
> U+2069
> 
> !\[image\](https://user-images.githubusercontent.com/920448/142784052-56805e94-1592-498e-b787-e954c4d89550.png)

これにより、正当なヘブライ語またはアラビア語のテキストが読めなくなる可能性があると思います。

私が遭遇した解決策の1つは、Unicodeアルゴリズムを無効にして、印刷不可能な文字の表現を表示することでした（Pootleで実装されていたと思います）。  
つまり、アイデアは次のとおりです。  
この‎‏ テキスト

これを次のように変換します。  
この\\u003cLRM\\u003e\\u003cRLM\u003e テキスト

これにより、ユーザーは実際の文字が何であるかを理解することで、これが悪意のあるものかどうかを選択し、必要に応じてUnicodeアルゴリズムを有効にしてテキストを正しく読み取ることができます。  
よろしくお願いします。

---

_[View the full topic](https://meta.discourse.org/t/bidirectional-characters-in-ltr-languages-post-security-fix/209819)._
