Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

pathFor: adoptPage trusts a mutable page global and a NUL/replacement-char id can escape-collide

Open
#220 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
playwright, typescript

Research direction

Start by locating adoptPage and the path helper, then inspect the duplicate-id fix in #182 and #215. Check how the helper is chosen and how escaped id selectors are validated, including invalid-selector handling. Done means page-defined globals cannot collapse paths and distinct elements with NUL or U+FFFD ids do not share a path; verify with focused tests for both cases.

Written by the indexing model from the issue text.

Description

area: engine bug security

Follow-up to #182 / #215.

What is wrong

Two residual identity-collision paths remain after the duplicate-id fix:

  1. adoptPage installs the path helper only if window.__usablPathFor is not already a function. A page that already navigated can define its own window.__usablPathFor = () => '#dup', and adoptPage preserves it, so every element collapses to one identity.
  2. The uniqueness guard checks that the escaped id selector matches exactly one element, not that the match is the element in hand. A NUL id and a literal U+FFFD id both escape to the same selector, so two distinct elements can still collide.

Why it matters

Both reintroduce the set-difference false green the id-collision work closed, for a page that is hostile or has unusual ids.

Fix

Do not trust a mutable page global: evaluate a private path function per query, or install an immutable binding. Before using an id selector, require exactly one match AND matches[0] === element, with invalid-selector handling.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2h 17m
Merged PRs (30d)
10

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from usabl-dev/usabl

All issues in usabl-dev/usabl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.