Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 897EE200CC5 for ; Tue, 27 Jun 2017 05:31:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 881C3160BDE; Tue, 27 Jun 2017 03:31:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE2E5160BDA for ; Tue, 27 Jun 2017 05:31:08 +0200 (CEST) Received: (qmail 99443 invoked by uid 500); 27 Jun 2017 03:31:07 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 99432 invoked by uid 99); 27 Jun 2017 03:31:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2017 03:31:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 16A691A7B7F for ; Tue, 27 Jun 2017 03:31:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 8ZHCmsVnyBi8 for ; Tue, 27 Jun 2017 03:31:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 408A75FB71 for ; Tue, 27 Jun 2017 03:31:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A06CBE065D for ; Tue, 27 Jun 2017 03:31:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A16CA2411C for ; Tue, 27 Jun 2017 03:31:01 +0000 (UTC) Date: Tue, 27 Jun 2017 03:31:01 +0000 (UTC) From: "Asankhaya Sharma (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (VALIDATOR-410) Failure cases for UrlValidator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 27 Jun 2017 03:31:09 -0000 [ https://issues.apache.org/jira/browse/VALIDATOR-410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064199#comment-16064199 ] Asankhaya Sharma commented on VALIDATOR-410: -------------------------------------------- The BNF URL grammar used in the tests is given here: https://github.com/codelion/gramtest/blob/master/src/test/resources/url.bnf And it was based of https://www.w3.org/Addressing/URL/5_BNF.html I think if we try to parse the URL using a RegEx it is bound to have some limitations. In fact I also found few other JS libraries also that miss valid generated test cases e.g. https://github.com/segmentio/is-url/issues/15 and https://github.com/gajus/url-regexp/issues/6 > Failure cases for UrlValidator > ------------------------------- > > Key: VALIDATOR-410 > URL: https://issues.apache.org/jira/browse/VALIDATOR-410 > Project: Commons Validator > Issue Type: Bug > Affects Versions: 1.5.1 > Reporter: Asankhaya Sharma > Priority: Minor > > I was trying to check how closely the UrlValidator implements the URL grammar as described by the RFC 1738 (https://www.ietf.org/rfc/rfc1738.txt). I fuzzed the UrlValidator with GramTest, a grammar based test case generation tool (https://github.com/codelion/gramtest). > I found that in the latest version 1.5.1, the UrlValidator fails to validate the following strings: > {{"ftp:///+"}} > {{"mailto:%FF@Z"}} > These two strings may seem a bit strange, but I verified manually that they are allowed by the grammar given in the RFC (see also https://www.w3.org/Addressing/URL/5_BNF.html). > Furthermore, it is possible to create the following URLs in Java without throwing a {{MalformedUrlException}}: > {code} > new URL("ftp:///+"); > new URL("mailto:%FF@Z"); > {code} > however, the UrlValidator returns false for these strings: > {code} > UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES + UrlValidator.ALLOW_2_SLASHES + UrlValidator.ALLOW_LOCAL_URLS); > validator.isValid("ftp:///+"); // returns false > validator.isValid("mailto:%FF@Z"); // returns false > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)