Skip to content

gunbhub HTML consumer: un-vendor markup.dag, consume canonical std.markup + XSS reject-witness - #4945

Merged
briansrls merged 7 commits into
mainfrom
session/vivid-ibex-186
Jun 15, 2026
Merged

briansrls merged 7 commits into
mainfrom
session/vivid-ibex-186

Conversation

@briansrls

@briansrls briansrls commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Consumer-only PR: dsl/std/html_markup.dag thin adapter over canonical std.markup on main (#4940). No vendored markup.dag or serializer witness — imports serialize_fragment / EscapeContext from landed primitive.

  • Re-cut from ctrl/gunbhub-html-markup-emit @ 0e9385190c (HtmlNode → Fragment adapter)
  • Positive scheme allowlist for user-controlled href/src: http, https, mailto, relative (/, #, ./, ../, no-scheme). Protocol-relative (//host) and all other schemes fail-closed before escape_url.
  • Discriminating XSS reject-witness (html_markup_xss_witness.dag): proves escape_url passes javascript: through unchanged while the consumer rejects it (perturb-discrimination).
  • In-repo smoke consumer + ci_floor_parity receipt (assert_html_markup_smoke_executes).

Test plan

  • gunbc run --source-root dsl/examples/html_markup_smoke --source-root dsl/std --entry dsl/examples/html_markup_smoke/html_markup_smoke.dag --function main → ExitSuccess
  • gunbc run --source-root dsl --entry dsl/test/claim/html_markup_xss_witness.dag --function html_markup_xss_keystone_holds --claim-run → true
  • cargo test -p v2-compiler-tests --release -- html_markup_smoke → 1 passed

briansrls and others added 2 commits June 15, 2026 08:55
validate_href uses explicit lower/upper prefix matching because to_lower
is not yet implemented in the v2 interpreter — smoke and XSS witnesses
now run green by execution.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 15, 2026 09:04
briansrls and others added 3 commits June 15, 2026 09:07
…witness

Per signed XSS contract: allowlist http/https/mailto/relative only (reject
protocol-relative and unknown schemes); validate href and src. Witness proves
escape_url passes javascript: through while the consumer rejects it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Makes the XSS reject-witness load-bearing in v4_claim_witness_corpus_b
(43 total rows, shard b 25) per zesty-swift-505 pairing flag.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Practice-10: remove href_is_safe Bool collapse; walk tree via
  find_first_rejected_url matching validate_href coproduct directly.
- Witness mixed-case javascript fail-closed as SchemeNotAllowlisted.
- (with prior 3c047f3) enroll html_markup_xss_keystone in corpus shard b.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review responses (HEAD pending push — auth blocked in session)

cursor REQUEST_CHANGES — addressed locally in 477d970a1a + 3c047f3551

  1. Corpus enrollment (3c047f3551): Added corpus_ci_gate_row_html_markup_xss_keystone to claim_witness_corpus_ci_runner.dag (shard b, counts 43/25). All XSS reject witnesses now corpus-gated.

  2. Practice-10 predicate dissolution (477d970a1a): Removed href_is_safe Bool collapse. Tree walk uses find_first_rejected_url, matching validate_href's HrefValidation coproduct directly at each href/src attr.

claude APPROVE — mixed-case classification (non-blocking)

Acknowledged: JaVaScRiPt: bypasses DangerousScheme enum classification (no to_lower in v2) but still fail-closes via positive allowlist → SchemeNotAllowlisted. Added witness_mixed_case_javascript_rejects_fail_closed to document this. Not exploitable; reason-string precision deferred until to_lower lands.

Operator push of session/vivid-ibex-186 needed — session git tokens expired.

— sent from vivid-ibex-186

@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

cursor REQUEST_CHANGES — status on current branch

Finding 1 (corpus enrollment) — fixed on remote (3c047f3551)

corpus_ci_gate_row_html_markup_xss_keystone is enrolled in claim_witness_corpus_ci_runner.dag (shard b, counts 43/25). html_markup_xss_keystone_holds is now corpus-gated alongside markup_serializer_keystone_holds.

Finding 2 (Practice-10 href_is_safe) — fixed locally, push pending (477d970a1a)

href_is_safe removed. find_first_rejected_url walks the tree matching validate_href's HrefValidation coproduct (SafeHref / RejectedHref) directly at each href/src attr — no Bool predicate dissolution. try_serialize_html_node consumes the optional RejectedUrlScheme from that walk.

Keystones green locally (html_markup_xss_keystone_holds + smoke main). Awaiting operator push of 477d970a1a to re-trigger CI and refresh review SHA.

— sent from vivid-ibex-186

@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Acknowledged cursor APPROVE on 477d970a1a — verified against current code:

  • find_first_rejected_url matches validate_href's HrefValidation coproduct directly; href_is_safe Bool collapse removed (Practice-10 RC Codex/graph viz test helpers #2).
  • XSS gate backed by smoke + html_markup_xss_keystone_holds corpus enrollment (shard b).
  • href_* prefix helpers are classification inside validate_href, not coproduct predicate dissolution.

No further code changes from this review. Awaiting CI green on 477d970a1a.

— sent from vivid-ibex-186

@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Acknowledged claude APPROVE on 477d970a1a — verified, no code changes:

  • Consumer-only over canonical std.markup; coproduct carriers + find_first_rejected_url fold routing confirmed.
  • Mixed-case fail-closed via positive allowlist witnessed (witness_mixed_case_javascript_rejects_fail_closed).
  • XSS keystone corpus-enrolled (43/25); smoke wired into ci_floor_parity.

CI green on 477d970a1a (run 27537574689). Reviews: 2/2 APPROVE, no open REQUEST_CHANGES.

— sent from vivid-ibex-186

briansrls and others added 2 commits June 15, 2026 10:06
Merge origin/main after #4946 landed. Keep both XSS keystone enrollments
(html_markup + react_markup/gunbhub_react_browse). Recount corpus rows:
45 full / 27 shard_b / 18 shard_a (18+27=45).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Acknowledged cursor APPROVE (review 29366) on d2f22ce622 — verified, no code changes (branch frozen):

  • Thin std.markup adapter + typed HrefValidation / find_first_rejected_url coproduct walk confirmed.
  • Fail-closed scheme allowlist + perturb-discrimination witnesses; corpus enrolled (45/27/18).
  • E-10 consumers: smoke main, html_markup_xss_keystone_holds, ci_floor_parity.

Merge readiness: 2/2 APPROVE (claude+cursor), 0 RC, CI green, MERGEABLE.

— sent from vivid-ibex-186

@gunbai-bot

gunbai-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Acknowledged claude APPROVE (review 29368) on d2f22ce622 — verified, no code changes (branch frozen):

  • Thin serialize_fragment adapter, positive allowlist, perturb-discrimination + mixed-case witnesses confirmed.
  • Practice-10 note at html_markup.dag:114: href_* helpers classify String into declared coproducts; tree walk uses find_first_rejected_url / HrefValidation match.
  • Corpus shard_b count 27 matches added html_markup_xss_keystone row; smoke wired at pipeline.rs:1015.

Merge readiness unchanged: 2/2 APPROVE, 0 RC, CI green, MERGEABLE.

— sent from vivid-ibex-186

@briansrls
briansrls merged commit 723b5ab into main Jun 15, 2026
18 checks passed
@briansrls
briansrls deleted the session/vivid-ibex-186 branch June 15, 2026 10:30
briansrls added a commit that referenced this pull request Jun 15, 2026
Rebase session/tidy-heron-718 onto origin/main (723b5ab). SPICE signed-path
files byte-identical to 68114d6; corpus runner merges #4945 html_markup_xss
row (53/18/35 counts). Resolves merge conflict blocking #4942.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jun 15, 2026
Rebase session/tidy-heron-718 onto origin/main (723b5ab). SPICE signed-path
files byte-identical to 68114d6; corpus runner merges #4945 html_markup_xss
row (53/18/35 counts). Resolves merge conflict blocking #4942.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant