feat: [expansion] Add remote URL support to qrcode module with Security Hardening#761
Open
feat: [expansion] Add remote URL support to qrcode module with Security Hardening#761
Conversation
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.
Description
This PR enhances the
qrcodeexpansion module to support remote URLs as input.Currently, the module only accepts file attachments. With the rise of Quishing (QR Code Phishing), analysts increasingly need to decode remote images hosted on external servers without manually downloading them.
Changes
urlandlinkattributes.requests.numpyusage (import np->import numpy as np).Security Hardening (Audit & Fix)
Since this feature transforms the module into an active web client, I implemented specific security controls to mitigate risks:
is_safe_url) to block access to private/loopback IPs (e.g.,127.0.0.1,192.168.x.x).MAX_IMAGE_SIZE(10MB) and chunk-based streaming to prevent memory exhaustion attacks.User-Agent(iPhone) to bypass basic anti-bot protections used by phishing kits.verify=False) to ensure analysts can scan phishing domains with invalid certificates.Quality Assurance
Related Issue
Fixes #757