@firebase/database 1.0.6-canary.a9f844066 → 1.0.6-canary.b284467c1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
8
8
  var logger$1 = require('@firebase/logger');
9
9
 
10
10
  const name = "@firebase/database";
11
- const version = "1.0.6-canary.a9f844066";
11
+ const version = "1.0.6-canary.b284467c1";
12
12
 
13
13
  /**
14
14
  * @license
@@ -1513,6 +1513,8 @@ class FirebaseIFrameScriptHolder {
1513
1513
  const iframeContents = '<html><body>' + script + '</body></html>';
1514
1514
  try {
1515
1515
  this.myIFrame.doc.open();
1516
+ // TODO: Do not use document.write, since it can lead to XSS. Instead, use the safevalues
1517
+ // library to sanitize the HTML in the iframeContents.
1516
1518
  this.myIFrame.doc.write(iframeContents);
1517
1519
  this.myIFrame.doc.close();
1518
1520
  }
@@ -1735,6 +1737,10 @@ class FirebaseIFrameScriptHolder {
1735
1737
  const newScript = this.myIFrame.doc.createElement('script');
1736
1738
  newScript.type = 'text/javascript';
1737
1739
  newScript.async = true;
1740
+ // TODO: We cannot assign an arbitrary URL to a script attached to the DOM, since it is
1741
+ // at risk of XSS. We should use the safevalues library to create a safeScriptEl, and
1742
+ // assign a sanitized trustedResourceURL to it. Since the URL must be a template string
1743
+ // literal, this could require some heavy refactoring.
1738
1744
  newScript.src = url;
1739
1745
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1740
1746
  newScript.onload = newScript.onreadystatechange =