Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid IBAN Considered Valid #72

Open
umangkedia92 opened this issue Jun 11, 2019 · 12 comments
Open

Invalid IBAN Considered Valid #72

umangkedia92 opened this issue Jun 11, 2019 · 12 comments
Assignees
Labels

Comments

@umangkedia92
Copy link

According to https://www.iban.com/testibans the following IBANs are invalid:
GB00HLFX11016111455365
GB01BARC20714583608387

But this library considers these IBANs as valid.

@FlorentPoinsaut
Copy link

According to https://runkit.com/embed/y2e8cpx51ogy, the bad list is larger:

  • GB00HLFX11016111455365
  • GB01BARC20714583608387
  • GB02BARC20201530093451
  • GB24BARC20201630093459
  • GB2LABBY09012857201707
  • GB68CITI18500483515538
var IBAN = require("iban")
const iban_list = ['GB33BUKB20201555555555', 'GB94BARC10201530093459', 'GB94BARC20201530093459', 'GB96BARC202015300934591', 'GB02BARC20201530093451', 'GB68CITI18500483515538', 'GB24BARC20201630093459', 'GB12BARC20201530093A59', 'GB78BARCO0201530093459', 'GB2LABBY09012857201707', 'GB01BARC20714583608387', 'GB00HLFX11016111455365', 'US64SVBKUS6S3300958879'];
let res = [];
iban_list.forEach(function(iban) {
  res[iban] = IBAN.isValid(iban);
});
res;

@LaurentVB LaurentVB self-assigned this Jun 19, 2019
@LaurentVB
Copy link
Collaborator

Hello,
Thanks for opening this issue.
You're right that this library should probably have the same results as documented on iban.com for the following IBANs:

  • GB00HLFX11016111455365
  • GB01BARC20714583608387
  • GB2LABBY09012857201707

The other examples either give the same answer as iban.com, or expectedly return true when iban.com replies false because of local validation criteria not checked by this library (bank code, bban check-digit).

@LaurentVB LaurentVB added the bug label Jun 19, 2019
@Renkas
Copy link

Renkas commented Oct 1, 2019

also lowercase country code is considered valid although standard specifies that all letters in IBAN MUST be uppercase.

@peter-catalin
Copy link

Hello,

I found another case that is being considered valid by the library but invalid on iban.com

ES1100753038790600500941

Hope it helps!

@puru0019
Copy link

puru0019 commented May 11, 2020

Hi

iban is allowing special characters

image

@awacode21
Copy link

awacode21 commented May 27, 2020

@LaurentVB This is also a problem in my current customer project where we are using the Iban library. Can you already estimate when this will be fixed?

@syshex
Copy link

syshex commented Aug 4, 2020

yeah we also got this problem. Accepting chars like '?' , '.' etc in the middle of the iban.

@tarmooo
Copy link

tarmooo commented Sep 1, 2020

yeah we also got this problem. Accepting chars like '?' , '.' etc in the middle of the iban.

Why you even let user enter those chars, clean it up before sending it to validator? I think this library should not be responsible for cleanup.

@syshex
Copy link

syshex commented Sep 3, 2020

yeah we also got this problem. Accepting chars like '?' , '.' etc in the middle of the iban.

Why you even let user enter those chars, clean it up before sending it to validator? I think this library should not be responsible for cleanup.

Hey, yes, we are validating inputs before.

Still, I do not agree with your comment. In the main page there is this: IBAN.isValid('hello world'); // false , space is an invalid char , yet, the library works fine, by returning false. A false positive on the other hand is definitely not a good return , even if input should have been sanitized before. It is the same as saying : IBAN.isValid('hello world'); // true because the input should have been checked for the space.

@Cyrille37
Copy link

Cyrille37 commented Sep 8, 2020

You're right that this library should probably have the same results as documented on iban.com for the following IBANs:
* GB00HLFX11016111455365
* GB01BARC20714583608387
* GB2LABBY09012857201707

That means there is an error in ckecksum calculation ...

@KyorCode
Copy link

There actualy is a problem with the IBAN Checksum:

BE77776593869767
Is also valid, although not by iban.com.

@WebDaMa
Copy link

WebDaMa commented Jan 25, 2023

Perhaps a simple fix is that you run this on your input IBAN string before validating:

input = input.replace(/[^a-zA-Z0-9]/g, '');

This way all weird characters are filtered out, perhaps it could be included in this script as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests