Skip to content

Internal Assertion failed when parsing incorrect URL containing u200b Unicode character #51593

Description

@heipei

Version

v20.10.0

Platform

Linux blackbox 6.7.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 21 Jan 2024 22:14:10 +0000 x86_64 GNU/Linux

Subsystem

url

What steps will reproduce the bug?

Trying to parse this will crash the process instead of throwing an exception. Not sure what would be the intended behavior here:

u = new URL("http://​123.123.123.123")
u.username = ""

The URL contains a u200b unicode character in front of the first digit!

How often does it reproduce? Is there a required condition?

Always reproducible

What is the expected behavior? Why is that the expected behavior?

An exception that can be caught.

What do you see instead?

Process crashes with

node[1296311]: ../src/node_url.cc:309:static void node::url::BindingData::Update(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `out' failed.
 1: 0x604dba5723d5 node::Abort() [node]
 2: 0x604dba572731 node::Assert(node::AssertionInfo const&) [node]
 3: 0x604dba64cd18 node::url::BindingData::Update(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 4: 0x604dba7ec1f6  [node]
 5: 0x604dba7ecd92 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
 6: 0x604dbb160df6  [node]

Additional information

No response

Activity

  1. targos commented on Jan 29, 2024

    @targos
    Member

    @nodejs/url

  2. marco-ippolito commented on Jan 29, 2024

    @marco-ippolito
    Member

    @anonrig it seems like an issue with ada parse

      auto out = ada::parse<ada::url_aggregator>(input.ToStringView());
  3. lemire commented on Jan 29, 2024

    @lemire
    Member

    I am checking it.

  4. lemire commented on Jan 29, 2024

    @lemire
    Member

    It is a bug in ada. See ada-url/ada#583

    @anonrig will need to review.

  5. lemire commented on Jan 29, 2024

    @lemire
    Member

    For people who are curious, we did not have any test with an IPv4 address containing ignorable Unicode characters. This was just an untested code path.

  6. added
    whatwg-urlIssues and PRs related to the WHATWG URL implementation.
    confirmed-bugIssues and PRs for confirmed bugs.
    on Jan 29, 2024
  7. lemire commented on Jan 29, 2024

    @lemire
    Member

    @anonrig has approved my fix and the fix is merged. A new release of ada will be necessary to fix this issue in node.

  8. linked a pull request that will close this issuedeps: update ada to 2.7.6 #51542on Jan 30, 2024
  9. marco-ippolito commented on Feb 4, 2024

    @marco-ippolito
    Member

    Fixed on main with #51542, should be included in the next release and backported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions