Skip to content

Commit

Permalink
Sanitize file-names
Browse files Browse the repository at this point in the history
Otherwise a DOM-based XSS is possible.
  • Loading branch information
LukasReschke committed Dec 19, 2014
1 parent 4b06c28 commit 9d170f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See also section about WebODF
### Fixes

* Only highlight ODF fields in edit mode ([#816](https://github.com/kogmbh/WebODF/issues/816))

* Prevent Cross-Site Scripting from file names ([#851](https://github.com/kogmbh/WebODF/pull/851)))

## Wodo.TextEditor
See also section about WebODF
Expand Down
4 changes: 3 additions & 1 deletion programs/viewer/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ function Viewer(viewerPlugin) {
url = location;
filename = url.replace(/^.*[\\\/]/, '');
document.title = filename;
document.getElementById('documentName').innerHTML = document.title;
var documentName = document.getElementById('documentName');
documentName.innerHTML = "";
documentName.appendChild(documentName.ownerDocument.createTextNode(document.title));

viewerPlugin.onLoad = function () {
document.getElementById('pluginVersion').innerHTML = viewerPlugin.getPluginVersion();
Expand Down
3 changes: 2 additions & 1 deletion webodf/lib/odf/OdfCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,8 @@
// FIXME: We need to support parametrized strings, because
// drop-in word replacements are inadequate for translations;
// see http://techbase.kde.org/Development/Tutorials/Localization/i18n_Mistakes#Pitfall_.232:_Word_Puzzles
element.innerHTML = runtime.tr('Loading') + ' ' + url + '...';
element.innerHTML = "";
element.appendChild(element.ownerDocument.createTextNode(runtime.tr('Loading') + url + '...'));
element.removeAttribute('style');
// open the odf container
odfcontainer = new odf.OdfContainer(url, function (container) {
Expand Down

0 comments on commit 9d170f8

Please sign in to comment.