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

fix malformed chunked encoding #3

Closed
tarunKoyalwar opened this issue Mar 29, 2023 · 1 comment · Fixed by #4
Closed

fix malformed chunked encoding #3

tarunKoyalwar opened this issue Mar 29, 2023 · 1 comment · Fixed by #4
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed.

Comments

@tarunKoyalwar
Copy link
Member

Proposed Changes

POC

  • setup proxy and send a curl request
$ curl -v https://portswigger.net -x http://127.0.0.1:8080    
./proxify -ha "127.0.0.1:8080" -v 

                       _ ___    
   ___  _______ __ __ (_) _/_ __
  / _ \/ __/ _ \\ \ // / _/ // /
 / .__/_/  \___/_\_\/_/_/ \_, / 
/_/                      /___/

		projectdiscovery.io

[INF] Current proxify version 0.0.9 (latest)
[INF] HTTP Proxy Listening on 127.0.0.1:8080
[INF] Socks5 Proxy Listening on 127.0.0.1:10080
[INF] Saving proxify traffic to logs
2023/03/30 01:27:29 ERROR: martian: got error while writing response back to client: malformed chunked encoding
  • same is observed with browser traffic

Investigate/ Review

$ curl -v https://projectdiscovery.io -x http://127.0.0.1:8080  
> CONNECT projectdiscovery.io:443 HTTP/1.1
> Host: projectdiscovery.io:443
> User-Agent: curl/7.86.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 OK
< Content-Length: 0
* Ignoring Content-Length in CONNECT 200 response
  • ^ martian by default send content-length header even if there is no body . It probably shouldn't do that (at least for CONNECT responses )
@tarunKoyalwar
Copy link
Member Author

Looks like Content Length is added whenres.Write is used even if we set Content-Length = -1 . since this is not a error we probably can skip this

@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants