Repository navigation
Audit follow-ups: sealed reports, formula-safe CSV, partial claims said plainly - #47
Merged
Merged
Conversation
…id plainly Findings 11369, 11374, 11379 and 11383 from the security audit of e7073ff. Reports (11374, 11379) - A report is never uploaded without a key. Bulletin is public and permanent, so the job refuses up front instead of falling back to plaintext, and the unused uploadReport path (plaintext) is gone. uploadDailyReport takes only a sealed envelope. - New reports are v3 envelopes: key = scrypt(passphrase, random 16-byte salt, N=2^15 r=8 p=1), salt and parameters in the envelope. The public 32-bit fingerprint of an unsalted SHA-256 key is no longer written; a salted key check tells a wrong key from a damaged copy instead. Readers cap the scrypt cost an envelope may ask for. - Legacy v2 reports still open (and still name the key they need). - A new passphrase needs at least 12 characters. Undo after Clear puts back an older, shorter phrase so its reports stay readable. CSV export (11369) - One escaper for both exports. A text cell starting with = + - @ tab or CR gets a leading apostrophe so a spreadsheet shows it instead of running it; plain numbers such as -5.00 stay numbers. The daily-reports page drops its own copy. Partial coins claims (11383) - The completed screen says "Partial payment" on a warning burst with an alert badge, and names what is missing: "Not paid in full: 7.50 CASH is missing. Only 5.00 of 12.50 CASH arrived." - Telemetry records outcome "partial", not "success". Checked: tsc, vitest (207), eslint, next build, the full e2e suite (133 passed), check:tokens unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
pr47-terminal.paseo · logs |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes four findings from the security audit of
e7073ffc:It completes the audit plan, together with #41 (Voucher mode removed) and #42 (CI / supply chain). The report index contract findings (#11364 / #11386) are deferred. The app does not use the contract while the admin-QR binding is retired.
Reports (#11374, #11379)
uploadReportpath, which uploaded plaintext, is removed.uploadDailyReportnow only accepts a sealed envelope.scrypt(passphrase, random 16-byte salt, N=2^15, r=8, p=1). The salt and parameters are stored in the envelope.keyCheckvalue derived from the salted key lets the app still tell a wrong key from a damaged copy. Testing a guess against it costs one scrypt, the same as against the AEAD tag.N=2^17.CSV export (#11369)
csvCellinlib/export/csv.ts. The daily-reports page drops its own copy.=,+,-,@, tab or CR gets a leading apostrophe, so a spreadsheet shows it as text instead of running it.-5.00stay numbers.Partial coins claim (#11383)
outcome: "partial"instead ofsuccess.Behaviour changes to know
becomeMerchantflag or a direct URL.Test plan
tsc --noEmitvitest: 207 passed, including newreport-cryptoandcsv-exporttests and a test for thepartialtelemetry outcomeeslint, 0 errorsnext buildcheck:tokens, count unchanged🤖 Generated with Claude Code