You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(security): querySelector SyntaxError not caught in AskableContext.resolveExplicitHierarchyParent #305
AskableContext.resolveExplicitHierarchyParent() in packages/core/src/context.ts (line 161) passed a user-supplied data-askable-parent attribute value directly to querySelector() without a try/catch. An invalid CSS selector (e.g. data-askable-parent=":invalid(") throws a DOMException: SyntaxError, which propagates out of the focus tracking callback and disrupts all subsequent interaction tracking for that element.
The identical bug was previously fixed in observer.ts, but the context.ts copy of the same function was missed.
Impact
Any element with a malformed data-askable-parent attribute silently breaks focus tracking for that element — no focus events fire, and the error may propagate to window.onerror.
Fix
Wrap the querySelector call in a try/catch that returns null on error, matching the existing fix in observer.ts.
Activity