0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

fix(collapse): xss in parent option

This commit is contained in:
Johann-S 2018-05-30 09:46:50 +02:00
parent 2d90d369bb
commit 149096016f
2 changed files with 15 additions and 1 deletions

View File

@ -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 =

View File

@ -54,6 +54,20 @@
</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>