Sanitization 2.0.0 #27
Closed
eldryoth
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Release 2.0.0
Version 2.0.0 is a security-model release. It preserves the dependency-free,
no_stddefault and canonical volatile wipe backend while making genericstorage, exposure, data-oblivious control state, derive behavior, and native
protection outcomes more explicit and fail-closed.
Protection reports now accept
NotApplicableas satisfying a requested controlonly when the requested secret length is zero. Retired nonempty mappings and
wiped mappings left live but unlocked after release failure are degraded and
cannot satisfy their original protection request. Release evidence also keeps
the original CP-21 source snapshot immutable under a pinned digest while using
a separately named current-source inventory for the evolving release candidate.
The standalone freeze verifier now validates every field of that current
inventory, including source and manifest hashes, feature definitions, package
metadata, and dependency inventories. It resolves supplied paths once and
performs the comparison in-process through the same snapshot implementation as
the capture CLI.
Page-sealed cleanup now attempts mapping release while an unwiped payload is
still locked. If both page normalization and release fail, the poisoned mapping
remains locked for a later cleanup retry, and its protection report continues
to reflect the live lock. Successful release retires the mapping and clears its
current protection-state accounting.
The dependency-free default now enables
asm-compare. Reviewed x86_64 andAArch64 targets therefore use the assembly-backed equal-length equality path
without requiring an opt-in feature. Repeated independent AArch64 Linux
leakage runs rejected the portable fallback as release timing evidence;
default-features = falsestill exposes that fallback, but 2.0 makes noAArch64 timing claim for it.
sanitization-crypto-interopforwards the samedependency-free default for its HMAC and BLAKE3 verification helpers.
wipe::maybe_uninitnow clears non-liveMaybeUninit<T>storage withoutconstructing references to uninitialized byte values. The
sanitization-arrayveccompanion uses this typed path for complete inlinespare-capacity cleanup.
The
sanitization-bytescompanion now requires patchedbytes 1.11.1ornewer, preventing fresh downstream lockfiles from resolving versions affected
by
RUSTSEC-2026-0007.SecureSanitizeOnDropandsecure_drop_struct!now requireDropSafeSanitize + Unpinowners and invoke the complete sanitizer. Generatedfield-wise sanitizers receive the drop-safe marker automatically, while manual
aggregate sanitizers must explicitly attest that destructor-path cleanup is
complete and non-recursive.
The runtime now exact-pins
sanitization-deriveto the matching release, andrelease gates enforce that lockstep so generated runtime trait references
cannot be paired with an older core crate.
Wrapping an existing
bytes::BytesMutnow immediately volatile-clears itsspare capacity so historical bytes from pre-wrap truncation do not survive.
CI now enforces a source, license, wildcard, and duplicate-version policy with
cargo-deny 0.20.2across every Cargo graph. The rustup fallback installer isversioned and SHA-256 pinned instead of executing a downloaded shell script.
The release also refreshes the derive stack to
syn 3.0.0,proc-macro2 1.0.107, andquote 1.0.47, updates serde to1.0.229, and pinsrelease-evidence uploads to
actions/upload-artifact v7.0.1.Linux-specific CSPRNG and page-lifecycle fault-injection helpers are now
compiled only with the Linux tests that exercise them. Supported non-Linux
all-target test builds therefore remain warning-free without suppressing
production lints.
The multi-seed leakage collector now normalizes Unicode formatting whitespace
around command-line arguments, avoiding false "required argument" errors when
commands are copied from rendered documentation or chat clients.
Ownership And Exposure
try_*, removed redundant*_checkedaliases, and kept*_or_paniconly for deliberate fail-stopapplication policy. Fallible generator callbacks use explicit
try_replace_from_fallible_*names.StableSharedSecretStorageandStableMutableSecretStoragecontracts.Generic
Secret<T>exposure now requires an explicit storage-stabilityattestation covering safe shared access, interior mutation, mutable access,
callbacks, guards, trait methods, and destruction.
create temporary copies are reason-bearing
export_*boundaries so theextra secret lifetime is visible and searchable.
SecretBoxBytesfor fixed-allocation runtime-length secret bytes thatnever grow, reallocate, or expose their private backing allocation.
SecretVecandSecretStringgeneration genuinely fallible forcapacity arithmetic and allocation. Added bounded generator constructors
that reject application-defined public maxima before allocation or callback
execution.
SecretAllocationErrorandSecretGenerateError<E>classifications plus bounded slice and UTF-8 string copy constructors.
Bounded character generation now checks worst-case UTF-8 bytes with checked
arithmetic against an explicit byte ceiling.
ReadOnceSecret<T>toConsumeOnceSecret<T>. Its single scopedshared access is claimed atomically and cleared on normal return, returned
errors, and panic unwinding.
Data-Oblivious State
ct::eq_fixed, nativesecret-container CT traits, and crypto-interop HMAC/BLAKE3 verification use
the strict assembly backend when enabled. Path-specific LLVM IR checks now
prove those representative call paths reach that backend.
Choice, masks, andCtOrderingdeclassification reason-bearing andremoved ordinary equality or raw extraction paths that bypassed the review
boundary.
Copy,clear-on-drop
SecretIndexandSecretScalar<T>owners.PublicValue<T>,SecretValue<T>,SecretCtOption, andSecretCtResultso dummy, unselected, mapped, and panic-path secret valuesreceive explicit cleanup.
strict-cttostrict-compareto state its actual scope:assembly-backed equal-length byte equality on reviewed native targets.
zero-sized/drop-bearing test coverage for the native CT API.
Derives And Companion Crates
SecureSanitizeandSecureSanitizeOnDropderives becausegenerated safe code cannot clear inactive variant storage and final-drop
cleanup cannot repair prior transitions. Reviewed manual enums must use
secure_replacebefore every transition; stable-layout structs are preferred.rejected duplicate, malformed, empty, or misplaced helper attributes.
unsafe selection skips remain compile failures.
sanitization-arrayvecso live values are sanitized and droppedbefore the complete inline backing region, including historical spare bytes,
is volatile-cleared.
popandtruncatehandling with valid destructorordering and stale-slot cleanup.
Wiping And Native Hardening
corruption quarantine unconditional even when no checked accessor follows
the corruption. Random expected canaries are non-
Copy, borrowed in place,and clear on ordinary, pooled, and page-sealed teardown.
sanitization::wipeAPI andprivate sealed
wipe_backend; removed misleading best-effort andunsafe-wipecompatibility surfaces.wipe::WipeOnDrop<T>for the audited built-in plain-data set. Publicdownstream representation-erasure implementations remain intentionally
unsupported.
ProtectionRequest, required/preferred policy, structuredProtectionReportoutcomes, and partial setup reports so compiled featuresare not confused with achieved runtime protection.
canary integrity explicit per-container policy outcomes.
SecretPoolwith checked fixed-layout accounting, generation-boundcanaries, failure quarantine, and efficiency reporting.
failures through operation-specific
LockedSecretInitError,PoolInitError,and
SecretPoolGenerateError<E>types. Pool initialization reservesOk(None)exclusively for exhaustion and removes lossy allocation helpers.try_init_withsupports custom protection requests, whilefrom_fillandtry_from_filluse the same configured pre/post integrity checks and clearpartial output on callback failure.
LockedSecretBytesFillError<E>andLockedSecretInitializeError<E>preserve those error classes. Filledreplacements are verified before swap.
slot. Added aggregate quarantine telemetry without exposing addresses,
canary values, or secret bytes.
persistent poison state for standalone locked and guarded owners. Clearing
physical canary words no longer makes a corrupted owner reusable.
SealedSecretBytes<N>with guard pages, fallible page sealing,poisoning/retirement after unsafe transition failures, and multi-page fault
recovery tests. This remains a reviewed optional facility with documented
platform limits, not an infallible secrecy guarantee.
SealedSecretBytes::try_close()with structured page-normalization,unlock, and unmap outcomes. Failed mapping release remains poisoned and
retryable, and retains its memory lock when erasure was not confirmed;
Dropuses the same path as a final best-effort fallback.executed, limited, and unsupported outcomes instead of implying universal
hardware coverage.
runtime requests and reports remain authoritative over feature selection.
LockedSecretBytes::zeroed_hardened_native()andGuardedSecretVec::with_capacity_guarded_native(). Custom deployments retainthe explicit
*_with_protectionpolicy path.ProtectionReport::satisfies,is_degraded, common-control statushelpers, and a zero-allocation unavailable-control iterator while preserving
every detailed report field.
private-policy example. Sensitive roots can reject direct
Secret<T>,marker impls outside approved files, public policy types, and destructor
bypass through
mem::forget,Box::leak, orManuallyDropin CI.Verification And Release Evidence
panic, and codegen-unit profiles.
sanitizer jobs, fail-closed negative fixtures, Miri/Kani coverage, and
downstream migration builds.
baselines for x86_64 Linux, AArch64 Linux, and Apple Silicon.
and GitHub artifact SHA-256 digests in the 2.0 release evidence record.
publishable crates, freezing the CP-21 API before final release metadata.
guarantees, non-guarantees, target, evidence, and verification-tooling docs.
2.0.0crates in dependency order.scan every committed workspace, fuzz, and tooling lockfile.
call sites must use meaningful direct literals rather than dynamic or
placeholder labels; human review remains authoritative.
try_*results through explicit
drop,.ok(), or unhandled underscore bindings,plus lossy pool allocation in production source. Negative fixtures cover
each suppression form while checked propagation and fail-stop handling remain
accepted.
private policy gates, native protection reports, privileged attackers, WASM,
canary response, swap/hibernation, and explicit cleanup.
ordering, and public-length equality decisions while retaining low-level
ChoiceandCtOrderingcomposition APIs.type-selection table, small recipes, and separate feature/advanced guides.
wipe::Wipeto its audited built-in implementations and added adownstream compile-fail guard against no-op
WipeOnDrop<T>implementations.IntegrityResult,MappedResult, the descriptiveSecretIntegrityResultalias,SecretIntegrityResultExt, common?conversions, operation-error mappinghelpers, and one-shot requested-protection report validation.
application error-boundary patterns without collapsing distinct failures
into one global error enum.
AllowlistedSecret<T, P>and a rationale-bearing policy macro soclosed deployments can centrally approve exact storage types while retaining
the independent shared/mutable stability bounds.
time so policy approvals cannot carry blank review metadata.
prove method behavior, interior mutation, guard cleanup, callbacks, or
deferred allocation release.
Migration
This release contains intentional source-breaking changes. Read
docs/MIGRATION_2.0.mdbefore upgrading from
1.2.5. The migration guide covers generic storagebounds, direct versus copied exposure, CT declassification, derives, wipe API
renames, fallible dynamic allocation, ArrayVec behavior, consume-once
ownership, mapped initialization errors, native protection policy, feature
profiles, and deferred experimental facilities.
This discussion was created from the release Sanitization 2.0.0.
All reactions