Skip to content

Security: Moskyera/protector

Security

SECURITY.md

Security

Protector is a local, offline, single-file secret vault. This document states what it defends against, what it does not, and how to report a problem. It is deliberately specific: a threat model that claims everything is a threat model that promises nothing.


Reporting a vulnerability

Open a private security advisory on the repository (Security → Advisories → Report a vulnerability). Do not open a public issue for anything that could be used against existing vaults before there is a fix.

Please include the version, platform, and a concrete way to reproduce. Expect a first response within a week. This is a small project with no bug bounty and no paid security team: what it offers instead is that reports get read and answered by someone who understands the code.


What Protector defends against

Threat How
Someone obtains the .protector file AES-256-GCM over a random DEK, wrapped by an Argon2id-derived KEK. Without the master password the file is ciphertext and a header.
Someone guesses the master password offline Argon2id at 256 MiB / t=3 / p=4, calibrated upward per machine, plus an enforced ~75-bit entropy floor. New vaults also require a key file by default, so a stolen copy cannot be guessed against at all: 512 bits of the key were never in it.
Someone tampers with the file Every blob is AEAD-authenticated with the header bound in as AAD, plus an explicit key-commitment tag. Modified files fail to open and say why.
Someone splices ciphertext between saves vault_id and a monotonic epoch are inside the AAD, so a blob from one save does not authenticate against another.
Two sessions overwrite each other An exclusive advisory lock is held for the whole open→save window, with a save-time generation check as a backstop.
A secret lingers on the clipboard Timed auto-clear, cleared on lock and on exit, and excluded from Windows Clipboard History and Cloud Clipboard.
An attacker at an unattended machine Auto-lock drops and zeroizes the vault, and wipes the editor's undo history so a locked field cannot be undone back into a password. Minting recovery shares re-asks for the master password.
Another program reading this one's memory At startup the process rewrites its own DACL (Windows) or clears PR_SET_DUMPABLE (Linux), so a same-user, non-elevated process is refused PROCESS_VM_READ / ptrace. Verified by a test that tries it. Does not stop an administrator or root.
A secret appearing in a screen share or Windows Recall The window sets WDA_EXCLUDEFROMCAPTURE on Windows, so capture APIs see black. Microsoft documents this as best-effort, not a boundary. No Linux equivalent exists.
A forged release or update Not yet defended. Two mechanisms are implemented and neither is switched on: no SLH-DSA signing key has been generated, and no Authenticode certificate has been obtained. Until both are, a forged build is not detectable. See "Release integrity" and "Code signing" below.
A malicious dependency cargo-deny gates advisories, licences, banned crates and source registries on every push and weekly. No git dependencies; every input comes from crates.io and is pinned in Cargo.lock.

What Protector does not defend against

Being explicit here matters more than the list above.

  • A compromised machine. If an attacker runs code as you, they can keylog the master password, read the DEK out of process memory while the vault is open, screenshot the window, or replace the binary. No local password manager solves this, and any that claims to is misleading you.
  • Memory forensics of an unlocked vault. Same-user processes are now refused, but an administrator is not, and there is still no page locking. See "Where the memory boundary actually is" below for exactly what is and is not covered.
  • A stolen or subverted key file. It is a second factor, not a second secret: it does not help if the attacker also has the password.
  • Shamir shares. k shares reconstruct the DEK directly, below both the password and the key file. Anyone assembling k shares owns the vault. Store them somewhere no single compromise reaches all of them.
  • Rollback to an older copy of your own vault file. Nothing binds a vault to a monotonic on-disk generation across files, so restoring an old backup is accepted silently. An attacker who can write to your filesystem and holds an old copy can revert a password change.
  • Metadata. The header discloses the KDF parameters, whether Shamir and a key file are configured, and the format version. The file size discloses roughly how much you store. The payload is not padded.
  • Deleted secrets, immediately. Entry history keeps up to 10 previous versions and the trash holds entries for 30 days; both live inside the vault until purged.
  • Traffic analysis, phishing, or a malicious website. There is no browser integration, no autofill and no network code, so Protector neither creates nor mitigates these.

Where the memory boundary actually is

This is the part most password managers are vague about, so here it is plainly.

What is done. Keys and entry secrets are zeroized on drop. The Argon2id working memory (256 MiB to 1 GiB, from which the key is directly recoverable) is owned and wiped rather than handed back to the allocator. The vault payload is serialized into a single pre-sized buffer so the JSON encoder does not abandon a doubling series of plaintext copies. Panic payloads are suppressed in release. The process refuses PROCESS_VM_READ to same-user processes.

What is not done, and cannot be. Secrets still pass through String buffers that egui owns, and a revealed password reaches a text layout, a font atlas and a GPU texture, none of which this code can wipe. There is no page locking, so the operating system may write key material to the pagefile. Hibernation writes all of RAM to disk regardless of any of this. An administrator, or root, bypasses every process-level control here by design of the operating system.

The honest summary. While the vault is unlocked, treat its contents as readable by anything with administrator rights on the machine, and by anything running inside this process. Locking is what shortens that window, which is why auto-lock is on by default and why the timer is worth keeping short. KeePassXC states the same boundary and 1Password's white paper does not claim better.

The quantum question, honestly

Protector uses no quantum-vulnerable cryptography. There is no RSA, no elliptic curve, and no Diffie–Hellman anywhere in the vault.

That is a much smaller claim than "quantum-proof", and it is the accurate one.

Grover's algorithm is the only quantum attack that touches a symmetric-only design, and against AES-256 it is not a practical one. The best published circuit-level estimates put the cost at 2^190–2^245 gates depending on the depth limit assumed (Jaques et al., Eurocrypt 2020), and once surface-code error correction is priced in the quantum attack costs more than the 2^256 classical one (UK NCSC, 2024). "Grover halves AES" is a query count, not a cost model.

Argon2id is even more hostile to it: a coherent search would have to hold the full 256 MiB working set in logical qubits, in superposition, for the entire computation.

Post-quantum cryptography (ML-KEM, ML-DSA) exists to replace asymmetric algorithms broken by Shor's algorithm. The vault has none, so there is nothing to replace. The one place PQC genuinely belongs in this project is release signing, and that is where it is used: see below.

Shamir Secret Sharing over GF(2^8) is worth stating separately: it is information-theoretically secure. Fewer than k shares reveal zero information to any adversary, with unbounded time and any computer.

Your master password is the weakest link, not the cipher. A 256-bit key derived from a 40-bit password gives you 40 bits. Use the built-in generator.


Release integrity

Status: the machinery exists, the trust anchor does not. No release signing key has been generated, RELEASE_PUBLIC_KEY_HEX in protector-sign is empty, and the installers do not verify anything. Until a key is generated and published, a forged build is not detectable and the paragraphs below describe a capability rather than a protection in force.

To close this: run protector-sign keygen, paste the printed key into RELEASE_PUBLIC_KEY_HEX, publish it somewhere that is not the download page, and make the installers call protector-sign verify and abort on failure.

The signing tool uses SLH-DSA-SHA2-128s (FIPS 205). A hash-based signature whose security reduces to the hash function alone, with no lattice or number-theoretic assumption. This is what CNSA 2.0 requires for software and firmware signing, on the reasoning that a signing key must outlive its assumption, and lattice assumptions are young.

Once a key exists, a release is verified with:

protector-sign verify --manifest SHA256SUMS --pubkey protector-release.pub

This checks the signature over the manifest and then the hash of every listed file. Verifying a download with a binary from that same download is circular and proves nothing. It is meaningful in two cases: verifying an update once you have a copy you trust, and verification by anyone holding the public key from a channel other than the download page.

To rebuild a release yourself and compare:

scripts/release.sh
diff dist/SHA256SUMS path/to/published/SHA256SUMS

The build pins the toolchain (rust-toolchain.toml), uses --locked, codegen-units = 1, and remaps absolute build paths. CI rebuilds the CLI twice and fails if the bytes differ.

Every release also ships BUILDINFO (toolchain, commit, flags) and a CycloneDX SBOM of all ~500 transitive dependencies.


Code signing (Authenticode)

Authenticode is the signature Windows checks by itself, without the user doing anything. It is what turns "Windows protected your PC: unknown publisher" into a normal install, and what makes a tampered binary fail before it runs.

It matters more, for an ordinary user, than the SLH-DSA manifest signature described above. The two do different jobs and both are worth having:

Enforced by Protects against Effort for the user
Authenticode Windows, automatically A modified or unsigned binary None
protector-sign The user, deliberately A forged release, verified against a published key Runs a command

Status

Not yet in force. No certificate has been obtained, so releases are unsigned. scripts/sign-windows.ps1 implements the whole process and can be rehearsed today with -SelfSigned.

What to buy

An OV (Organisation Validation) code-signing certificate, roughly 150-400 EUR per year. Since June 2023 the CA/Browser Forum requires the private key to live on hardware (a FIPS 140-2 Level 2 token or an HSM), so OV and EV now differ mainly in price and in how quickly SmartScreen reputation accrues, not in key protection.

EV (600 EUR and up) buys immediate SmartScreen reputation rather than earning it over the first few hundred downloads. Worth it only if the unknown-publisher warning during the first weeks would matter.

Both require a verifiable legal entity: a registered business or sole trader. A certificate cannot be issued to an individual with no registration, which is the real barrier for a personal project, not the money.

Signing a release

# Rehearse the pipeline with a throwaway certificate
.\installer\build.ps1 -SignSelfSigned

# Real certificate, private key on a hardware token
.\installer\build.ps1 -SignThumbprint <thumbprint>

# Check what is about to be published
.\scripts\sign-windows.ps1 -VerifyOnly

Signing is part of the installer build rather than a separate step, so a release cannot be published unsigned by forgetting to run something.

Two details that are easy to get wrong

Timestamping is not optional, and the script refuses to sign without it. An untimestamped signature stops validating the day the certificate expires, which for a one-year certificate means every release ever shipped becomes an unknown-publisher warning on that date. With an RFC 3161 timestamp the signature outlives the certificate.

Order matters. The binaries are signed before they are packaged, and the installer afterwards. Reversing that leaves the installer's signature describing content that no longer matches.

What Authenticode does not do

It does not make the code immutable. An administrator can replace any file on the machine. What it changes is that the replacement is detectable: Windows validates the signature at load, and an altered binary fails that check. Where the program is installed matters just as much, and for a different reason: Program Files is writable only by administrators, so malware running with the user's own privileges cannot swap the binary there. A portable build unpacked into a user-writable folder has no such protection.

Known trade-offs

Accessibility is off by default. AccessKit publishes the widget tree to the OS accessibility API, which would expose revealed secrets and live TOTP codes to any process with UI Automation or AT-SPI access. Build with --features accessibility if you use a screen reader; the exposure is real, and so is the cost of not having it.

Argon2id at 256 MiB makes unlocking slow on old hardware. That is the intended direction of the trade. Doubling memory buys one bit of security; adding one word to your passphrase buys eleven. The parameters are the floor, not the lever.

No breach checking. A HIBP k-anonymity lookup is genuinely privacy-preserving, but it would be the first network request this application ever makes. That is a decision for the user, not a default.

Four dependency advisories are accepted, not fixed: see deny.toml for the per-advisory reasoning. All are in the GUI stack: unmaintained crates with no known vulnerability, or DoS issues in parsers reached only by the opt-in accessibility feature.


Cryptographic summary

Purpose Primitive
Payload and DEK encryption AES-256-GCM, random 96-bit nonce per operation
Key derivation Argon2id, 256 MiB / t=3 / p=4 default, runtime-calibrated
Key commitment HMAC-SHA-512 truncated to 256 bits
Key file mixing HMAC-SHA-512(KEK, domain ‖ SHA-256(file))
Recovery sharing Shamir over GF(2^8), information-theoretically secure
TOTP HMAC-SHA-1 (RFC 6238, required by the services, not chosen)
Release signing SLH-DSA-SHA2-128s (FIPS 205)
Password strength zxcvbn, ~75-bit floor, generator targets ~110 bits

There has been no third-party security audit. The code is open, the threat model is above, and the findings this project has already acted on came from an internal review, not from an independent one. Weigh that accordingly.

There aren't any published security advisories