Skip to content

v1.3.1: ```

Latest

Choose a tag to compare

@thorewi thorewi released this 24 Oct 08:11
fix: Prevent false positive PAN detection for decimal numbers
```
Decimal numbers, especially coordinates and scales from contexts like `fabric.js` or `SVG transform`, often contain long sequences of digits due to floating-point precision. Some of these sequences can coincidentally pass the Luhn algorithm and match card scheme prefixes (e.g., `0.38199830073025` might appear as a DinersClub PAN).

This update modifies the card number detection regex to explicitly ignore digit sequences that are part of a decimal number, both before and after the decimal point. This prevents incorrect masking and false alerts, ensuring that only actual payment card numbers are targeted. PANs followed by a period at the end of a sentence are still correctly masked.
```