@@ -34,8 +34,8 @@ function getXSSOptions(urlTransform): IFilterXSSOptions | undefined {
34
34
// - stripIgnoreTagBody - completely get rid of dangerous HTML
35
35
// (otherwise user sees weird mangled style code, when seeing
36
36
// nothing would be better).
37
- // - whiteList - we need iframes, though we lock them down as
38
- // much as possible, while still supporting 3d graphics .
37
+ // - whiteList - we need iframes to support 3d graphics; unfortunately this
38
+ // isn't safe without a lot more work, so we do NOT enable them .
39
39
return {
40
40
stripIgnoreTagBody : true ,
41
41
// SECURITY: whitelist note -- we had tried to explicitly allow mathjax script tags in sanitized html
@@ -45,16 +45,21 @@ function getXSSOptions(urlTransform): IFilterXSSOptions | undefined {
45
45
// The fix is completley removing any whitelisting of any script tags. The feature of
46
46
// mathjax in html is not important enough to support, and too dangerous -- even if it worked,
47
47
// it would probably be an easy attack vector by just making up fake mathjax.
48
+ // Due to https://github.com/sagemathinc/cocalc/security/advisories/GHSA-jpjc-pwjv-j9mg
49
+ // we also remove all use of iframes, which
48
50
whiteList : {
49
51
...whiteList ,
50
- iframe : [ "src" , "srcdoc" , "width" , "height" ] ,
52
+ // DISABLED due to https://github.com/sagemathinc/cocalc/security/advisories/GHSA-jpjc-pwjv-j9mg
53
+ // iframe: ["src", "srcdoc", "width", "height"],
54
+ iframe : [ ] ,
51
55
html : [ ] ,
52
56
} ,
53
57
safeAttrValue : ( tag , name , value ) => {
54
- if ( tag == "iframe" && name == "srcdoc" ) {
55
- // important not to mangle this or it won't work.
56
- return value ;
57
- }
58
+ // disabled since not sufficiently secure.
59
+ // if (tag == "iframe" && name == "srcdoc") {
60
+ // // important not to mangle this or it won't work.
61
+ // return value;
62
+ // }
58
63
if ( urlTransform && URL_TAGS . includes ( name ) ) {
59
64
// use the url transform
60
65
return urlTransform ( value , tag , name ) ?? value ;
0 commit comments