Use case StRS-MDOKFSTUDIO-TRUST-006
The preview runs no foreign code and unsafe HTML is made inert
As a reader, and as a reviewer of an untrusted repository, I open any Markdown file, even one with hostile HTML, knowing that its preview cannot run its code, call out to the network or read my other files.
Use case diagram
How it is split
This use case (StRS) is reached by one path (the coloured line). A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: Preview a document that carries scripts and unsafe HTML other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Preview a document that carries scripts and unsafe HTML
- A document carries a script and raw HTMLSwRS-MDOKFSTUDIO-TRUST-011 an inline script and a nonce attribute written by the document are removedSwRS-MDOKFSTUDIO-TRUST-011 · 2 tests the sanitizer removes every script element of the document, inline or with a source
- The scripts of the document are goneSwRS-MDOKFSTUDIO-TRUST-036 · 5 tests the sanitizer removes the embed, iframe, form, object and style elements and the on* attributes
- The raw HTML is inertSwRS-MDOKFSTUDIO-TRUST-012 · 6 tests the page policy sets the default source and the connect source to none and keeps no wildcard, unsafe-inline or unsafe-eval source
- The page shows the document with no foreign code and no network load
This map has 87 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 3 behaviours on the map are tested one by one, with 14 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-CORE-013Includes are bounded by depth, budget, size and allowed roots not on the map9 testsSwRS-MDOKFSTUDIO-TRUST-007A page loads local files only from its resource roots not on the map7 testsSwRS-MDOKFSTUDIO-TRUST-011No script of a document reaches the preview 2 testsSwRS-MDOKFSTUDIO-TRUST-012Every page carries a deny-by-default content security policy 6 testsSwRS-MDOKFSTUDIO-TRUST-022Each page gets a fresh nonce that every extension script and style carries not on the map6 testsSwRS-MDOKFSTUDIO-TRUST-036The sanitizer removes active content and keeps the rest 5 testsSwRS-MDOKFSTUDIO-TRUST-042The sanitizer rewrites links and records each removal not on the map4 tests
SwRS-MDOKFSTUDIO-TRUST-050The sanitizer adds source-mapping attributes to mapped elements deprecated deprecated Markdown file