Skip to content

fix(security): resolve cargo audit advisories + bump crux to 0.19 - #124

Merged
JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:fix/cargo-audit-security-deps
Jul 7, 2026
Merged

fix(security): resolve cargo audit advisories + bump crux to 0.19#124
JanZachmann merged 3 commits into
omnect:mainfrom
JanZachmann:fix/cargo-audit-security-deps

Conversation

@JanZachmann

@JanZachmann JanZachmann commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Backend security/audit fixes

  • quinn-proto 0.11.14 → 0.11.16 — clears RUSTSEC-2026-0185 (high, 7.5: remote memory exhaustion via unbounded out-of-order stream reassembly; via reqwest)
  • anyhow 1.0.102 → 1.0.103 — clears RUSTSEC-2026-0190 (unsound Error::downcast_mut())
  • rustls-pemfile (unmaintained, RUSTSEC-2025-0134, no newer version) → migrated to the rustls-pki-types pem API in load_tls_config. PrivateKeyDer::from_pem_file auto-detects PKCS#1/PKCS#8/SEC1, collapsing the previous manual key-type match.

Crux core bump

  • crux_core 0.17→0.19, crux_http 0.16→0.19, crux_macros 0.8→0.10, crux_time 0.15→0.17 (in src/app + src/shared_types).
  • The crux testing helpers (Command/Effect expect_*, ResponseBuilder) moved behind feature flags in 0.19; enabled as dev-dependencies (crux_core testing, crux_http http-types) so they stay out of the WASM/production build.
  • http_helpers tests adapted: ResponseBuilder::with_status now takes u16; crux_http re-exports http::StatusCode (OK/SERVICE_UNAVAILABLE).
  • Adopted the fluent <Effect>TestExt assertions added in crux 0.18 (expect_only_web_socket_with, expect_only_http_with, expect_render().expect_http_with, expect_http_with) in the auth/websocket/wifi/reconnection tests — removes manual expect_effect()/find_map/split() boilerplate (net −32 lines). Position-independent timer helpers (find_time_effect, collect_time_effects) kept, since the order-based fluent API does not fit find-among-many checks.

Version

  • Workspace version 1.2.4 → 1.2.5.

Reason

cargo audit flagged a high vulnerability, an unsoundness advisory, and an unmaintained direct dependency — all backend, all independently fixable. The crux bump keeps the Core current.

No frontend (src/ui) dependency changes — the UI is built with --frozen-lockfile.

Out of scope (documented, not fixed):

  • rsa (RUSTSEC-2023-0071, Marvin Attack) — no upstream fix; transitive via jsonwebtoken.
  • bincode + proc-macro-error (unmaintained) — transitive via crux. The crux 0.19 bump does not clear these; crux still pulls both in. Not fixable without upstream crux dropping them.

Verification

  • cargo build, cargo clippy --features mock --all-targets (pedantic+nursery, clean), cargo test --features mock (368 pass), cargo +nightly fmt
  • wasm-pack build (production; testing feature absent) clean
  • TypeScript bindings regenerated
  • Full Playwright e2e suite: 133/133 pass
  • cargo audit: rustls-pemfile gone from tree; remaining findings are the out-of-scope items above.

Summary:
- Update quinn-proto 0.11.14 -> 0.11.16 (RUSTSEC-2026-0185, high:
  remote memory exhaustion via unbounded out-of-order stream reassembly)
- Update anyhow 1.0.102 -> 1.0.103 (RUSTSEC-2026-0190: unsound
  Error::downcast_mut())
- Replace unmaintained rustls-pemfile (RUSTSEC-2025-0134) with the
  rustls-pki-types pem API in load_tls_config; from_pem_file auto-detects
  PKCS#1/PKCS#8/SEC1 keys, collapsing the previous key-type match
- Bump workspace version 1.2.4 -> 1.2.5

Reason:
- cargo audit reported one high vulnerability, one unsoundness advisory
  and an unmaintained direct dependency. Frontend (crux) transitive
  warnings (bincode, proc-macro-error) and the no-fix rsa advisory
  (via jsonwebtoken) are out of scope.

Verification:
- cargo build, cargo clippy --features mock (pedantic+nursery clean),
  cargo test --features mock (all pass), cargo +nightly fmt
- cargo audit: rustls-pemfile no longer in dependency tree

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Summary:
- crux_core 0.17 -> 0.19, crux_http 0.16 -> 0.19,
  crux_macros 0.8 -> 0.10, crux_time 0.15 -> 0.17 (in app + shared_types)
- The crux testing helpers (Command/Effect expect_*, ResponseBuilder)
  moved behind feature flags in 0.19. Enable them as dev-dependencies
  (crux_core "testing", crux_http "http-types") so they stay out of the
  WASM/production build.
- Adapt http_helpers tests: ResponseBuilder::with_status now takes u16,
  and crux_http re-exports http::StatusCode (OK/SERVICE_UNAVAILABLE).

Reason:
- Keep the Crux core current. Note: this does not clear the bincode /
  proc-macro-error unmaintained warnings; crux 0.19 still pulls both in.

Verification:
- cargo build, cargo clippy --features mock (clean),
  cargo test --features mock (368 pass), cargo +nightly fmt
- wasm-pack build (production, testing feature absent) clean
- TypeScript bindings regenerated; full e2e suite 133/133 pass

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann changed the title fix(security): resolve cargo audit advisories in backend deps fix(security): resolve cargo audit advisories + bump crux to 0.19 Jul 7, 2026
Summary:
- Convert single- and known-order effect assertions to the fluent
  <Effect>TestExt API added in crux 0.18 (expect_only_web_socket_with,
  expect_only_http_with, expect_render().expect_http_with, expect_http_with).
- Removes the manual expect_effect()/find_map/split() boilerplate in
  auth, websocket, wifi and the reconnection healthcheck test.
- Keep the position-independent timer helpers (find_time_effect,
  collect_time_effects): the fluent API is order-based and does not fit
  find-among-many / multi-timer membership checks.

Reason:
- The 0.19 bump exposed the fluent assertion API; using it makes the
  effect tests shorter and read top-to-bottom in effect order.

Verification:
- cargo test --features mock (368 pass), cargo clippy --features mock
  --all-targets (clean), cargo +nightly fmt
- Test-only changes (#[cfg(test)]): WASM/production build and e2e unaffected

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann
JanZachmann merged commit 8e06244 into omnect:main Jul 7, 2026
2 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