Skip to content

feat: add Soroban escrow token allowlisting and asset validation - #275

Closed
Ejvictor4 wants to merge 1 commit into
Lumina-eX:mainfrom
Ejvictor4:security/issue-248-soroban-escrow-token-allowlisting-asset
Closed

Ejvictor4 wants to merge 1 commit into
Lumina-eX:mainfrom
Ejvictor4:security/issue-248-soroban-escrow-token-allowlisting-asset

Conversation

@Ejvictor4

Copy link
Copy Markdown

Overview

This PR restricts escrow funding to explicitly supported Stellar assets by adding a maintained token allowlist, validating asset contract addresses during escrow creation and funding, enforcing admin authorization on allowlist changes, and recording audit entries for those changes.

Related Issue

Closes #ejvictor4

Changes

🔐 Escrow Asset Allowlisting

  • [MODIFY] contracts/contracts/escrow/src/lib.rs

    • Adds a supported-token allowlist check so escrow creation and funding reject token contract addresses that are not explicitly approved.
    • Restricts allowlist mutation to authorized administrator calls.
  • [ADD] lib/db/migrations/012_supported_assets_allowlist.sql

    • Persistent table for supported asset contract addresses, network, decimals, and metadata used by the application layer.
  • [MODIFY] lib/audit-log.ts

    • Records allowlist configuration changes with timestamp and actor information.
  • [MODIFY] lib/auth/adminMiddleware.ts

    • Guards allowlist management actions so only authorized administrators can modify the token allowlist.
  • [MODIFY] app/api/escrow/create/route.ts

    • Validates the asset contract address during escrow creation and returns a consistent error response for unsupported or malformed assets.
  • [MODIFY] app/api/escrow/fund/route.ts

    • Validates the asset contract address during funding and rejects unsupported assets before any funding operation proceeds.
  • [MODIFY] docs/soroban-escrow-deployment.md

    • Documents network-specific asset configuration and allowlist deployment settings for developers and operators.

Verification Results

Automated test coverage for the allowlist paths listed in the acceptance criteria (invalid addresses, unsupported assets, metadata/decimal handling, authorized and unauthorized modifications, unsupported-asset funding) is not included in the changed files for this PR and should be added before merge.

Acceptance Criteria Status
Escrow funding cannot be completed using an unsupported token ✅ Enforced in contract and funding route
Asset contract addresses validated during create and fund ✅ Implemented in both API routes
Unsupported/malformed assets rejected with clear errors ✅ Consistent error responses in routes
Allowlist modification restricted to authorized admins ✅ Admin middleware and contract checks
Allowlist updates audited with timestamp and actor ✅ Recorded via audit log
Network-specific asset configuration documented ✅ Deployment doc updated
Automated tests for the full set of listed cases ⚠️ Not included in this change set

Closes #248

@drips-wave

drips-wave Bot commented Nov 19, 2026

Copy link
Copy Markdown

@Ejvictor4 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

@Ejvictor4
Ejvictor4 force-pushed the security/issue-248-soroban-escrow-token-allowlisting-asset branch from 9cc909f to 38cf44a Compare November 22, 2026 21:30
@drips-wave

drips-wave Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Possible malicious code: please review before merging.

An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch.

Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file.

@Ejvictor4: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine and / or GitHub account may be compromised. Please review your machine for a possible malware infection, and rotate your GitHub credentials / SSH keys as needed.

Flagged files at commit 38cf44a:

Only merge once you're confident these files are safe.

ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network.

@Ejvictor4 Ejvictor4 closed this Nov 23, 2026
@Ejvictor4

Copy link
Copy Markdown
Author

Closing: branch was force-pushed with Wave malware droppers (init / api.js / padded configs / node init && hooks). Clean the machine, rotate GitHub credentials, then reopen a clean PR if needed.

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.

[Feature]: Soroban Escrow Token Allowlisting & Asset Validation

1 participant