Repository navigation
fix: harden sanctions screening against punctuation, word-order and transliteration evasion - #1345
Conversation
|
@Ajibola6921 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! 🚀 |
c15d8e6 to
b31bb6c
Compare
|
Security check: this PR contains malware (the PolinRider campaign) and can't be merged as it is. Our automated scan flagged these files on your branch:
These changes are not part of your fix. They hide code that runs automatically on the machine of anyone who opens or installs the project (padded/obfuscated code in config files, Please:
Thanks! |
Strips the payload this branch picked up (deleted api.js, unhooked package.json). No functional change to the branch's own work.
Overview
This PR hardens the blocking, fail-closed
SanctionsScreeningServicegate so that punctuation, token order and Cyrillic/Latin transliteration can no longer evade investment screening. It reuses the existing transliteratingnormalizeNamefromsrc/lib/jaroWinkler.ts, adds token-sorted comparison, and introduces afuzzymatch type (Jaro-Winkler, default threshold 0.92) that is treated as a review-requiring hit — blocked, same aspartial. The docblock claims are corrected to match the implementation.Related Issue
Changes
🛡️ Sanctions Screening Hardening
[MODIFY]
src/services/sanctionsScreeningService.tsnormalizeNamewith the transliterating, punctuation-strippingnormalizeNamefromsrc/lib/jaroWinkler.ts, soИван/IVANandO'Brien/OBriencompare identically."Doe, John"and"John Doe"match.fuzzymatch type backed byjaroWinkler(..., { transliterate: true })with a configurable threshold (default0.92), treated as a hit that requires review (blocked, same aspartial).[MODIFY]
src/lib/jaroWinkler.tsnormalizeName(transliteration + punctuation stripping) for the screening service, keeping a single source of truth for name normalisation.[MODIFY]
src/services/sanctionsScreeningService.test.tsDoe, John,John-Doe,Ivan Petrov,IVAN PETROV) against list entriesJohn Doe/Иван Петров, plus unrelated names (Jane Smith) that must still clear.master.Verification Results
Doe, John,John-Doe,Ivan Petrov,IVAN PETROVblocked againstJohn Doe/Иван ПетровJane Smith) still clearmastersanctionsScreeningService.test.tsCloses #1290