*/snf security report
Updated 14 November 2026. Applies to the implementation in this directory. This is an engineering description, not an independent audit, certification, or guarantee.
Current status
Implemented and tested locally: username/password account creation and login; private, browser-encrypted vault storage; saving/removing encrypted website bookmarks and optional third-party account credentials; user-initiated website opening and clipboard copying; logout, browser inactivity locking, and recovery-phrase sign-in without changing the password. Teal-on-black interface with locally served Fredoka typography and a subtle stock wall texture.
Deployed on 12 November 2026 at https://snafleshub.com. Nginx terminates HTTPS and proxies to a Node service listening only on loopback. The www hostname redirects to the canonical domain. Mobile-sized Chromium testing passed signup, vault save, logout, login/unlock, and removal; desktop rendering and the public security page were also checked. The disposable test account was removed afterward.
Not implemented: cloud-agent execution, Codex integration, automatic website login, credential injection, agent authorization tokens, password changes/reset, MFA/passkeys, automated backups, account deletion/export, or a production audit service. Agent credential access is disabled: there is no agent endpoint or plaintext vault read endpoint.
What is stored
| Item | Stored representation |
|---|---|
| SNF username | HMAC-SHA-256 of a purpose prefix and lowercase username. No plaintext username column. |
| SNF password | scrypt verifier with a separate random salt per account. No plaintext password column. |
| Vault | AES-256-GCM ciphertext, a fresh 96-bit nonce per save, format version, and update revision. |
| Vault derivation salt | Random 128-bit value per account, stored alongside ciphertext. A salt is not a secret. |
| Session | SHA-256 digest of a random 256-bit session token, owner account ID, CSRF token, idle and absolute expiry. |
| Rate limits | Keyed account/IP identifiers, attempt counts, expiry times. |
| Username lookup key | Random 256-bit key in a separate owner-only file, outside the SQLite database. |
The database necessarily links each ciphertext to its account's pseudonymous identifier. Ciphertext length, account existence, and activity may be inferable. “No plaintext” does not mean no personal data or anonymity. Common usernames remain guessable if the server and lookup key are compromised. The application receives the username and master password transiently during HTTPS login and signup; it does not implement a zero-knowledge authentication protocol.
Shops extension — 14 November 2026
The /shops extension reuses SNF authentication, recovery, cookies, CSRF protection and browser vault cryptography. Server-side account IDs determine ownership for shop settings, product edits and seller order reads/transitions. Public customers require no SNF account. Public order creation/submission requires the configured Origin and JSON content type and has a separate persistent request limit. Existing Nginx API limits also apply when deployed.
New additive SQLite tables hold shops, products and orders. Boutique proprietor name, business contact/address, UPI ID/payee, delivery policy and product listings/photos are intentionally public; the form explains this. SNF account usernames are still keyed hashes. Customer name, phone, delivery address, selected size, price, payment destination and transaction reference are stored as server-readable order data, accessible to the owning seller. They are NOT encrypted vault contents. Checkout discloses this and requires customer acknowledgment. Backups now include this order data, so administrator access and retention controls matter.
Order amounts and delivery fees are computed server-side in integer paise. Checkout freezes the product, amount, policy and UPI destination; future catalog/settings changes do not rewrite issued quotes. Random client request IDs make retries idempotent; a derived high-entropy checkout capability is stored only as its hash and authorizes submission of that order. It grants no seller or vault access. Submission expires after 30 minutes; abandoned drafts are removed after 24 hours when another checkout/submission is processed. Submitted orders have no automatic deletion; owners can view the latest 500, and each store is capped at 5,000 stored orders. Account deletion and a retention process remain outstanding before broad rollout.
Customers pay the seller directly outside SNF. A UPI transaction reference is an unverified customer claim. No bank/gateway API is integrated. Sellers must independently check their bank before moving an order to confirmed, then preparing, packed and fulfilled. Marking payment unverified does not issue a refund. SNF never requests a UPI PIN. UPI IDs are format-checked but bank ownership is not verified. Store owners and merchandise are not vetted by SNF.
User-provided HTML is escaped before rendering. Product photos are limited to bounded JPEG/PNG/WebP data with signature checks; SVG and arbitrary remote image URLs are not accepted. The Shops page CSP permits data images for these photos, while retaining same-origin scripts/styles, anti-framing and other protections. The main vault page keeps its existing CSP. A maximum of 200 products per store bounds catalog size; product quantity reservation is not implemented.
Shops adds no automated email/WhatsApp outreach, analytics tracker, subscription collection, gateway payment verification, agent access or cross-origin autofill. Sharing is user-controlled through the device share sheet or clipboard. Backend integration tests pass. Desktop/mobile Chromium checks against a real local HTTP server passed shop registration, products/photos, checkout totals, order submission, seller confirmation through fulfillment, settings, logout/relogin and responsive layout. Existing vault/recovery browser checks also passed. Real UPI-app launching and actual bank settlement remain unverified; no money is moved by the tests. Shops was deployed on 14 November 2026. The production HTTPS seller/customer flow, secure cookie flags and www redirect passed; synthetic test records were removed afterward. No real payment was made. See SHOPS.md for deployment verification and recovery instructions.
Algorithms and parameters
Username indexing: HMAC-SHA-256 with a server key and the prefix user:. Usernames are ASCII letters, digits, dot, underscore, or hyphen; 3–64 characters; case-insensitive. HMAC makes a stolen database alone less useful for dictionary guesses of usernames. The separate key is still available to the running service.
Login verification: Node's scrypt, N=131072 (2^17), r=8, p=1, output 64 bytes. Each account uses a random 256-bit salt encoded as base64url. This follows OWASP's scrypt option; scrypt is used because this runtime provides it directly without additional dependencies. It is not “hashes of hashes.” The cost is approximately 128 MiB of memory per operation. At most two derivations run concurrently. Stored and calculated verifiers are compared with timingSafeEqual. Nonexistent accounts also run the same KDF. Passwords are required to be 15–128 JavaScript code units; no arbitrary symbol rules. A breached-password blocklist is not implemented.
Vault key: Web Crypto PBKDF2-HMAC-SHA-256 with 600,000 iterations, a random 128-bit per-account salt, producing a nonextractable AES-256 key. This is separate from the login verifier. Browser PBKDF2 is chosen for native browser support; it is not memory-hard. A strong, unique master passphrase is important because database theft permits offline guesses against the encrypted vault.
Vault encryption: AES-256-GCM, 96-bit random nonce for every save, 128-bit authentication tag (Web Crypto default), and authenticated context snf-vault-v1. It encrypts the entire saved-site list, including labels, URLs, and any optional usernames/passwords. Bookmark-only entries omit username and password fields. Authentication detects modification or the wrong key. Revisions prevent accidental concurrent overwrites but are not protection against a malicious server replaying an older valid vault.
Hashing is irreversible: third-party sites generally need the original credential, so hashing those credentials would prevent login. Encryption is necessary for recoverable vault data. The browser holds the unlock key and decrypted vault only while unlocked; neither is intentionally written to localStorage, sessionStorage, or IndexedDB. JavaScript cannot guarantee secure memory erasure. Clipboard copies explicitly requested by the user can persist outside the vault.
Recovery phrase (implemented 14 November 2026)
New signups choose and confirm a separate recovery phrase. Existing users can sign in with their password, open Add recovery phrase, and enroll it after re-entering their current password. Use recovery phrase on the login page then accepts the username and that phrase. This unlocks the existing vault directly; it does not reset, reveal, replace, or invalidate the original password. Accounts created by older clients without a phrase remain usable with their password but cannot recover until enrollment.
This phrase is a second authentication secret, not a security question or a personal keyword. Require at least four words and 20–128 characters; choose unrelated words rather than names, birthdays, quotes, or predictable sentences. This minimum does not measure or guarantee entropy. The weakest of the password and recovery phrase determines resistance to account compromise. Recovery is not MFA. Phrases use NFKC normalization, lowercase, trimmed/collapsed whitespace, consistently in browser and server.
The server verifies the phrase with independently salted scrypt (N=131072, r=8, p=1, 64-byte output). A new recovery table stores only the account's pseudonymous ID, salt, verifier, a random browser-KDF salt, and a wrapped vault key. No raw phrase, password, or vault key is stored. The phrase is received transiently over HTTPS for authentication, just like the password; this is not zero-knowledge authentication.
In the browser, the phrase and a separate random 128-bit salt derive an AES-256 key using PBKDF2-HMAC-SHA-256 at 600,000 iterations. AES-256-GCM encrypts the existing 256-bit vault key using a fresh 96-bit nonce, 128-bit tag and the authenticated context snf-recovery-key-v1. The server sends this wrapped key only after successful recovery authentication. The browser unwraps it, imports it as a nonextractable key, then decrypts the ordinary vault. Neither vault contents nor the original password needs to change. Temporary raw-key arrays are cleared where possible; JavaScript cannot guarantee complete memory erasure.
Recovery authentication shares per-account and per-peer attempt limits with login. The supplied Nginx configuration applies the authentication IP limit to login, signup, recovery sign-in and enrollment. Enrollment/replacement additionally requires an authenticated session, CSRF token, correct current password, current vault revision and a phrase different from the password. Replacement revokes other sessions and replaces the old phrase verifier/wrapped key. A recovery-unlocked session has normal vault access but the UI does not offer recovery replacement without the original password.
The recovery phrase is never passed to SNF's browser Credential Management API save helper. Automatic password-manager heuristics remain controlled by the browser; autocomplete hints are not a guarantee against local browser/extension observation. The server uses generic authentication errors for unknown accounts, wrong secrets and missing recovery enrollment. Security guidance: https://cheatsheetseries.owasp.org/cheatsheets/Forgot_Password_Cheat_Sheet.html
Isolation and user scope (implemented)
Every session resolves to exactly one server-side account identifier. Vault updates derive their owner from that session. The API does not accept a requested owner or user ID, so a caller cannot choose another user's storage scope. SQL uses parameterized statements. The database stores one encrypted vault blob per user; it is shared infrastructure with application-level isolation, not one physical database per user. Only that user's login returns their ciphertext, and the password is also needed to decrypt it.
The session cookie uses Secure, HttpOnly, SameSite=Strict, Path=/, and the __Host- prefix. Its random token is stored only as a digest on the server. Requests require the exact configured Origin; authenticated writes additionally require the session CSRF token. Logout deletes the session. Server sessions expire after 15 minutes without a vault write (or, with the Shops extension, a successful seller API request) and absolutely after 8 hours; the browser locks after 5 minutes without keyboard/pointer activity. A reload requires login to unlock again. Cookies and server sessions alone do not supply the vault decryption key.
Responses use no-store, a restrictive Content Security Policy, anti-framing, MIME sniffing prevention, a no-referrer policy, and restricted camera/microphone/location permissions. Production responses set HSTS. The UI uses textContent for user data and loads no third-party-hosted scripts, fonts, or analytics. The licensed font and background texture are served from SNF.
Persistent SQLite rate limits allow at most 10 authentication attempts per account and 60 per backend peer in a 15-minute window. Behind Nginx the peer is loopback, making the latter a shared service cap. The supplied Nginx configuration additionally limits actual client IPs. These conservative limits can deny legitimate users during attacks and need operational tuning. Request sizes and timeouts are bounded. Successful or failed passwords and request bodies are not logged by application code; supplied Nginx API locations disable access logs.
Browser password managers and autofill
Implemented for SNF login: standard username/current-password autocomplete hints and new-password on signup; a POST form fallback so credentials are never submitted in a URL if JavaScript fails; and a feature-detected Credential Management API store request only after successful server authentication and vault decryption. Supporting browsers decide whether to offer saving or updating the SNF login under their normal settings and user controls. Unsupported browsers retain normal form-based password-manager behavior. Browser-store errors do not block login. The website cannot force Chrome to show its generation or save UI.
If you choose to save the SNF login, your browser password manager keeps its own copy of that login, outside the SNF database and vault. That copy follows your browser's encryption/sync settings. Google Password Manager already encrypts passwords and offers on-device encryption; SNF is not claimed to be more secure than Chrome. Saving the master password in any password manager changes which software can unlock the vault.
SNF does not import Chrome's password database, retrieve unrelated sites' passwords, or store third-party credentials as SNF-origin credentials. The vault entry form is a local encrypted-record editor, not the target site's registration form. Generating a new password there does not update an existing account on another website.
The selected approach is on-device use of the user’s existing password manager. SNF now stores an encrypted website bookmark without requiring credentials, and its Open website link opens that HTTPS destination in a separate tab with noopener/noreferrer. The destination’s normal login form and the browser’s password manager handle any autofill, subject to browser settings and user approval. SNF does not read, inject, or automatically submit the destination credentials. This is a user-driven navigation flow, not a built-in cross-site autofill provider or agent-controlled login.
Programmatic cross-site autofill is not implemented; it would require a separately permissioned integration in the browser where the target site runs. A cloud agent does not inherit the user’s local Chrome profile. Mobile Chrome does not support ordinary desktop extensions. A mobile solution requires the platform's supported credential-provider route, rather than pretending a webpage is a system autofill provider.
For future agent-driven filling, preserve the account/owner/task/origin scope below. Invoke only the selected destination's genuine login form, require approval, avoid automatic submission, and give the agent status only. Autofill puts plaintext into the destination's input fields; page scripts and any agent with unrestricted DOM/debugging access may read it. An isolated broker and restricted post-login session remain necessary. Merely using an isolated-world extension script or naming a tool “autofill” does not hide DOM values from a broadly privileged agent.
References: https://developer.chrome.com/docs/modern-web-guidance/guides/forms/autofill-sign-in-form ; https://developer.chrome.com/blog/credential-management-api ; https://www.google.com/chrome/features/password-manager/ ; https://support.google.com/chrome_webstore/answer/1698338
Required design for future cloud-agent use (not implemented)
Storage scope alone is insufficient for safe credential use. Any later integration must meet these requirements before it is enabled:
1. Derive the owner from the authenticated human session. Give each cloud task an immutable user scope and task ID. Never use an agent-supplied user ID as authority.
2. The user explicitly selects one saved account and approves an exact HTTPS origin and an allowed action. Bind approval to owner, vault revision, credential reference, destination origin, task ID, expiry, and a single-use nonce. Agent-generated text cannot grant approval.
3. Give the agent an opaque reference and operation status only. Do not expose vault listing/decryption APIs, master passwords, account credentials, database keys, or reusable session tokens to model context or shared cloud storage.
4. Put credential injection in an isolated broker outside the model/tool transcript. It must verify and atomically consume the authorization at use time, fetch only that owner's chosen credential, enforce exact destination matching after navigation/redirects, and refuse arbitrary URLs, shell commands, or generic fetch operations.
5. Browser-side vault encryption means a cloud broker cannot decrypt independently. A future design needs a user-approved encrypted handoff to a vetted broker or a local browser/extension that performs the injection. It must never “solve” this by persistently storing master passwords or global decryption keys on the cloud agent.
6. Raw stdin is only a transport, not a security boundary. Avoid shell arguments, environment variables, stdout, traces, screenshots, DOM snapshots, clipboard, crash dumps, and tool transcripts containing secrets. Injection code and the destination site still handle the plaintext temporarily. A broker running in a process the agent can inspect cannot keep secrets from that agent.
7. Scope any resulting authenticated browser session too. A session cookie can act as a credential even after the password is hidden. Prevent the agent from inspecting password fields/cookies or changing destinations, exporting credentials, or performing unapproved actions through that session.
8. Make grants short-lived, single-use, and revocable; isolate execution per user/task; keep minimal security event records without secrets; require new approval for a new account, origin, or broader action.
Until that broker exists and is tested, users can open their saved sites on-device and use their existing password manager, or optionally save/copy their own credentials in SNF; the cloud agent cannot use either store. Login to SNF does not itself provision a Codex account or grant access to cloud infrastructure.
Known limits and trust assumptions
A compromised server can serve malicious JavaScript or capture future login passwords. A compromised browser/device, extension, or user-approved clipboard recipient can read secrets. TLS, server patching, deployment integrity, and device security remain essential. This is not independently audited password-manager software and must not be described as “unhackable” or “zero knowledge.” Username/password-only login lacks phishing-resistant MFA. Recovery works only if a phrase was configured before the password was lost. Losing both secrets, or losing a password before enrolling recovery, loses vault access. Losing the lookup key prevents username lookup. Database and key backups must therefore be protected and restore-tested together.
Public registration reveals whether a username can be registered and can be abused; user quotas, breach-password checks, abuse monitoring and capacity planning are future work. The backend uses Node 22's experimental SQLite module; operators must validate the exact runtime before deployment. Account deletion and retention procedures must be implemented before broader customer rollout.
Verification performed
Recovery checks cover real-browser signup, phrase confirmation, wrong-phrase rejection, case/whitespace normalization, decrypting pre-existing vault contents, saving in a recovery session and reopening with the original password, replacement invalidating the old phrase, and CSRF rejection. Direct handler tests cover legacy-account enrollment, password reauthentication, user scope, absent enrollment, shared attempt limiting and absence of plaintext secrets in database/WAL files. Browser tests use disposable isolated data, never customer accounts.
On-device flow tests verify that a saved bookmark decrypts without username/password fields, only HTTPS URLs without embedded credentials are accepted for navigation, new-tab links have no opener, optional encrypted credentials remain supported, and the bottom-right artwork does not overlap the mobile login form. These tests use synthetic credentials with mocked APIs; native password-manager autofill on the destination remains controlled by the user’s browser and has not been automated or asserted by SNF.
Browser integration checks use synthetic credentials and stubbed authentication/store APIs to verify autocomplete switching, POST form semantics, offering browser save only after a successful unlock, excluding failed logins, and graceful handling of unsupported or rejected browser storage. These checks do not verify a real Chrome profile’s password-save dialog, sync, or cross-site autofill.
Passing direct request-handler tests cover registration, login, wrong/missing users, case normalization, weak-password rejection, duplicate registration, unauthorized requests, hostile Origins, CSRF checks, two-user ciphertext separation, stale update rejection, logout revocation, rate limiting, static-source denial, and security headers. Database and WAL contents are checked for test master usernames/passwords in plaintext. Crypto tests verify AES-GCM round trips, wrong-password rejection, and ciphertext-tampering rejection. JavaScript syntax checks pass.
The automated unit tests dispatch requests directly to the HTTP handler. After production access became available, additional tests used the real HTTPS site in Chromium at a 390 × 844 mobile viewport and a 1440 × 1000 desktop viewport. Signup, encrypted vault persistence across logout/login, removal, secure cookie flags, logout, the security report, and absence of uncaught JavaScript errors passed. Public HTTPS response headers and the www redirect were verified. These checks do not establish production load resistance, behavior in every browser, or absence of all vulnerabilities.
A consistent SQLite online backup and the separate lookup key were saved in a root-only local backup directory. An isolated copy passed SQLite integrity and foreign-key checks, and the restored key matched. This checks database/key recovery, not a complete disaster-recovery failover. Backups are currently manual and local, protected by filesystem permissions; encrypted off-host backups and automated retention are not configured. A copy of the original Nginx configuration and placeholder remains available for rollback.
References
- OWASP Password Storage Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
- OWASP Cryptographic Storage Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html
The first reference supports scrypt N=2^17/r=8/p=1 and PBKDF2-HMAC-SHA-256 with 600,000 iterations; the second explains authenticated encryption and key-management limits. They are guidance, not endorsement of this implementation.
Design credits
Fredoka by the Fredoka Project Authors: https://github.com/google/fonts/tree/main/ofl/fredoka — SIL Open Font License 1.1. The original variable font is served locally with its license at https://snafleshub.com/FONT-LICENSE.txt . Used as a freely licensed rounded alternative to Dunkin, not represented as the Dunkin typeface.
Grunge Wall by Adam Anlauf, Subtle Patterns / Toptal: https://www.toptal.com/designers/subtlepatterns/grunge-wall/ . Transparent adaptation downloaded from https://www.transparenttextures.com/grunge-wall.html . The Subtle Patterns collection license is CC BY-SA 3.0: https://github.com/atlemo/SubtlePatterns/blob/gh-pages/README.md and https://creativecommons.org/licenses/by-sa/3.0/ . The PNG is served locally, unedited, with a low-opacity teal/black CSS treatment; the texture and its presentation treatment remain available under CC BY-SA 3.0. Neither creator endorses SNF.