Repository navigation
fix: high-severity bug sweep - #411
Merged
Merged
Conversation
- infra: allow POST on the bare /reports resource so uploaded reports are saved - expenses: amount input keeps cents; ignore re-submits; drop the receipt when the project changes - projects: redact admin_notes in the overview; roster edits keep hours and start dates - receipts: keys must sit under the expense's own project; sanitize filenames; guard bad %-encoding - auth: register answers a claimed email like an unknown one (no enumeration) - reports: refuse a duplicate objectUrl; keep an object another row still uses; id tiebreak - expenditures: id tiebreak; status re-checked under the row lock (409); null clears fields - donations: allow repeat gifts from a donor to a project (drop the UNIQUE constraint) - frontend: clear cached queries on identity change; transient refresh/me failures keep the session; show set-password errors; donations page no longer needs donors:view; dates parsed as local days; reports selection cleared on filter change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This PR contains a database migration
It will be applied to the production database automatically when this PR merges, before the new lambda code is deployed. Please confirm before requesting review:
This PR also changes 30 files outside |
Contributor
Terraform Plan 📖
|
Contributor
|
Database Types Check Complete The database schema files were modified, but the regenerated TypeScript types are identical to the existing ones. No changes were needed and the type definitions are already up to date. |
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.
Fixes the high-severity findings from a full-app bug sweep.
Backend / infra
/reportsresource only allowed GET, soPOST /reportsnever reached the lambda. Added POST (infrastructure/{aws,preview}/api_gateway.tf); the deployment trigger hashes the method map, so the stage redeploys.GET /projects/:id/overview— now redacted likeGET /expenditures.syncMembershipsnow diffs (delete removed, update changed roles, insert new) instead of delete-all + reinsert.receiptUrlmust sit underreceipts/<expense's project>/on create/PATCH; view and delete use the same check, so one project's row can't read or delete another's receipt. Receipt filenames are sanitized like report uploads; malformed%-encoding no longer throws.INVITATION_REQUIREDas an unknown one.POST /reports409s on an already-registered object; delete keeps an object another row still references.nullnow clears category/description/receipt.UNIQUE (donor_id, project_id)(two one-DDL migrations: add adonor_idindex, then drop the constraint; DSQL supportsDROP CONSTRAINTsince 2026-07). NoIF EXISTS, so a wrong constraint name fails the migrate loudly. Removed the 409 mapping.Frontend
12.50saved $1,250); submit ignores re-entry; changing project after upload clears the receipt./auth/meor refresh keep tokens and retry.donors:view(members got a 403 page);/donorsdropped from its prefetch.parseApiDate) in the expense table, month filter, reports date/year filter and review modal.Notes
Testing
shared/storebuilds + tests pass.--runInBand): expenditures 140, projects 164, reports 145, donors 60, auth unit 81 — all pass. New tests: overview redaction, roster preserves hours, cross-project receipt rejected/not deleted, delete 409 on status change, null clears, duplicate objectUrl 409, shared object kept, repeat donation 201.@aws/dsql-lint@0.2.20and apply on local Postgres.tsc --noEmitclean. Not run: frontend lint/jest, auth e2e (needs the dev server on :3000).🤖 Generated with Claude Code