jsbench / jsbench/jsbench.github.io

Блокировка скрипта в проекте во время теста

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
263
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Если в сниппете кода теста присутствует какое-либо действие в ответ на событие, например скролл окна, то в момент, когда тестируется данный сниппет и срабатывает данное событие (и, значит, исполняется js код), может быть выполнено тело обработчика данного события :)

Например:

window.onscroll = function(ev) {
    alert(8);
   document.getElementById('canvas').remove();
};

Это вредит правильной, стабильной логике работы программы и открывает потенциальные уязвимости ;)

@RubaXa В данном контексте можно что-либо предпринять?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides no file or test entry point. Start by reproducing the event-handler behavior in a benchmark snippet, then trace how test code is executed and how browser events are exposed. Define which handlers must be blocked or isolated and add regression coverage demonstrating that the benchmark remains stable and cannot alter the page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.