Visual Subnet Calculator loads its subnet map from `?c=` shareable links
and imported configs, then wrote subnet keys, notes and colours into the
table HTML unescaped. A crafted link could run script on the it-tools
origin. addRow() now escapes the network, note and ancestor keys in join
cells, and only accepts hex colours. Allocation results, validation
issues, warnings, the network-boundary notice and caught exception
messages are escaped as well.
zpool-calc wrote the vdev type <select> value with .html(); use .text().
Both are vendored files; reapply if they are updated from upstream.
Fixes CodeQL js/xss-through-dom and js/xss-through-exception alerts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: extract testable services and pin current crypto behaviour
Move the hashing, hmac, crc and ULA logic out of the single file components
into service modules next to them, and cover them with characterization tests
that pin the exact digests, encodings and ciphertexts the tools produce today.
The encryption tool had no tests at all; it now has round trip coverage for
every algorithm plus pinned ciphertexts for the deterministic ones, including
OpenSSL salted payloads produced by previous versions of it-tools.
No behaviour change: this is the reference point the dependency replacements
that follow have to reproduce exactly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq
* chore(deps): replace the five deprecated packages flagged by renovate
Renovate's dependency dashboard lists five deprecated or replaced packages;
this removes all of them, keeping the observable behaviour identical.
- crypto-js -> crypto-es. Upstream discontinued crypto-js; crypto-es is its
maintained ESM/TypeScript successor and is byte for byte compatible, which
the characterization tests added in the previous commit verify: the same
1012 assertions pass before and after the swap, including the OpenSSL
salted ciphertexts of the encryption tool. It ships its own types, so
@types/crypto-js goes away too.
- plausible-tracker -> @plausible-analytics/tracker, the official replacement.
The app keeps providing the same 'plausible' injection shape, so nothing
downstream changes. apiHost maps onto the new endpoint option and keeps
posting to the very same url, trackLocalhost onto captureOnLocalhost, and
the pageviews that enableAutoPageviews() used to start are now captured by
init() itself. init() throws without a domain, unlike the old tracker, so
an enabled but domain-less config now falls back to the no-op instance
instead of breaking the app bootstrap.
- svg2png-wasm -> @resvg/resvg-wasm, the replacement named in its deprecation
notice. The renderer moves into a service covered by tests that rasterize
real svg content, and the 2 MB binary no longer has to be committed under
public/: vite emits it from the package as a hashed asset, so it can never
drift from the js glue on upgrade.
- @types/bcryptjs and @types/uuid are deprecated stubs, bcryptjs and uuid
having shipped their own types for a while.
Also drops the now dead renovate rules that only existed to keep uuid and
@types/uuid in lockstep, and fixes the tool metadata a new guard test caught:
the encryption tool advertised 'crypto-s' and the wysiwyg editor still
advertised monaco and prettier.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq
* test: pin that svg text is actually drawn, document the load bearing empty iv
The resvg swap is pixel identical to svg2png-wasm for shapes and gradients,
and it also fixes text that names the embedded Roboto family: svg2png-wasm
returned an empty canvas there, so the assertion guards a real improvement
rather than only the image dimensions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq
* fix: address review feedback on the plugin and renderer initialization
Two of the review comments are real regressions against the behaviour the
replaced packages had, so both are fixed with a test that fails without the fix:
- The plausible plugin called init() on every install. init() throws on the
second call, so installing the plugin on a second app instance (tests, hot
reload) would have taken the app down, where the old tracker was happy to be
constructed repeatedly. The tracker is now initialized once and reused. The
api host also gets its trailing slash trimmed so the endpoint cannot end up
with a double slash.
- initializeSvgRenderer() memoized the initialization promise including its
rejections, so one failed wasm download left the tool broken until a page
reload. The old code only latched its flag after a successful load. A failed
attempt is no longer cached.
Also extends the tool metadata guard to the removed stub type packages, and
pins the negative counters that verifyHOTP walks through when the window is
wider than the counter: their hexadecimal form keeps the minus sign, which the
hex parser reads as ffffffff rather than rejecting, and crypto-es reproduces
that exactly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq
---------
Co-authored-by: Claude <noreply@anthropic.com>
Plurimath opal cannot be minified, esbuilded and bundled without causing unexpected exceptions
So copy js in public folder and import plurimath from here