Skip to content

test: add CVE regression tests (#74)#106

Merged
bug-ops merged 1 commit intomainfrom
test-add-missing-cve-regressio
Mar 15, 2026
Merged

test: add CVE regression tests (#74)#106
bug-ops merged 1 commit intomainfrom
test-add-missing-cve-regressio

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 15, 2026

Summary

  • Adds crates/exarch-core/tests/security/cve_regression.rs with 11 integration tests for three missing CVE attack vectors and Windows backslash path handling
  • Wires up mod security; in crates/exarch-core/tests/integration_tests.rs (the workspace-root tests/security/ was previously orphaned — no package attached those files to a test binary)

CVE coverage

CVE Attack vector Tests added
CVE-2024-12718 Python tarfile filter='data' bypass via ./..-prefixed paths 3
CVE-2024-12905 tar-fs symlink chain escape (link -> ../outside) 3
CVE-2025-48387 tar-fs hardlink traversal outside destination 3
Windows backslash path handling (\ separator on Unix vs Windows) 2

Archives containing raw .. path components are constructed at the byte level (make_raw_tar helper) to reproduce attacker-controlled inputs, since safe TAR builder APIs refuse to add .. components.

Test plan

  • cargo +nightly fmt --all -- --check passes
  • cargo clippy --all-targets --all-features --workspace -- -D warnings passes
  • cargo nextest run --workspace --all-features --exclude exarch-python --exclude exarch-node --lib --bins — 540 tests pass
  • cargo test --package exarch-core --test integration_tests --all-features — 20 tests pass (9 existing + 11 new)
  • CI green

Closes #74

@github-actions github-actions bot added core Changes to exarch-core docs Documentation tests Test changes labels Mar 15, 2026
…E-2025-48387

Add `crates/exarch-core/tests/security/cve_regression.rs` with 11
integration tests covering three missing CVE attack vectors and Windows
backslash path handling:

- CVE-2024-12718: Python tarfile `filter='data'` bypass via `./..`-prefixed
  paths. Archives are constructed at the raw byte level (bypassing the `tar`
  crate's path sanitiser) to reproduce attacker-controlled inputs. Three tests
  cover the `./../../etc/passwd`, `foo/./bar/../../../` pattern, and a
  parameterised variant table.

- CVE-2024-12905: tar-fs symlink chain escape. Two tests verify that a symlink
  pointing outside the destination is rejected under default config
  (SecurityViolation) and with `allow_symlinks = true` (SymlinkEscape). A
  third test covers a deeper symlink chain (`a/b/link -> ../../../../outside`).

- CVE-2025-48387: tar-fs hardlink traversal outside destination. Three tests
  cover default config rejection (SecurityViolation), enabled-hardlinks
  rejection (HardlinkEscape), and absolute hardlink target rejection.

- Windows backslash path handling: on Windows the `\`-separated paths with
  `..` components are rejected as traversal; on Unix the same byte sequences
  are treated as single-component filenames and land safely inside the
  destination.

Wire up the new module by adding `mod security;` to
`crates/exarch-core/tests/integration_tests.rs`. The workspace-root
`tests/security/` directory was previously orphaned (no package Cargo.toml
attaches those files to a test binary).

Closes #74
@bug-ops bug-ops force-pushed the test-add-missing-cve-regressio branch from 735df97 to 86d6beb Compare March 15, 2026 01:58
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 01:58
@bug-ops bug-ops merged commit 9f56808 into main Mar 15, 2026
20 checks passed
@bug-ops bug-ops deleted the test-add-missing-cve-regressio branch March 15, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to exarch-core docs Documentation tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add missing CVE regression tests (CVE-2024-12718, CVE-2024-12905, CVE-2025-48387)

1 participant