Headline
CVE-2022-23054: Add back urlDefined and remove null checks · nasa/openmct@abc93d0
Openmct versions 1.3.0 to 1.7.7 are vulnerable against stored XSS via the “Summary Widget� element, that allows the injection of malicious JavaScript into the ‘URL’ field.
This issue affects: nasa openmct 1.7.7 version and prior versions; 1.3.0 version and later versions.
Permalink
Browse files
Add back urlDefined and remove null checks
- Loading branch information
1 parent a9daee1 commit abc93d0ec4b104dac1ea5f8a615d06e3ab78934a
@@ -42,14 +42,11 @@ export default {
};
},
computed: {
urlDefined() {
return this.internalDomainObject.url && this.internalDomainObject.url.length > 0;
},
url() {
const urlDefined = this.internalDomainObject.url && this.internalDomainObject.url.length > 0;
let url = urlDefined ? this.internalDomainObject.url : null;
if (url) {
url = sanitizeUrl(url);
}
return url;
return this.urlDefined ? sanitizeUrl(this.internalDomainObject.url) : null;
}
},
mounted() {
@@ -48,12 +48,7 @@ export default {
return true;
},
url() {
let url = this.domainObject.url;
if (url) {
url = sanitizeUrl(url);
}
return url;
return sanitizeUrl(this.domainObject.url);
}
}
};
@@ -116,9 +116,7 @@ define([
*/
SummaryWidget.prototype.addHyperlink = function (url, openNewTab) {
if (url) {
const sanitizeUrl = urlSanitizeLib.sanitizeUrl;
url = sanitizeUrl(url);
this.widgetButton.attr('href’, url);
this.widgetButton.attr('href’, urlSanitizeLib.sanitizeUrl(url));
} else {
this.widgetButton.removeAttr(‘href’);
}
@@ -39,9 +39,7 @@ define([
let url = this.domainObject.url;
if (url) {
const sanitizeUrl = urlSanitizeLib.sanitizeUrl;
url = sanitizeUrl(url);
this.widget.setAttribute('href’, url);
this.widget.setAttribute('href’, urlSanitizeLib.sanitizeUrl(url));
} else {
this.widget.removeAttribute(‘href’);
}
@@ -16,12 +16,7 @@ export default {
},
computed: {
url() {
let url = this.currentDomainObject.url;
if (url) {
url = sanitizeUrl(url);
}
return url;
return sanitizeUrl(this.currentDomainObject.url);
}
}
};
0 comments on commit abc93d0
Please sign in to comment.