Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ ignore = [
# requires migrating hyper 0.14 -> hyper 1 / tonic 0.12. Tracked migration.
"RUSTSEC-2026-0258",

# rsa 0.9.10 — Marvin timing side-channel on RSA private-key operations. The fix is only
# in rsa 0.10, and 0.9.x has no backport. rsa is a direct dependency of transferd-crypto:
# the ghost-key issuer performs raw RSA private-key operations on blinded messages
# (ghostkey.rs, sign_blinded), so this is a live exposure for an issuer. Accepted only
# until rsa 0.10 is adopted.
"RUSTSEC-2023-0071",

# bincode 1.3.3 / 2.0.1 — unmaintained. bincode is the core wire format used
# by every protocol envelope; migrating to a maintained fork (bincode 3) is a
# tracked, separate task and cannot be done as a dependency bump.
Expand Down Expand Up @@ -53,6 +46,14 @@ ignore = [
"RUSTSEC-2026-0002",
"RUSTSEC-2026-0253",

# RUSTSEC-2026-0387 — crypto-bigint 0.5.5, multiple timing-variability issues.
# Exact path: transferd-webrtc -> webrtc 0.12 -> webrtc-dtls 0.11 -> p256 -> ecdsa -> crypto-bigint 0.5.5.
# Reachable from any WebRTC peer during DTLS: the handshake's ECDH and ECDSA run on this path.
# The fix is only in crypto-bigint >=0.7.6; webrtc-dtls 0.11 pins the 0.5 line. The clearing change is
# the webrtc 0.21 migration of transferd-webrtc (a rewrite, not a version bump).
# Time-boxed: remove by 2026-12-31 via that migration; deadline tracked by the maintainer.
"RUSTSEC-2026-0387",

# RUSTSEC-2026-0620 — curve25519-dalek 4.1.3, scalar-multiplication bug in the AVX-512 backend. The fix is
# only in curve25519-dalek 5.1.0, which needs ed25519-dalek 3 and x25519-dalek 3 (direct dependencies of
# transferd-crypto, both 2.x now): a major bump with API changes, not a lockfile bump. The bug is reached only
Expand Down
119 changes: 92 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions ci/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,31 @@ class Finding:
fix: str = ""


# The variables that point git at one repository. A git hook sets them to the repository it runs for, so a temporary
# repository created with them inherits that repository and can rewrite its config.
_REPOSITORY_VARIABLES = (
"GIT_DIR",
"GIT_WORK_TREE",
"GIT_INDEX_FILE",
"GIT_COMMON_DIR",
"GIT_OBJECT_DIRECTORY",
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
"GIT_PREFIX",
)


def clean_git_env() -> dict:
"""The environment for git that finds its repository from the working directory, as in a shell."""
return {k: v for k, v in os.environ.items() if k not in _REPOSITORY_VARIABLES}


def git(root: Path, *args: str) -> Tuple[int, str]:
"""Run git in the repository and return its exit code and standard output."""
try:
done = subprocess.run(
["git", *args],
cwd=root,
env=clean_git_env(),
capture_output=True,
text=True,
encoding="utf-8",
Expand Down
9 changes: 5 additions & 4 deletions ci/tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from checks import ( # noqa: E402
clean_git_env,
eol_findings,
git_bash,
hooks_findings,
Expand Down Expand Up @@ -188,29 +189,29 @@ def repo(self):
tmp = tempfile.TemporaryDirectory()
self.addCleanup(tmp.cleanup)
root = Path(tmp.name)
subprocess.run(["git", "init", "-q"], cwd=root, check=True)
subprocess.run(["git", "init", "-q"], cwd=root, check=True, env=clean_git_env())
return root

def test_a_staged_key_and_trailing_whitespace_are_found(self):
root = self.repo()
(root / "keys.txt").write_text(KEY_HEADER + "\n", encoding="utf-8")
(root / "notes.txt").write_text("trailing \n", encoding="utf-8")
subprocess.run(["git", "add", "-A"], cwd=root, check=True)
subprocess.run(["git", "add", "-A"], cwd=root, check=True, env=clean_git_env())
found = messages(staged_findings(root))
self.assertTrue(any("private key added to keys.txt" in m for m in found), found)
self.assertTrue(any("staged changes have problems" in m for m in found), found)

def test_a_large_staged_file_is_an_error(self):
root = self.repo()
(root / "big.bin").write_bytes(b"x" * 2048)
subprocess.run(["git", "add", "-A"], cwd=root, check=True)
subprocess.run(["git", "add", "-A"], cwd=root, check=True, env=clean_git_env())
found = staged_findings(root, limit=1024)
self.assertTrue(any("big.bin" in m and "staged" in m for m in messages(found)))

def test_a_clean_stage_has_no_findings(self):
root = self.repo()
(root / "ok.txt").write_text("plain text\n", encoding="utf-8")
subprocess.run(["git", "add", "-A"], cwd=root, check=True)
subprocess.run(["git", "add", "-A"], cwd=root, check=True, env=clean_git_env())
self.assertEqual(staged_findings(root), [])


Expand Down
4 changes: 3 additions & 1 deletion crates/transferd-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ hex = "0.4"
serde = { version = "1", features = ["derive"] }
bincode = "1"
# ghost keys (src/ghostkey.rs): RFC 9474 blind RSA signatures
rsa = { version = "0.9", features = ["hazmat", "sha2"] }
rsa = { version = "0.10", features = ["hazmat"] }
# the operating-system RNG for rsa 0.10 (ghostkey.rs rsa_rng); already in the lock file
getrandom = "0.4"
sha2 = "0.10"
num-bigint-dig = { version = "0.8", features = ["rand"] }
num-traits = "0.2"
Expand Down
Loading
Loading