GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(plugins): broaden SVG plain-geometry boundary and log rejected icons in dev builds by Hona · Pull Request #261 · anomalyco/opencode-rune

Conversation

@Hona

@Hona Hona commented Nov 20, 2026

Copy link
Copy Markdown
Member

Fixes the dialog-wsl warning icon regression caught by REFERENCE after #251 (51986c66), where plugins/wsl/icons/warning.svg was rejected because clip-rule="evenodd" was missing from PRESENTATION_ATTRS.

Boundary Audit (crates/opencode-plugin-runtime/src/svg/{mod,validate}.rs)

  • Allowed & value-validated plain-geometry attributes:
    • fill-rule / clip-rule: "nonzero" | "evenodd" only.
    • stroke-dasharray: "none" or 1..=32 finite lengths in [0, 1024] with sum >= 0.5 (blocks tiny-dash tiny-skia stroking DoS); stroke-dashoffset: [-1024, 1024].
    • stroke-linecap (butt|round|square), stroke-linejoin (miter|round|bevel), stroke-miterlimit ([1, 100]), stroke-width ([0, 256]), opacity/fill-opacity/stroke-opacity ([0, 1]).
    • paint-order (normal or distinct fill/stroke/markers), shape-rendering, vector-effect (none|non-scaling-stroke), visibility, display (none emitted; block|inline|initial dropped), fill/stroke/color (none, currentColor, inherit, transparent, black, white, #hex, canonicalized rgb()/rgba()).
    • Root metadata (validated & stripped): xmlns="http://www.w3.org/2000/svg", xmlns:xlink="http://www.w3.org/1999/xlink", version, xml:space, overflow, preserveAspectRatio, image-rendering, text-rendering, x/y, percentage width/height (when viewBox is present), pathLength, and safe style declarations (only validated presentation attrs + color: var(--<ident>); arbitrary CSS properties are now refused).
  • Still refused everywhere: <script>, <foreignObject>, <style>, <image>, <use>, <filter>, <defs>, <mask>, <clipPath>, on*, href, xlink:href, src, filter, clip-path, mask, marker-*, url(...), http(s):, data:, file:, javascript:, expression(, @import, arbitrary CSS in style, tiny-dash DoS, and all size/depth/element/shape/path caps.
  • Dev-build diagnostics (icons.rs, svg/{mod,validate}.rs):
    • Sanitizer returns Result<SanitizedIcon, String> naming the exact offending element, attribute, or CSS property.
    • icons::replace_plugin / icons::intern_svg emit one eprintln! line in debug_assertions builds (plugin <id>: icons/<name>.svg rejected: <reason>) in addition to the plugin console warning.

Proof (proof/ws6/svg-boundary-fix/)

  • Built-in plugin icon audit (before -> after):
    Icon Before (feat(plugins): contract 1.6 with hardened plugin-declared SVG icons #251) After
    plugins/goal/icons/active.svg pass pass
    plugins/goal/icons/complete.svg pass pass
    plugins/goal/icons/paused.svg pass pass
    plugins/pairing/icons/dialog-close.svg pass pass
    plugins/pairing/icons/pair.svg pass pass
    plugins/wsl/icons/chevron.svg pass pass
    plugins/wsl/icons/download.svg pass pass
    plugins/wsl/icons/warning.svg (clip-rule="evenodd") FAIL pass
    Upstream Figma browser/assets/{viewport-device-chevron,viewport-rotate}.svg (overflow="visible", style="display: block;") FAIL pass
  • dialog-wsl vs proof/reference/captures/local/ warning icon box:
    • 1x light ([620..660, 320..360]): 0 diff px (>2), maxDelta = 0, filled triangle 520/520 px.
    • 1x dark ([620..660, 320..360]): 0 diff px (>2), maxDelta = 1, filled triangle 520/520 px.
    • 1.5x light ([930..990, 480..540]): 0 diff px (>2), maxDelta = 1, filled triangle 1200/1200 px.
    • 1.5x dark ([930..990, 480..540]): 0 diff px (>2), maxDelta = 0, filled triangle 1200/1200 px.
  • Hostile/invalid icons (15/15 refused with explicit dev-build stderr diagnostics): use-bomb, filter-dos, huge-paths-20k, deep-2000, script-tag, foreign-obj, external-href, clip-path-attr, mask-attr, bad-clip-rule, bad-fill-rule, bad-style-css, tiny-dash-dos, zero-vb, malformed.
  • scripts/guardrails.ps1 (5/5), cargo check --workspace, and scripts/web.ps1 -Check green.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
fix(plugins): broaden SVG plain-geometry boundary and log rejected ic…
051daff
…ons in dev builds

- Allow Figma and common plain-geometry SVG attributes with strict value validation in crates/opencode-plugin-runtime/src/svg/{mod,validate}.rs: clip-rule and fill-rule (nonzero|evenodd only), stroke-dasharray (<= 32 finite entries, sum >= 0.5 to block tiny-dash DoS), stroke-dashoffset, paint-order, shape-rendering, vector-effect (none|non-scaling-stroke), visibility, display (none emitted; block/inline/initial dropped), color, rgb()/rgba()/inherit paints, root overflow/version/xml:space/preserveAspectRatio/percentage dims (when viewBox is present), and validated style declarations (refusing arbitrary CSS properties).
- Keep all security boundaries intact: refuse <script>, <foreignObject>, <style>, <image>, <use>, <filter>, <defs>, <mask>, <clipPath>, on* handlers, href/xlink:href/src/filter/clip-path/mask/marker-*, external URLs/data URIs/url(...), arbitrary CSS, and size/depth/element/shape/path/dash limits.
- Return structured error strings naming the offending element, attribute, or CSS property, and emit a dev-build stderr diagnostic (`plugin <id>: icons/<name>.svg rejected: <reason>`) in icons::replace_plugin and icons::intern_svg so rejected icons are never silent during development.
- Fixes the dialog-wsl warning icon regression introduced by #251 (plugins/wsl/icons/warning.svg uses clip-rule="evenodd").
@Hona
Hona merged commit b8cdd71 into dev Nov 20, 2026
@Hona
Hona deleted the ws6/svg-sanitizer-boundary branch November 20, 2026 09:11
@github-actions

github-actions Bot commented Nov 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Hona added a commit that referenced this pull request Nov 20, 2026
@Hona
docs(sync): fold #247-#265, add UP-107..UP-113, and refine radar rout…
d32f7bf
…ing (#266)

- Fold verified fleet PRs #247, #251, #252, #253, #254, #255, #256, #257,
  #258, #260, #261, #262, #263, #264, and #265 (Rune #1290 PRE-11 / #1296)
  into docs/upstream-sync/ledger.{json,md}
- Audit upstream anomalyco/opencode through 92d35f8e18 (+9 commits past
  bf683129fa), adding UP-107..UP-113 and assigning UP-106/UP-108/UP-111 to
  BROWSER-UI
- Update scripts/upstream-sync-check.ts to skip pure *.fixture.* test files
  and route browser UI/history vs extensions commits to BROWSER-UI and WS-9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.