Skip to content

fix(security): enforce escrow mediation in repayment flow - #116

Open
Joseph-1-Duro wants to merge 3 commits into
TrusTrove:mainfrom
Joseph-1-Duro:fix/route-repayments-through-escrow
Open

fix(security): enforce escrow mediation in repayment flow#116
Joseph-1-Duro wants to merge 3 commits into
TrusTrove:mainfrom
Joseph-1-Duro:fix/route-repayments-through-escrow

Conversation

@Joseph-1-Duro

Copy link
Copy Markdown

close #59

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Joseph-1-Duro 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! 🚀

Learn more about application limits

@K1NGD4VID

Copy link
Copy Markdown
Contributor

fix Ci error @Joseph-1-Duro

@Joseph-1-Duro
Joseph-1-Duro force-pushed the fix/route-repayments-through-escrow branch from 03e53e8 to 8aa9600 Compare June 28, 2026 12:07
@K1NGD4VID

Copy link
Copy Markdown
Contributor

Please Resolve Merge conflict @Joseph-1-Duro

Resolved conflicts:
- escrow/src/lib.rs: use > check (prevent overpayment)
- escrow/src/test.rs: rename test to test_release_to_pool_fails_on_overpayment, use amount + 1
- invoice/src/lib.rs: combine amount param with escrow routing
- Escrow/pool snapshots: keep HEAD (escrow-routed) versions
@Joseph-1-Duro
Joseph-1-Duro force-pushed the fix/route-repayments-through-escrow branch from 0e49c54 to acedc4a Compare June 29, 2026 17:10
@K1NGD4VID

K1NGD4VID commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Please resolcve merge conflict @Joseph-1-Duro

@K1NGD4VID

Copy link
Copy Markdown
Contributor

No CI checks have run on this PR. Please rebase onto main so the build-and-test workflow is triggered. The PR can be reviewed for merge once CI passes.

@K1NGD4VID K1NGD4VID left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Feedback

This PR adds a caller parameter to release_to_pool and validates the caller is either the pool or invoice contract. This is a breaking API change to the escrow contract's public interface.

Concerns:

  1. Very stale — This PR was opened months ago. The escrow and invoice contracts have evolved significantly since then. The current codebase likely has different authorization patterns that make this change incompatible.

  2. Breaking change — Adding a parameter to release_to_pool requires updating every call site (invoice contract, pool contract, tests). The current escrow contract on main already has proper pool.require_auth() on this function.

  3. No CI — CI hasn't run, and given the staleness, it's very likely to fail.

Recommendation: Please rebase onto main and check whether the security concern this PR addresses is still relevant. The current main already has pool.require_auth() in release_to_pool, which may already solve the issue. If the current auth model is sufficient, this PR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invoice repayment bypasses escrow contract breaking the escrow security model

2 participants