Markdown OKF-Schema Studio

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
SwRS-MDOKFSTUDIO-TRUST-011: No script of a document reaches the previewSwRS-MDOKFSTUDIO-TRUST-0112 teststhe sanitizer removes every scriptelement of the document, inline orwith a sourceSwRS-MDOKFSTUDIO-TRUST-036: The sanitizer removes active content and keeps the restSwRS-MDOKFSTUDIO-TRUST-0365 teststhe sanitizer removes the embed,iframe, form, object and styleelements and the on* attributesSwRS-MDOKFSTUDIO-TRUST-012: Every page carries a deny-by-default content security policySwRS-MDOKFSTUDIO-TRUST-0126 teststhe page policy sets the defaultsource and the connect source tonone and keeps no wildcard,unsafe-inline or unsafe-evalsourceSwRS-MDOKFSTUDIO-TRUST-011: No script of a document reaches the previewSwRS-MDOKFSTUDIO-TRUST-0112 testsan inline script and a nonce attribute written by thedocument are removedA document carries a script and raw HTMLA document carries ascript and raw HTMLThe scripts of the document are goneThe scripts of thedocument are goneThe raw HTML is inertThe raw HTML is inertThe page shows the document with no foreign code and no network loadThe page shows thedocument with no foreigncode 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