Behaviour SwRS-MDOKFSTUDIO-TRUST-011
No script of a document reaches the preview
When the extension builds the page of a document, it SHALL have the sanitizer remove every script element of the document, inline or with a source, in every preview mode, and never keep a nonce attribute written by the document.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TRUST-006: from “A document carries a script and raw HTML” to “The scripts of the document are gone”.
Scenarios 2
The situations the tests check; open one to read it.
nominalScript with a source in any preview
Givena script element whose source is a file inside the roots, in a preview with restricted reads or full reads, and an image inside the roots
Whenthe page is built
Thenthe script element is gone with the diagnostic blocked-script and the image stays
refusalInline script and nonce attribute
| Input | Outcome |
|---|---|
| A script element with no src attribute, also inside an SVG that holds a script element with code | The script is gone with the diagnostic blocked-inline-script |
| A script element with a source outside the roots | The script is gone with the diagnostic blocked-script |
| An element of the document that carries a nonce attribute | The attribute is removed with the diagnostic blocked-attribute |