Skip to content

Commit d55b745

Browse files
committed
refactor: avoid prototype pollution in keyboard manager
Makes the check whether an input is a modifier more robust against prototype pollution. (cherry picked from commit 68b3fd2)
1 parent a91677b commit d55b745

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/aria/private/behaviors/event-manager/keyboard-event-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<
6060
}
6161

6262
private _normalizeInputs(...args: unknown[]) {
63-
const withModifiers = Array.isArray(args[0]) || (args[0] as string) in Modifier;
63+
const withModifiers = Array.isArray(args[0]) || Modifier.hasOwnProperty(args[0] as string);
6464
const modifiers = withModifiers ? args[0] : Modifier.None;
6565
const key = withModifiers ? args[1] : args[0];
6666
const handler = withModifiers ? args[2] : args[1];

0 commit comments

Comments
 (0)