Skip to content

Commit

Permalink
fix(collapse): xss in parent option
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann-S committed Jun 1, 2018
1 parent 2d90d36 commit 1490960
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const Collapse = (($) => {
parent = this._config.parent[0]
}
} else {
parent = $(this._config.parent)[0]
parent = document.querySelector(this._config.parent)
}

const selector =
Expand Down
14 changes: 14 additions & 0 deletions js/tests/visual/collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ <h5 class="mb-0">
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="headingFour">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
Collapsible Group Item with XSS in data-parent
</a>
</h5>
</div>
<div id="collapseFour" class="collapse" data-parent="<img src=1 onerror=alert(123) />" role="tabpanel" aria-labelledby="headingFour">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
</div>

Expand Down

0 comments on commit 1490960

Please # to comment.