Skip to content

v4.1.0 - reject lone surrogates in JCS (RFC 8785)

Choose a tag to compare

@aeoess aeoess released this 14 Jul 05:14

Fixed / Security

  • JCS canonicalization now rejects lone surrogates (RFC 8785). canonicalizeJCS and the signing paths that call it previously accepted strings carrying an unpaired UTF-16 surrogate (U+D800 to U+DFFF) and let it reach the canonical output, so input that is not valid Unicode could be signed and could canonicalize differently across implementations. Such input is now rejected before hashing with a stable error, matching the Python and Go SDKs and the RFC 8785 requirement that input be valid Unicode.

Behavior change

  • Input that was previously accepted is now rejected. A value carrying a lone surrogate on a canonicalization or signing path throws instead of producing a signature. Callers that never emit unpaired surrogates see no change. This is why the minor version moves rather than the patch.

Internal

  • Reversibility-fold v0 groundwork landed (per-effect classifier and profile registry). It is not exported from the package entry and adds no public API. No consumer action.