Skip to content

feat(security): add phone number reputation check service and integra…#82

Open
tmrathod2003-alt wants to merge 1 commit intoHardhat-Enterprises:devfrom
tmrathod2003-alt:implement-phone-reputation-service/titiksha
Open

feat(security): add phone number reputation check service and integra…#82
tmrathod2003-alt wants to merge 1 commit intoHardhat-Enterprises:devfrom
tmrathod2003-alt:implement-phone-reputation-service/titiksha

Conversation

@tmrathod2003-alt
Copy link
Copy Markdown

Summary

Implements a phone number reputation check service that analyses sender phone numbers for smishing risk signals. Currently the app analyses message text and URLs but never checks the sender's phone number. This adds a new layer of smishing detection by identifying suspicious number types commonly associated with smishing attacks.

Changes

  • Created src/services/phoneReputation.service.js using google-libphonenumber to validate and analyse phone numbers
  • Service detects suspicious line types including VoIP, premium rate, and toll free numbers and computes a risk score
  • Updated src/controllers/scan.controller.js to accept optional phoneNumber field and call the reputation service
  • Updated scanSchema in auth.validation.js to include optional phone number validation
  • Added authMiddleware and validate(scanSchema) to scan.route.js

Testing

  • Verified Australian mobile number (+61412345678) correctly returns lineType: mobile, riskScore: 0
  • Verified premium rate number (+19005551234) correctly returns lineType: premium_rate, riskScore: 35, isPremiumRate: true
  • Verified endpoint returns 401 Unauthorized without a valid JWT token

Planner Task

Implement Phone Number Reputation Check Service

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.

2 participants