arhs / iban.js

IBAN & BBAN validation, formatting and conversion in Javascript
https://arhs.github.io/iban.js/
MIT License
535 stars 130 forks source link

Account number checksum check is missing, resulting in returning false positives #52

Closed ostrolucky closed 6 years ago

ostrolucky commented 6 years ago

SK1211115351562002977968

Here, according to https://www.ibancalculator.com/iban_validieren.html (and failed bank transfer), account number has invalid checksum and is invalid. iban.js though returns true in isValid()

piotr-dobrogost commented 6 years ago

Which checksum do you have in mind?

ostrolucky commented 6 years ago

See referenced validator. I don't know more specifics

ostrolucky commented 6 years ago

https://www.iban.com/iban-validation-help.html says

Account Number checksum (in BBAN)

Every IBAN contains a local bank account number also called BBAN ( Basic Bank Account Number). Some countries use internal check digit algorithms to validate domestic BBAN. Every country uses a different algorithm and in some countries algorithms vary from bank to bank or even individual branches.

For example:

United Kingdom (UK) is using 3 different algorithms: MOD10 , MOD11 and DBLAL with 39 different weights. This makes over 100 different variations.

Currently, a total of 48 countries support BBAN and domestic account number check digit validation.

So far I haven't found these country specific algorithms though :(

LaurentVB commented 6 years ago

Hello @ostrolucky

Thanks for the report. What you're facing is a standard-compliant IBAN generated from a wrong BBAN (according to the Slovakian-specific standard). This library currently does not implement the BBAN validation, it can just generate and/or validate the correct IBAN from the passed BBAN, which can or cannot be valid according to local rules. Sorry for not being able to help you more.

Regards

Laurent

ostrolucky commented 6 years ago

This library currently does not implement the BBAN validatio

Well what I'm asking is to do implement it. Should I raise new issue then?

LaurentVB commented 6 years ago

Oh ok. I think this is currently out of scope of this library and probably not feasible with our limited resources.

Sorry for not being able to help on this.