Skip to content

fix(security): move to yara-x 1.7 and sevenz-rust2, take memf-windows 0.5 - #25

Merged
h4x0r merged 3 commits into
mainfrom
fix/memf-yara-security-migration
Aug 16, 2026
Merged

h4x0r merged 3 commits into
mainfrom
fix/memf-yara-security-migration

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

fix(security): move to yara-x 1.7 and sevenz-rust2, take memf-windows 0.5

Picks up the memf-* crates published today and applies the same migration made
in memory-forensic. Clears the wasmtime and sevenz-rust exposure from this
workspace.

yara-x "0.12" -> "~1.7" (wasmtime 26.0.1 -> 36.0.13)
sevenz-rust "0.6" -> sevenz-rust2 "0.21"
memf-windows "0.4" -> "0.5" (0.5.0 requires yara-x ~1.7)

sevenz-rust is gone from the graph entirely: 0 entries in the lock. It has no
safe upgrade (RUSTSEC-2026-0246, plus the path-traversal arbitrary-file-write),
so the 7z path moves to the maintained fork. decompress_file_with_extract_fn
survives under the same name there, so the call site changes only in its crate
path.

The tilde on yara-x is load-bearing. 1.8+ moves to wasmtime 43.x and NO 43.x
release is patched for GHSA-hgjw-h833-99q9 or its five siblings — the fixed
ranges are 24.0.12, 36.0.13, 46.0.2+ and 47.0.3+. Only the 1.7 line resolves
wasmtime ^36.0.2, reaching the patched 36.0.13. Upgrading to the newest yara-x
looks safer and silently reinstates all six.

The three yara-x companion crates are pinned to 1.7.1 in the lock. yara-x
declares them ^1.7.1, which permits 1.19, and 1.19's yara-x-proto REMOVED a
field 1.7.1's build.rs uses (ModuleOptions.rust_module). Without the pins this
does not compile. Third repo to need them, so treat it as a property of using
yara-x ~1.7 rather than an incident.

memf-strings also had to be updated explicitly: it sat at 0.2.1, which requires
yara-x ^0.12, and a lockfile refresh alone leaves existing entries where they
are. Until it moved, this workspace resolved BOTH yara-x majors and kept
wasmtime 26.0.1 alongside 36.0.13 — the fix would have appeared applied while
the vulnerable stack still built.

Lock churn is deliberately minimal: 65 version lines. A blanket cargo update
moved 312 and pulled browser-forensic-core 0.3.1 alongside 0.2.0, breaking
issen-browser on an unrelated API change. That is reverted; only the packages
the changed requirements force have moved.

NOT FIXED, and not fixable here: lru 0.16.4 remains in the graph via
mft 0.7.0, which requires lru ^0.16.1. That is mft's newest release
(2025-12-23), so RUSTSEC-2026-0253 cannot be cleared from this repo by any
version bump. It needs an upstream fix, a fork, or an argued ignore — a
decision, not an omission.

… 0.5

Picks up the memf-* crates published today and applies the same migration made
in memory-forensic. Clears the wasmtime and sevenz-rust exposure from this
workspace.

  yara-x        "0.12" -> "~1.7"        (wasmtime 26.0.1 -> 36.0.13)
  sevenz-rust   "0.6"  -> sevenz-rust2 "0.21"
  memf-windows  "0.4"  -> "0.5"         (0.5.0 requires yara-x ~1.7)

`sevenz-rust` is gone from the graph entirely: 0 entries in the lock. It has no
safe upgrade (RUSTSEC-2026-0246, plus the path-traversal arbitrary-file-write),
so the 7z path moves to the maintained fork. `decompress_file_with_extract_fn`
survives under the same name there, so the call site changes only in its crate
path.

The tilde on yara-x is load-bearing. 1.8+ moves to wasmtime 43.x and NO 43.x
release is patched for GHSA-hgjw-h833-99q9 or its five siblings — the fixed
ranges are 24.0.12, 36.0.13, 46.0.2+ and 47.0.3+. Only the 1.7 line resolves
wasmtime ^36.0.2, reaching the patched 36.0.13. Upgrading to the newest yara-x
looks safer and silently reinstates all six.

The three yara-x companion crates are pinned to 1.7.1 in the lock. yara-x
declares them `^1.7.1`, which permits 1.19, and 1.19's yara-x-proto REMOVED a
field 1.7.1's build.rs uses (`ModuleOptions.rust_module`). Without the pins this
does not compile. Third repo to need them, so treat it as a property of using
yara-x ~1.7 rather than an incident.

memf-strings also had to be updated explicitly: it sat at 0.2.1, which requires
yara-x ^0.12, and a lockfile refresh alone leaves existing entries where they
are. Until it moved, this workspace resolved BOTH yara-x majors and kept
wasmtime 26.0.1 alongside 36.0.13 — the fix would have appeared applied while
the vulnerable stack still built.

Lock churn is deliberately minimal: 65 version lines. A blanket `cargo update`
moved 312 and pulled browser-forensic-core 0.3.1 alongside 0.2.0, breaking
issen-browser on an unrelated API change. That is reverted; only the packages
the changed requirements force have moved.

NOT FIXED, and not fixable here: `lru 0.16.4` remains in the graph via
`mft 0.7.0`, which requires `lru ^0.16.1`. That is mft's newest release
(2025-12-23), so RUSTSEC-2026-0253 cannot be cleared from this repo by any
version bump. It needs an upstream fix, a fork, or an argued ignore — a
decision, not an omission.
@socket-security

socket-security Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: cargo lzma-rust2 is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ? → cargo/zip@5.1.1 → cargo/lzma-rust2@0.13.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/lzma-rust2@0.13.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

h4x0r added 2 commits August 16, 2026 13:11
…tion

The yara-x/sevenz-rust2/memf-windows migration left `cargo vet` with 64 missing
audits. Resolved with the strongest mechanism that applies at each step.

  - publisher trust for dtolnay, kennykerr, BurntSushi, epage, sunfishcode,
    cuviper, philipc, seanmonstar, fitzgen, Amanieu and alexcrichton, each
    already trusted by the imported mozilla and bytecode-alliance audit sets
  - publisher trust for h4x0r, so our own crates entering the graph are trusted
    rather than exempted
  - exemptions for the remainder, which honestly assert "nobody audited this"

`--allow-multiple-publishers` was deliberately NOT passed: trusting a
multi-publisher crate on one name claims more than is known.

Net posture is markedly better than before the migration: exemptions fall from
859 to 683 distinct crates (186 removed, 10 added) and 381 crates are now fully
audited, with 192 publisher-trust entries.

Newly exempted, i.e. genuinely new unaudited surface — listed rather than
counted, since a count is not reviewable and this is the only part of the change
that adds trust surface. Most are renames or internals of crates leaving in the
same change (wasmtime's -internal- split, bincode 2.x internals, the zstd codec
path reached via sevenz-rust2):

  bincode_derive, psl, psl-types, unty, virtue, wasmtime-internal-asm-macros,
  zeroize_derive, zstd, zstd-safe, zstd-sys

`cargo vet --locked` reports Vetting Succeeded.
…ldable set

All eight fuzz targets failed to build after the yara-x migration:

  error[E0609]: no field `rust_module` on type `ModuleOptions`
    --> yara-x-1.7.1/build.rs:40:32

Same upstream semver break already pinned in the root lock, reaching a place
those pins cannot: `fuzz/` is a deliberately standalone workspace and its
Cargo.lock is gitignored by fleet convention, so CI resolves it from scratch on
every run. yara-x 1.7.1 declares its companions `^1.7.1`, 1.19 satisfies that,
and 1.19's yara-x-proto REMOVED the field 1.7.1's build script reads.

With no lockfile to hold a pin, fuzz/Cargo.toml is the only version-controlled
place that constrains this resolution, so the three companions are declared
there with `~1.7` and a comment saying they are pins for an upstream defect
rather than dependencies this crate uses.

Verified by resolving the fuzz workspace from scratch — the same thing CI does —
and confirming all four yara-x crates land on 1.7.1. The CI failure is the
negative control: without these, resolution picks 1.19 and does not compile.

Carries a removal condition: drop these once yara-x's companion requirements are
correct, or once it moves to a wasmtime range that lets us leave the ~1.7 line.
@h4x0r
h4x0r merged commit d7e4390 into main Aug 16, 2026
17 checks passed
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