You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Joachim Rohde (JIRA)" <ji...@apache.org> on 2009/11/03 13:40:59 UTC

[jira] Updated: (WICKET-2552) CreditCardValidator accepts invalid inputs

     [ https://issues.apache.org/jira/browse/WICKET-2552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joachim Rohde updated WICKET-2552:
----------------------------------

    Attachment: CreditCardValidatorTest.java
                WICKET-2552-fix.patch

Attached you'll find a patch which is more accurate than the current validator which only tries to apply the Luhn algorithm. The patch takes also the prefix of the number and its length into consideration. 
The patch should work for credit card numbers of the following institutes: "American Express", "China UnionPay", "Diners Club Carte Blanche", "Diners Club International", "Diners Club US & Canada", "Discover Card", "JCB", "Laser", "Maestro", "MasterCard", "Solo", "Switch", "Visa" or "Visa Electron". 

Any other credit card number from a different bank is considered to be invalid.

Additionally a unit test can be found as an attachement.

> CreditCardValidator accepts invalid inputs
> ------------------------------------------
>
>                 Key: WICKET-2552
>                 URL: https://issues.apache.org/jira/browse/WICKET-2552
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Madhuri Marri
>         Attachments: CreditCardValidatorTest.java, WICKET-2552-fix.patch
>
>
> (1) The onValidate() method of the CreditCardValidator class returns true for invalid inputs with null or unicode character such as 4\0\0\0\0\0\0\0\0\0\0\0\0\0\0. 
> (2) Also there is no length check on the input, therefore even invalid length inputs such as 9845 are accepted. 
> (3) There is no check for invalid issuer identifier, i.e.,  840898920205250 is accepted, where 84XXXX is not a valid issuer identifier

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.