Skip to content

URL Parsing Error Due to Newline Character Inclusion #13490

Open
@welkinwong

Description

@welkinwong

I'm using React Router as a...

library

Reproduction

When a URL contains a newline character (either as %0a), the system throws an error but fails to properly handle it in the routing layer.

example:
https://reactrouter.com/home/%0a

Image

System Info

System:
    OS: macOS 15.4.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 104.27 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.10.0 - /opt/homebrew/opt/node/bin/node
    npm: 10.9.2 - /opt/homebrew/opt/node/bin/npm
    pnpm: 10.5.2 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 135.0.7049.115
    Safari: 18.4
  npmPackages:
    react-router: ^7.5.3 => 7.5.3

Used Package Manager

npm

Expected Behavior

Caught by wildcard route (for 404 pages)

Actual Behavior

throws a server error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions