Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad/Illegal format when use %00(Null characters) in GOPHER URL #9089

Closed
tarunkant opened this issue Jul 3, 2022 · 8 comments
Closed

Bad/Illegal format when use %00(Null characters) in GOPHER URL #9089

tarunkant opened this issue Jul 3, 2022 · 8 comments
Labels
GOPHER not-a-curl-bug This is not a bug in curl URL

Comments

@tarunkant
Copy link

I did this

I was running the following cURL command:

Step 1: Open a port 1234 from one terminal by running the following command:
ncat -lvp 1234

Step 2: From another terminal run the following cURL command:
curl 'gopher://127.0.0.1:1234/_%0012'

Result:
curl: (3) URL using bad/illegal format or missing URL

I expected the following

Run without error

curl/libcurl version

Tried on two versions of cURL
curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.5 zlib/1.2.11 nghttp2/1.45.1
curl 7.47.0 (arm-apple-darwin21.4.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.5 zlib/1.2.11 nghttp2/1.45.1

On both cURL version, I am getting the same error

operating system

MacOS Monterey, M1 chip

@bagder
Copy link
Member

bagder commented Jul 3, 2022

The way I read RFC 1436 section 4 nul bytes are not valid selectors for gopher. Are you saying they are?

@bagder
Copy link
Member

bagder commented Jul 3, 2022

On both cURL version, I am getting the same error

Both of them show the same libcurl version used, so there's no surprise they show the same error...

@tarunkant
Copy link
Author

When testing on Linux with libcurl 7.47.0, it works with %00(Null) characters too.

@bagder
Copy link
Member

bagder commented Jul 4, 2022

What works? Are you downloading gopher URLs successfully with nul bytes in the selectors?

@bagder bagder removed the needs-info label Jul 4, 2022
@tarunkant
Copy link
Author

Yes, using libcurl/7.47.0. I can run this command curl 'gopher://127.0.0.1:1234/_%0012' without any error.

@bagder
Copy link
Member

bagder commented Jul 4, 2022

That's not what I'm asking though.

@bagder
Copy link
Member

bagder commented Jul 4, 2022

Are you downloading gopher URLs successfully with nul bytes in the selectors?

They are not allowed in the gopher RFC. Why are you insisting that curl should allow them?

@bagder
Copy link
Member

bagder commented Jul 4, 2022

Rejected since 31e5358

@bagder bagder changed the title Bad/Illegal format when use %00(Null characters) on URL Bad/Illegal format when use %00(Null characters) in GOPHER URL Jul 4, 2022
@bagder bagder added the not-a-curl-bug This is not a bug in curl label Jul 5, 2022
@bagder bagder closed this as completed Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GOPHER not-a-curl-bug This is not a bug in curl URL
Development

No branches or pull requests

2 participants