Protect mail evidence and assessment from rendered HTML destinations #227

Merged
svc-svd-writer merged 1 commit from fix/225-protect-html-hrefs into main 2026-11-23 02:45:12 +00:00

Summary

Preserve the current read and search representation while protecting the inputs used by signatures, delimited sign-offs and full-mode assessment. Verified visible text and verified sign-offs are stored separately. When a historical row lacks provenance, consumers omit the affected field.

MIME or JMAP → legacy rendered body → read and search
             → verified visible text → excerpt and signature
                                     → verified sign-off scan

Closes #225. This precedes HTML body selection in #224. Operator rulings and ADR ratification

Evidence

At the baseline, a generated HTML anchor could put its destination into a signature, a delimited sign-off or a full-mode excerpt. At 97c7b39a3a9858986f5afc5707c8d0036621f6fe, generated MIME and matching JMAP fixtures preserve visible words and exclude the destination in both public evidence tools and the constructed assessor payload. The fixtures cover old rows, plain and mixed mail, malformed markup, truncation, and IMAP section fetches. The v18 upgrade fixture preserves prior stored read/search data and withholds fields without provenance.

Local Ruff formatting and lint, mypy, and the non-integration suite passed with 1,671 passing tests, 8 skipped model tests, and 30 deselected integration tests. Generated fixtures establish fixture behavior. Live IMAP/JMAP, deployed mirror coverage, and external assessor calls were outside this check.

Merge Danger

The additive schema upgrade affects mail mirrors. Protected fields for pre-upgrade rows may become empty until separately verified provenance is available. Rolling back the application can restore the former exposure path. Physical re-derivation is tracked in #226 under separate authorization.

## Summary Preserve the current read and search representation while protecting the inputs used by signatures, delimited sign-offs and full-mode assessment. Verified visible text and verified sign-offs are stored separately. When a historical row lacks provenance, consumers omit the affected field. ```text MIME or JMAP → legacy rendered body → read and search → verified visible text → excerpt and signature → verified sign-off scan ``` Closes #225. This precedes HTML body selection in #224. [Operator rulings and ADR ratification](https://git.groupthink.asia/dev/mail-mind-mcp/issues/225#issuecomment-46294) ## Evidence At the baseline, a generated HTML anchor could put its destination into a signature, a delimited sign-off or a full-mode excerpt. At `97c7b39a3a9858986f5afc5707c8d0036621f6fe`, generated MIME and matching JMAP fixtures preserve visible words and exclude the destination in both public evidence tools and the constructed assessor payload. The fixtures cover old rows, plain and mixed mail, malformed markup, truncation, and IMAP section fetches. The v18 upgrade fixture preserves prior stored read/search data and withholds fields without provenance. Local Ruff formatting and lint, mypy, and the non-integration suite passed with 1,671 passing tests, 8 skipped model tests, and 30 deselected integration tests. Generated fixtures establish fixture behavior. Live IMAP/JMAP, deployed mirror coverage, and external assessor calls were outside this check. ## Merge Danger The additive schema upgrade affects mail mirrors. Protected fields for pre-upgrade rows may become empty until separately verified provenance is available. Rolling back the application can restore the former exposure path. Physical re-derivation is tracked in #226 under separate authorization.
Keep HTML destinations out of evidence and assessment (#225)
All checks were successful
ci/woodpecker/pr/validation Pipeline was successful
97c7b39a3a
Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Author
Member

Independent Standards review · PASS · 0 open findings

Exact head 97c7b39a3a9858986f5afc5707c8d0036621f6fe. The reviewer verified the single co-author trailer, the verified text and sign-off rules in SECURITY.md, and the consistency of evidence statistics with both evidence tools. The revised parser and fixture changes raised no additional Standards findings. git diff --check ec11afc...HEAD passed.

**Independent Standards review · PASS · 0 open findings** Exact head `97c7b39a3a9858986f5afc5707c8d0036621f6fe`. The reviewer verified the single co-author trailer, the verified text and sign-off rules in SECURITY.md, and the consistency of evidence statistics with both evidence tools. The revised parser and fixture changes raised no additional Standards findings. `git diff --check ec11afc...HEAD` passed.
Author
Member

Independent Spec review · PASS · 0 open findings

Exact head 97c7b39a3a9858986f5afc5707c8d0036621f6fe. The reviewer verified matching MIME and JMAP fixtures for delimited and undelimited linked signatures in both evidence tools, and confirmed that the constructed assessor payload keeps visible words and omits the destination. Hidden script text and entity recovery cases were checked across Python 3.12, 3.13 and 3.14. On Python 3.12, a semicolonless entity at the very end of malformed HTML can stay literal in protected text where the legacy renderer decodes it.

**Independent Spec review · PASS · 0 open findings** Exact head `97c7b39a3a9858986f5afc5707c8d0036621f6fe`. The reviewer verified matching MIME and JMAP fixtures for delimited and undelimited linked signatures in both evidence tools, and confirmed that the constructed assessor payload keeps visible words and omits the destination. Hidden script text and entity recovery cases were checked across Python 3.12, 3.13 and 3.14. On Python 3.12, a semicolonless entity at the very end of malformed HTML can stay literal in protected text where the legacy renderer decodes it.
Author
Member

§19 security review · PASS · 0 open findings

Exact head 97c7b39a3a9858986f5afc5707c8d0036621f6fe against ec11afc2e43bc8b3674449990e6e84184b6f4eab.

  • Followed raw MIME, IMAP sections and JMAP legacy-selected bodies into the protected converter and through both evidence tools, the sign-off scan and the constructed full-mode assessor payload. The converter forwards parsed text and the pinned renderer's visibility controls. It has no network or file access. Sender-controlled link destinations, image sources and alt text cannot enter through attribute handling. Expected legacy body rendering stays in the existing read and search path under this fix.
  • Checked malformed-data callbacks, unclosed markup, completed scripts and selected JMAP truncation. Ambiguous parsing or truncation withholds protected outputs. Character-reference handling preserves escaped visible text. In Python 3.12, one malformed end-of-file entity can remain literal.
  • Checked historical rows, sign-off trust updates, copy behavior and the schema migration. Verification state controls both public evidence tools, evidence statistics and full-mode assessment. Historical protected fields stay withheld when provenance is absent. The migration preserves physical legacy body and sign-off values.
  • Matching synthetic transport fixtures check both evidence tools and the actual payload builder, with example destinations only. No changes to external assessor transport, peer field lists, scopes or consent rules. The PR diff's gitleaks scan found zero secrets.
  • Unsupported checks include real IMAP/JMAP, deployed history and an external assessor call. The risk of rolling back to the former exposure path remains documented. Canonical ADR ratification
**§19 security review · PASS · 0 open findings** Exact head `97c7b39a3a9858986f5afc5707c8d0036621f6fe` against `ec11afc2e43bc8b3674449990e6e84184b6f4eab`. - Followed raw MIME, IMAP sections and JMAP legacy-selected bodies into the protected converter and through both evidence tools, the sign-off scan and the constructed full-mode assessor payload. The converter forwards parsed text and the pinned renderer's visibility controls. It has no network or file access. Sender-controlled link destinations, image sources and alt text cannot enter through attribute handling. Expected legacy body rendering stays in the existing read and search path under this fix. - Checked malformed-data callbacks, unclosed markup, completed scripts and selected JMAP truncation. Ambiguous parsing or truncation withholds protected outputs. Character-reference handling preserves escaped visible text. In Python 3.12, one malformed end-of-file entity can remain literal. - Checked historical rows, sign-off trust updates, copy behavior and the schema migration. Verification state controls both public evidence tools, evidence statistics and full-mode assessment. Historical protected fields stay withheld when provenance is absent. The migration preserves physical legacy body and sign-off values. - Matching synthetic transport fixtures check both evidence tools and the actual payload builder, with example destinations only. No changes to external assessor transport, peer field lists, scopes or consent rules. The PR diff's gitleaks scan found zero secrets. - Unsupported checks include real IMAP/JMAP, deployed history and an external assessor call. The risk of rolling back to the former exposure path remains documented. [Canonical ADR ratification](https://git.groupthink.asia/dev/mail-mind-mcp/issues/225#issuecomment-46294)
Author
Member

§19 follow-up · merge paused

During #224 acceptance-test tracing, a generated check found a collision with the existing untrusted-content fence in mail_read. The #225 change preserves that read path. The #224 grant requires an operator ruling before the merge proceeds. Finding and proposed disposition

**§19 follow-up · merge paused** During #224 acceptance-test tracing, a generated check found a collision with the existing untrusted-content fence in `mail_read`. The #225 change preserves that read path. The #224 grant requires an operator ruling before the merge proceeds. [Finding and proposed disposition](https://git.groupthink.asia/dev/mail-mind-mcp/issues/224#issuecomment-46304)
Author
Member

Exact-head CI and raw-log audit · PASS

Woodpecker validation for 97c7b39a3a9858986f5afc5707c8d0036621f6fe is green on both the forge status and pipeline 128. The clone log confirms the exact SHA. The check step exited zero after Ruff, mypy, 1,671 passing tests, 8 skipped local-model tests, 30 deselected integration tests and the dependency audit.

Direct run under the operator grant. Audited all 684 records of the raw clone and check logs and the full project-environment local validation log for command not found, errors during collection, = not found, ran outside the project environment and "is_error":true with optional JSON whitespace. Zero matches. The remote test log includes a test-session teardown logging traceback and pytest reported successful completion.

Decoded raw Woodpecker JSONL digests (SHA-256):

  • Clone step 17137, 9 records · 55e09bd1f180252653a817b91cb7e1439f446f6cd901092f5327bbd6822a9f71
  • Check step 17138, 675 records · ab200bc89ebbbae6aef82f078e7e9989f04594487787b26858051d09108a0072

The separate operator stop on the existing fence boundary is still in force. Woodpecker validation · Stop record

**Exact-head CI and raw-log audit · PASS** Woodpecker validation for `97c7b39a3a9858986f5afc5707c8d0036621f6fe` is green on both the forge status and pipeline 128. The clone log confirms the exact SHA. The check step exited zero after Ruff, mypy, 1,671 passing tests, 8 skipped local-model tests, 30 deselected integration tests and the dependency audit. Direct run under the operator grant. Audited all 684 records of the raw clone and check logs and the full project-environment local validation log for `command not found`, `errors during collection`, `= not found`, `ran outside the project environment` and `"is_error":true` with optional JSON whitespace. Zero matches. The remote test log includes a test-session teardown logging traceback and pytest reported successful completion. Decoded raw Woodpecker JSONL digests (SHA-256): - Clone step 17137, 9 records · `55e09bd1f180252653a817b91cb7e1439f446f6cd901092f5327bbd6822a9f71` - Check step 17138, 675 records · `ab200bc89ebbbae6aef82f078e7e9989f04594487787b26858051d09108a0072` The separate operator stop on the existing fence boundary is still in force. [Woodpecker validation](https://ci.groupthink.asia/repos/72/pipeline/128/1) · [Stop record](https://git.groupthink.asia/dev/mail-mind-mcp/issues/224#issuecomment-46304)
Author
Member

§19 follow-up · operator disposition recorded

The generated fence-marker collision is pre-existing and outside the evidence/assessment remediation in #227. #227 may merge after the exact-head grant gates. The local remediation for all three wrapper call sites is tracked in #228, which must merge before new #224 feature work. The generated check establishes the extra literal marker. Deployed occurrence and reader interpretation remain unmeasured. Operator ruling · Fence remediation

**§19 follow-up · operator disposition recorded** The generated fence-marker collision is pre-existing and outside the evidence/assessment remediation in #227. #227 may merge after the exact-head grant gates. The local remediation for all three wrapper call sites is tracked in #228, which must merge before new #224 feature work. The generated check establishes the extra literal marker. Deployed occurrence and reader interpretation remain unmeasured. [Operator ruling](https://git.groupthink.asia/dev/mail-mind-mcp/issues/224#issuecomment-46317) · [Fence remediation](https://git.groupthink.asia/dev/mail-mind-mcp/issues/228)
svc-svd-writer deleted branch fix/225-protect-html-hrefs 2026-11-23 02:45:12 +00:00
Sign in to join this conversation.
No description provided.