tosijs-styled-editor 0.5.0 → 0.5.1

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/CHANGELOG.md CHANGED
@@ -7,6 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2026-09-26
11
+
12
+ ### Security
13
+
14
+ - **An author's display name could break out of a raw-text element and become
15
+ live HTML.** HTML attribute serialization escapes `&` and `"` but **never
16
+ `<`**, and `style`, `xmp`, `title`, `textarea`, `noembed`, `noframes` and
17
+ `plaintext` re-parse their contents as raw text — so a `changeAuthor.name`
18
+ containing `</style><img src=x onerror=…>`, written into a change mark inside
19
+ one of those elements, terminated the element and the remainder parsed as
20
+ markup. `editor.value` then carried a real `<img onerror>`.
21
+
22
+ Nothing external triggers the re-parse: `value` is also the undo stack, so a
23
+ single undo does it in the same session, and `internals.setFormValue` hands it
24
+ to every other reader. Reachable without host cooperation — `tosijs-kilpi`
25
+ drops `style`/`script`/`iframe` but keeps `xmp`/`textarea`/`title`/`noembed`/
26
+ `noframes`/`plaintext`, so a collaborator can paste one — and the host need
27
+ only have wired `changeAuthor.name` to a profile name, which is what that
28
+ field is for.
29
+
30
+ `<` and `>` are now stripped from `changeAuthor.id` and `.name` at every write
31
+ site. Stripping rather than escaping: no escape survives attribute
32
+ serialization into a raw-text element. Affects 0.5.0 only, and only with
33
+ `trackChanges` enabled.
34
+
35
+ **Still true, and not a vulnerability:** tracked edits inside a raw-text
36
+ element are a bad idea regardless — a caret marker left in a `<style>` block
37
+ round-trips into literal CSS text with no attacker involved. Keeping the
38
+ editor's own marks out of those elements is tracked in `TODO.md`. See
39
+ `SECURITY.md`.
40
+
41
+ ### Changed
42
+
43
+ - The build no longer passes `--incremental` to `tsc`, so no
44
+ `dist/tsconfig.tsbuildinfo` is produced. An incremental build into a wiped
45
+ `dist/` can emit nothing at all the second time, which disqualifies a build
46
+ that has to reproduce for the publish workflow.
47
+
48
+ ### Added
49
+
50
+ - `.github/workflows/publish.yml` — OIDC trusted publishing with npm staged
51
+ publishing. CI can only *stage*; the maintainer's 2FA approval on npmjs.com is
52
+ what publishes, and it works from a phone.
53
+
10
54
  ## [0.5.0] - 2026-09-21
11
55
 
12
56
  ### Added
package/SECURITY.md CHANGED
@@ -30,3 +30,31 @@ and we will find a private channel.
30
30
  content are inside your trust boundary and are not filtered.
31
31
  - **documents stored before 0.4.4**, which may already contain a pasted payload.
32
32
  Setting `value` does not filter, so sanitize your corpus as part of upgrading.
33
+
34
+ ## `changeAuthor` is written into the document
35
+
36
+ `editor.changeAuthor` (`id` and `name`) is serialized verbatim into
37
+ `data-author` / `data-author-name` on every change mark, so it reaches
38
+ `editor.value`, the form value and every undo snapshot. It is host-supplied and
39
+ inside your trust boundary — but "the host wired it to a profile name" is the
40
+ ordinary case, so the editor does not trust it: `<` and `>` are stripped at the
41
+ seam (fixed in 0.5.1; 0.5.0 is affected).
42
+
43
+ They have to be stripped rather than escaped. HTML attribute serialization
44
+ escapes `&` and `"` and **never `<`**, and `style`, `xmp`, `title`, `textarea`,
45
+ `noembed`, `noframes` and `plaintext` re-parse their contents as raw text — so a
46
+ `</style>` inside an attribute value written into one of those terminates the
47
+ element and everything after it parses as markup. Nothing external triggers the
48
+ re-parse: `value` is also the undo stack, so a single undo does it in the same
49
+ session.
50
+
51
+ Two consequences worth knowing:
52
+
53
+ - **A display name is not a place to put markup**, and it comes back with its
54
+ angle brackets removed rather than escaped. There is no escape that survives
55
+ attribute serialization into a raw-text element.
56
+ - **Tracked edits inside a raw-text element remain a bad idea.** With no
57
+ attacker at all, a caret marker left inside a `<style>` block round-trips into
58
+ literal CSS text. Keeping the editor's own marks out of those elements is
59
+ tracked as an open item; until it lands, do not point this editor at documents
60
+ whose `<style>`/`<xmp>` content is meant to survive editing.