Fix/security and correctness issues#683
Merged
llinsss merged 4 commits intoJun 30, 2026
Merged
Conversation
|
@james2177 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #663
closes #664
closes #665
closes #666
FILES CHANGED:
Issue 1 — ZKP hardcoded secret fallback (zkp.service.ts:139)
Removed the ?? 'zkp-dev-secret' fallback. _simulateProof now reads process.env.ZKP_SECRET and throws a descriptive Error if the variable is absent, forcing the app to fail fast at runtime rather than silently using a known-weak secret.
Issue 2 — Wallet network mismatch not validated (wallets.service.ts:201)
Added an explicit guard at the top of prepareTransaction that compares dto.network against wallet.network (stored on the entity). A BadRequestException is thrown with a clear message when they differ, preventing cross-network transaction construction.
Issue 3 — petId not forwarded to expiring-prescriptions query (prescriptions.controller.ts:58-63)
The controller now passes petId as the first argument to getExpiringPrescriptions. The service signature was updated to getExpiringPrescriptions(petId: string, daysWindow = 30) and petId is included in the TypeORM where clause, scoping results to the requested pet.
Issue 4 — Duplicate getRefillReminders (prescriptions.service.ts:267/481)
Inspected the live file — only one implementation exists at line 267 (line 481 is the class closing brace). The single remaining implementation is the complete, correct one that calculates daysUntilRefill per prescription and sorts results. No action needed beyond confirming the duplicate is already gone.