codebattle
codebattle copied to clipboard
Bug: Пользователь может вставлять код в свой редактор, скопированный извне своего редактора
Summary
Пользователь может вставлять код в свой редактор, скопированный извне своего редактора, что может быть использовано нечестным образом
Reproduction steps
1. Авторизоваться
2. Вступить в бой с ботом
3. Выделить тест из окна редактора бота и скопировать по ctrl c
4. Вставить в окно своего редактора по ctrl v
Аналогично можно скопипастить любой текст из внешних источников
Expected result
В окно редактора пользователя невозможно вставить какой-либо текст, который скопирован извне редактора пользователя
Actual result
В окно редактора пользователя можно скопипастить любой текст, включая код решения оппонента
https://github.com/hexlet-codebattle/codebattle/assets/150356257/41e8067a-40a5-4d37-b85e-4966fe87b020
Browsers
Chrome
OS
Windows
Копирование кода оппонента исправлено, но в решение можно скопировать любой текст извне игрового поля. CodeBattle: current version : 11a596a Browser: Chrome версии 126.0.6478.183 (64 бит) ОС: Windows 10 Pro
The user can paste the copied code into the editor from any source prerequisites: | User is authorized The user copied the code of the completed task and saved it to notepad test-data: | Task "cub_sum" Language ruby 3.3.0 Code def solution(num) return 0 if num < 0
solution(num - 1) + num * num * num end steps:
- Click on the "Create a game"
- Select game type "with a bot"
- Select task "cub_sum"
- Click on the "Create a battle"
- Select language ruby 3.3.0
- Paste the copied code into the editor
- Click on the "Check"
expected-result: | The user can't paste the copied code into the editor from any source actual-result: | The user can paste the copied code into the editor from any source. Victory in 5 seconds
Current version: c655ad4 Browsers: Google Chrome, Version 130.0.6943.98 OS: Windows 10, Version 19045.5487
Summary: The user can copy code into his editor from the outside sources
Environment: Chromium 135.0.7049.84 (Official Build) snap (64-bit) OS Ubuntu 24.04.2 LTS version: 376ef8e
Steps-to-reproduce:
- Open the page
- Create a game with a bot/other user/friend
- Select opponent's code
- Copy with the “Ctrl + C” command
- Paste the copied text into your code editor using the “Ctrl + V” command
Expected-result: User can't paste anything into his code editor
Actual-result: User copied a text