Skip to content

fix(deps): bump pdf-extract 0.10→0.12 to patch lopdf RUSTSEC-2026-0187#6339

Merged
houko merged 2 commits into
mainfrom
fix/lopdf-rustsec-2026-0187
Jun 26, 2026
Merged

fix(deps): bump pdf-extract 0.10→0.12 to patch lopdf RUSTSEC-2026-0187#6339
houko merged 2 commits into
mainfrom
fix/lopdf-rustsec-2026-0187

Conversation

@houko

@houko houko commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

A new high-severity advisory — RUSTSEC-2026-0187 (CVSS 7.5, published 2026-06-21) — reports a stack overflow in lopdf when parsing deeply nested PDF objects.

lopdf 0.38.0 reaches us transitively through pdf-extract 0.10.0, a direct dependency of librefang-channels and librefang-runtime. pdf-extract 0.10 pins lopdf ^0.38, so the fixed lopdf >= 0.42.0 is unreachable without bumping pdf-extract itself.

This made the Security CI job (cargo audit) fail repo-wide on every PR (exit 1) — the advisory is not in the ci.yml --ignore allowlist. It is currently blocking #6338 (and would block any PR / the next release).

Why it's attacker-reachable

Both crates feed user-supplied PDF attachment bytes straight into pdf_extract::extract_text_from_mem:

  • crates/librefang-channels/src/attachment_enrich.rs
  • crates/librefang-runtime/src/pdf_text.rs

A crafted PDF can drive the overflow. The existing catch_unwind guards at both sites do not mitigate this: a stack overflow aborts the process rather than unwinding, so catch_unwind never runs. The dependency upgrade is the real fix, not a defense-in-depth nicety.

Fix

Bump pdf-extract 0.100.12 in both crates and regenerate Cargo.lock. pdf-extract 0.12.0 (published 2026-06-25) requires lopdf ^0.42, pulling the patched lopdf 0.42.0.

Lockfile delta (minimal):

  • lopdf 0.38.0 → 0.42.0 (the fix)
  • pdf-extract 0.10.0 → 0.12.0
  • cff-parser 0.1.0 → 0.2.0
  • drops bytecount, nom_locate (no longer in the tree)

The only pdf-extract API used — extract_text_from_mem(&[u8]) -> Result<String, _> — is unchanged across the bump; both call sites already treat the error via Display, so no source changes are needed.

Changed files

  • crates/librefang-channels/Cargo.tomlpdf-extract = "0.12"
  • crates/librefang-runtime/Cargo.tomlpdf-extract = "0.12"
  • Cargo.lock — regenerated via cargo update -p pdf-extract --precise 0.12.0
  • CHANGELOG.md[Unreleased]### Fixed entry

Verification

  • cargo audit no longer flags RUSTSEC-2026-0187 once lopdf 0.42.0 is in the lock (verify via the Security CI job on this PR going green).
  • Compile verification is left to CI (Test / Unit (lib+bin) + build lanes) per the repo's "no local cargo build" rule; the API surface touched is a single unchanged function.

Out-of-scope note (not touched here)

The existing ## [Unreleased] section in CHANGELOG.md sits below the already-released ## [2026.6.26] section and re-lists several PRs (#6312, #6315, #6316, #6330) that also appear under 2026.6.26 — a pre-existing release-tooling artifact, not introduced by this PR. Left as-is to keep this change scoped; flagging for a maintainer.

A new high-severity advisory (RUSTSEC-2026-0187, CVSS 7.5, published 2026-06-21) reports a stack overflow in lopdf when parsing deeply nested PDF objects. lopdf reaches us transitively through pdf-extract 0.10.0 — a direct dependency of librefang-channels and librefang-runtime — which pins lopdf ^0.38, so the fixed lopdf >=0.42.0 is unreachable without bumping pdf-extract itself.

The path is attacker-reachable: both crates feed user-supplied PDF attachment bytes straight into pdf_extract::extract_text_from_mem (crates/librefang-channels/src/attachment_enrich.rs, crates/librefang-runtime/src/pdf_text.rs), so a crafted PDF can drive the overflow. The existing catch_unwind guards at those sites do NOT mitigate it — a stack overflow aborts the process rather than unwinding, so catch_unwind never runs. The dependency upgrade is the actual fix.

pdf-extract 0.12.0 (published 2026-06-25) requires lopdf ^0.42, so bumping the requirement in both crates and regenerating Cargo.lock pulls the patched lopdf 0.42.0 (also pdf-extract 0.10.0→0.12.0, cff-parser 0.1→0.2; drops bytecount/nom_locate). The only public API used — extract_text_from_mem — is unchanged across the bump.

Without this, the Security CI job (cargo audit) fails repo-wide on every PR with exit 1: the advisory is not in the ci.yml --ignore allowlist, and it should be patched rather than ignored because a fixed release exists.
@github-actions github-actions Bot added area/docs Documentation and guides area/channels Messaging channel adapters area/runtime Agent loop, LLM drivers, WASM sandbox size/XS < 10 lines changed labels Jun 26, 2026
@houko
houko enabled auto-merge (squash) June 26, 2026 11:42
@houko
houko merged commit 12c3daf into main Jun 26, 2026
33 checks passed
@houko
houko deleted the fix/lopdf-rustsec-2026-0187 branch June 26, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/channels Messaging channel adapters area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox size/XS < 10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant