Follow-up from #957
#957 sanitizes the filename an attachment carries before it is used as a name in the per-project library (packages/contract/src/runs.ts). The strip covers C0 plus U+007F and the characters Windows refuses, but not the bidi/format control characters.
From the re-review of 3cce047a:
The strip covers C0 plus U+007F and the characters Windows refuses, but not the bidi overrides (U+202E and friends), so briefdm.txt files under a name that renders reversed in a file browser. Extension pinning already removes the dangerous half of that trick — the name cannot claim an extension the media type did not earn — so this is display spoofing only. One more range in the existing character class if you want it.
Display spoofing only, which is why it did not hold #957: the extension is pinned to the already-validated media type, so a name cannot claim to be something the content is not.
Acceptance criteria
Related: #957
Follow-up from #957
#957 sanitizes the filename an attachment carries before it is used as a name in the per-project library (
packages/contract/src/runs.ts). The strip covers C0 plusU+007Fand the characters Windows refuses, but not the bidi/format control characters.From the re-review of
3cce047a:Display spoofing only, which is why it did not hold #957: the extension is pinned to the already-validated media type, so a name cannot claim to be something the content is not.
Acceptance criteria
U+200E–U+200F,U+202A–U+202E,U+2066–U+2069).U+202Eand asserts the stored name renders in one direction.Related: #957