Studio script editor allows RTLO

Hello,

This bug is happening in the current studio version version-1086667668c048ce, my os is windows10 newest.

The bug is that the studio script editor allows RTLO (right to left override) which reverses text and in our case, breaks the syntax highlighter.

Example of what I mean:
Screenshot_1
All you need to reproduce is paste the RTLO character into any script.
https://www.fileformat.info/info/unicode/char/202e/browsertest.htm

This doesn’t break the script.
The script we are running:
Screenshot_3
Output:
Screenshot_1
The example I used here is in my uncopy locked place, the script is in workspace.
https://www.roblox.com/games/4725604863/

Roblox studio shouldn’t allow text reversing.
Maybe this could be used to hide something. :thinking:

5 Likes

The highlighting looks fine? The fact it allows RTLO is a fair enough bug but I think your assertion that it breaks the syntax highlighter is incorrect. It seems to be highlighting it correctly as far as I can tell.

1 Like

This is actually very cool. I didn’t know this was possible, and I could definitely see this being abused. I actually don’t think this is technically a bug with the syntax highlighter as the syntax highlighter itself is behaving as expected, however I do think that this is still a dangerous feature for code.

This is entirely to do with text rendering in the OS and most modern OSes would probably support this character. Based on my knowledge it would be hard or maybe even impossible to fix this without completely blocking the character’s usage or removing it from the text elements which make up the script’s code.

Edit: I additionally found its counterpart which overrides in the reverse direction Browser Test Page for Unicode Character 'LEFT-TO-RIGHT OVERRIDE' (U+202D)
This can be used to make text appear before other text but still be considered after. Example:
“test[RTLO]abc [LTRO] test123” produces "test‮"abc ‭ test123
(This is super funny while editing because it reverses the arrow key direction and causes weird non-continuous selection magic)

2 Likes