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

--data-binary output should be escaped #6

Open
salty-horse opened this issue Apr 15, 2018 · 3 comments
Open

--data-binary output should be escaped #6

salty-horse opened this issue Apr 15, 2018 · 3 comments

Comments

@salty-horse
Copy link

salty-horse commented Apr 15, 2018

Similar to the -F multipart bugs, the strings after --data-bianry are not escaped.

Given this input:

POST / HTTP/1.1
Host: localhost:8000
User-Agent: curl/7.47.0
Accept: */*
Content-Length: 5
Content-Type: application/x-www-form-urlencoded

$PATH

h2c outputs:
curl --http1.1 --user-agent "curl/7.47.0" --data-binary "$PATH" https://localhost:8000/

A POSIX shell will expand $PATH.

@salty-horse
Copy link
Author

The same is true for other fields, such as user agent.

@bagder
Copy link
Member

bagder commented Apr 17, 2018

Yes, and other headers too.

@salty-horse
Copy link
Author

salty-horse commented Aug 12, 2018

Binary data (specifically non-printable characters) should also be escaped and written as \x##.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants