Skip to content

fix(deps): bump ammonia to 4.2.5 for RUSTSEC-2026-0533 - #147

Merged
aRustyDev merged 1 commit into
mainfrom
fix/deps-ammonia-rustsec-2026-0533
Nov 13, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
fix/deps-ammonia-rustsec-2026-0533

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

cargo deny is red on main, and the gate with it, on RUSTSEC-2026-0533 (mutation XSS through embedded SVG and MathML in ammonia, dated 2026-11-12). It first showed in the push run for #144, where it was the only failing check besides the gate that reports it. The advisory lists >= 4.2.5 as patched for the 4.2 line, and this takes the lockfile from 4.2.4 to 4.2.5.

What changes

Cargo.lock, two lines: ammonia 4.2.4 to 4.2.5, its version and checksum. The manifest already allows 4.

ammonia is the sanitiser behind thrust-editor-doc's description_html; thrust-api-v1, thrust-compat-plane and thrust-editor-worker reach it through the sanitize feature.

cargo update also moved tempfile's getrandom from 0.4.3 to 0.3.4, with the same result under the Homebrew cargo 1.98.1 and rustup's 1.99.0. That is not part of this change, so I put the hunk back by hand; cargo metadata --locked accepts the lockfile.

Checked

Check Result
cargo deny 0.20.2 --locked check (CI's version and flags), lockfile of main fails, on RUSTSEC-2026-0533 alone (advisories FAILED, bans ok, licenses ok, sources ok)
the same, this lockfile passes all four
cargo nextest run --workspace --profile ci --locked 3564 passed, 4 skipped (the oracle_ tests the profile excludes); the three sanitiser tests ran
examples/sanitize_check over the 125 XSS payloads and the editor corpus (431 inputs), 4.2.4 against 4.2.5 output byte-identical in all three forms (plain, stripped, hardened)
the same comparison, ammonia 4.0.0 (probes/ammonia-400) against 4.2.4 7 inputs differ, the count D-019 records, so the comparison can see this kind of change

Not shown

  • That the fix does anything for this configuration. The sanitiser's output does not change on any corpus input, so the corpus does not exercise it. The allow-list adds mention-component, label, input and image-component to ammonia's defaults and no math, svg or raw-text tag, and the advisory says applications that allow none of those "should not be affected". That is the advisory's claim; I did not test the advisory's payload.
  • The doctests were not run locally; CI runs them.
  • The corpus has 431 inputs where D-019 records 430. I did not chase the extra one.

Left alone

  • probes/ammonia-400 pins =4.0.0, which the advisory does not list as patched. It is a separate workspace with its own lock, built only by its run.sh to measure the engine inside Plane's nh3, never shipped, and outside what the root cargo deny sees.
  • D-019 and ADR-0012 say "4.2.4 measured". That stays true as a record of what was measured; the comparison above is the 4.2.5 evidence.

🤖 Generated with Claude Code

cargo deny failed on main's push run for #144 (43475094189), and the gate
with it, on this advisory (mutation XSS through embedded SVG and MathML,
dated 2026-11-12, patched in ammonia >= 4.2.5 for the 4.2 line).

ammonia is the sanitiser behind thrust-editor-doc's description_html;
thrust-api-v1, thrust-compat-plane and thrust-editor-worker reach it through
the `sanitize` feature. The manifest already allows 4, so this is a lockfile
change only: ammonia 4.2.4 -> 4.2.5, its version and checksum, nothing else.
`cargo update` also moved tempfile's getrandom from 0.4.3 to 0.3.4; that hunk
is not part of this change and was put back by hand (`cargo metadata
--locked` accepts the result).

Checked:
- cargo deny 0.20.2 (CI's version, `--locked check`): the lockfile on main
  fails on RUSTSEC-2026-0533 alone; this one passes advisories, bans,
  licenses and sources.
- cargo nextest run --workspace --profile ci: 3564 passed, 4 skipped (the
  oracle_ tests the profile excludes), the three sanitiser tests among them.
- examples/sanitize_check over the 125 XSS payloads and the editor corpus
  (431 inputs): the sanitiser's output (plain, stripped and hardened) is
  byte-identical on 4.2.4 and 4.2.5. Control: 4.0.0 (probes/ammonia-400)
  differs from 4.2.4 on 7 of the same inputs, so the comparison can see this
  kind of change.

Not shown: that the fix does anything for this configuration. The output
does not change on any corpus input, so the corpus does not exercise it; the
allow-list adds no math, svg or raw-text tag to ammonia's defaults, so by the
advisory's own text this code should not have been affected. Not tested with
the advisory's payload. The doctests were not run locally; CI runs them.
probes/ammonia-400 still pins =4.0.0 on purpose: a separate workspace with its
own lock, never shipped, outside cargo deny's reach.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​ammonia@​4.2.4 ⏵ 4.2.510010093100100

View full report

@aRustyDev
aRustyDev merged commit ec37114 into main Nov 13, 2026
35 checks passed
@aRustyDev
aRustyDev deleted the fix/deps-ammonia-rustsec-2026-0533 branch November 13, 2026 19:40
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