Skip to content

URL scheme validation does not correctly implement RFC 3986 #11249

Closed

Description

@ad0p

I am trying to use curl_url_set to validate a string and check whether it's a valid URL. I use option CURLU_NON_SUPPORT_SCHEME as I need to support custom schemes.

In urlapi.c, there is the following comment:

  /* RFC 3986 3.1 explains:
    scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  */

But actual implementation is more like:

    scheme      =  1*( ALPHA / DIGIT / "+" / "-" / "." )

I have tested that the following examples are marked by libcurl curl_url_set as valid:

  • 1h://example1
  • ..://example2
  • -://example3
    -+://example4

Those are not valid URLs according to RFC 3986 3.1, but libcurl treats them as valid ones.

Activity

  1. self-assigned this
    on Jun 5, 2023
  2. added a commit that references this issue on Jun 5, 2023
    975641f
  3. added a commit that references this issue on Jul 19, 2023
    2d79ab5
  4. added a commit that references this issue on Sep 25, 2023
    0a75311
  5. added a commit that references this issue on Mar 27, 2024
    ba669d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions