Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't poll for invalid wallet address requests #3180

Open
3 tasks
mkurapov opened this issue Dec 17, 2024 · 1 comment
Open
3 tasks

Don't poll for invalid wallet address requests #3180

mkurapov opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
pkg: backend Changes in the backend package.

Comments

@mkurapov
Copy link
Contributor

mkurapov commented Dec 17, 2024

Context

Currently, we have a feature that sends a webhook (wallet_address.not_found) out to the ASE if a wallet address looked up via Open Payments wasn't found (#1419). This allows the integrator to call createWalletAddress "on-the-fly"/on demand. This avoids the ASE having to pre-create all wallet addresses for all of their users when first starting up Rafiki - they can just wait for the wallet address to be requested to do the lookup process on their end and create this wallet address.

The current issue with this is the fact that we may get a bunch of "invalid" wallet address requests: for example, while https://ilp.interledger-test.dev/max would be a valid lookup, we may get something like https://ilp.interledger-test.dev/favicon.ico, which is already invalid -> we shouldn't send out a webhook for this.

This can be potentially solved with allowing a standard regex for wallet address creation (something which the ASE can decide). Then, we can use the same regex to validate whether we actually want to publish the wallet_address.not_found whenever we encounter a wallet address that does not exist in the Rafiki DB.

Todos

  • Allow an optional regex to be configured in the backend
  • Check the regex during wallet address creation
  • Check the regex before sending out a wallet_address.not_found webhook
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Dec 17, 2024
@mkurapov mkurapov changed the title Don't poll for incorrect wallet address requests Don't poll for invalid wallet address requests Jan 20, 2025
@mkurapov mkurapov moved this from Backlog to Todo in Rafiki Jan 30, 2025
@koekiebox koekiebox moved this from Todo to In Progress in Rafiki Feb 3, 2025
@koekiebox koekiebox added the pkg: backend Changes in the backend package. label Feb 3, 2025
@pedrosousabarreto
Copy link

At PCH we came about this issue because of typical website scans that happen all the time on the internet to open web servers.
Problem is that if we serve the wallet address lookup function at the root of the site, everything that looks like "/something.*" is a potential lookup, which triggers work and possibly an unintended denial of service attack.

A simple solution is to just have a prefix where we mount the lookup function, like: "/lookup/:addressToLookup"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package.
Projects
Status: In Progress
Development

No branches or pull requests

3 participants