Skip to content

feat: integrate phishing protection into NftController #5598

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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

AugmentedMode
Copy link
Contributor

@AugmentedMode AugmentedMode commented Apr 6, 2025

Explanation

This is not a complete PR. But my initial jab at this so lets talk about this more tomorrow

NFT Metadata URL Safety: Moving Phishing Detection from UI to Controller

Overview

This PR implements security enhancements by moving NFT metadata URL safety checks from the UI layer to the controller level. It ensures potentially malicious URLs in NFT metadata are detected and filtered before reaching the UI components.

Changes

  • Added URL safety scanning to the NftController that checks all external links in NFT metadata
  • Implemented phishing detection using PhishingController's URL scanning capability
  • Added caching mechanism to reduce redundant URL checks
  • Implemented concurrent URL processing with controlled batch sizes
  • Added sanitization of NFT metadata to remove unsafe URLs

Technical Details

  • Added a new method #sanitizeNftMetadata that checks all URLs in metadata
  • Added URL safety check implementation with PhishingController integration
  • Modified _getNftInformation to sanitize metadata after retrieval
  • Implemented filtering for various URL types (image, animation, external links)
  • Added safety configuration with allowed protocols and denied domains

References

Changelog

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@AugmentedMode AugmentedMode requested a review from a team as a code owner April 6, 2025 15:52
@AugmentedMode AugmentedMode self-assigned this Apr 7, 2025
@AugmentedMode AugmentedMode marked this pull request as draft April 7, 2025 13:18
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.

1 participant