Skip to content

Commit 288b73e

Browse files
committed
Merge branch 'directory-xss'
2 parents 588b1f8 + 1ed04ff commit 288b73e

File tree

2 files changed

+55
-23
lines changed

2 files changed

+55
-23
lines changed

docs/source/changelog.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ We strongly recommend that you upgrade pip to version 9+ of pip before upgrading
2121
Use ``pip install pip --upgrade`` to upgrade pip. Check pip version with
2222
``pip --version``.
2323

24+
.. _release-5.7.2:
25+
26+
5.7.2
27+
-----
28+
29+
5.7.2 contains a security fix preventing malicious directory names
30+
from being able to execute javascript. CVE request pending.
31+
32+
.. _release-5.7.1:
33+
34+
5.7.1
35+
-----
36+
37+
5.7.1 contains a security fix preventing nbconvert endpoints from executing javascript with access to the server API. CVE request pending.
38+
2439
.. _release-5.7.0:
2540

2641
5.7.0

notebook/static/tree/js/notebooklist.js

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,28 @@ define([
383383
breadcrumb.empty();
384384
var list_item = $('<li/>');
385385
var root_url = utils.url_path_join(that.base_url, '/tree');
386-
var root = $('<li/>').append('<a href="' + root_url + '"><i class="fa fa-folder"></i></a>').click(function(e) {
387-
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
388-
if(e.altKey || e.metaKey || e.shiftKey) {
389-
return true;
390-
}
391-
var path = '';
392-
window.history.pushState({
393-
path: path
394-
}, 'Home', utils.url_path_join(that.base_url, 'tree'));
395-
that.update_location(path);
396-
return false;
397-
});
386+
var root = $('<li/>').append(
387+
$("<a/>")
388+
.attr('href', root_url)
389+
.append(
390+
$("<i/>")
391+
.addClass('fa fa-folder')
392+
)
393+
.click(function(e) {
394+
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
395+
if(e.altKey || e.metaKey || e.shiftKey) {
396+
return true;
397+
}
398+
var path = '';
399+
window.history.pushState(
400+
{path: path},
401+
'Home',
402+
utils.url_path_join(that.base_url, 'tree')
403+
);
404+
that.update_location(path);
405+
return false;
406+
})
407+
);
398408
breadcrumb.append(root);
399409
var path_parts = [];
400410
this.notebook_path.split('/').forEach(function(path_part) {
@@ -405,17 +415,24 @@ define([
405415
'/tree',
406416
utils.encode_uri_components(path)
407417
);
408-
var crumb = $('<li/>').append('<a href="' + url + '">' + path_part + '</a>').click(function(e) {
409-
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
410-
if(e.altKey || e.metaKey || e.shiftKey) {
411-
return true;
412-
}
413-
window.history.pushState({
414-
path: path
415-
}, path, url);
416-
that.update_location(path);
417-
return false;
418-
});
418+
var crumb = $('<li/>').append(
419+
$('<a/>')
420+
.attr('href', url)
421+
.text(path_part)
422+
.click(function(e) {
423+
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
424+
if(e.altKey || e.metaKey || e.shiftKey) {
425+
return true;
426+
}
427+
window.history.pushState(
428+
{path: path},
429+
path,
430+
url
431+
);
432+
that.update_location(path);
433+
return false;
434+
})
435+
);
419436
breadcrumb.append(crumb);
420437
});
421438
this.contents.list_contents(that.notebook_path).then(

0 commit comments

Comments
 (0)