mitmproxy / mitmproxy/mitmproxy

Unable to get filename in binary multipart/form-data

Open
#3,249 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/protocols kind/feature
Dominant language
Python
Stars
45.1k
Forks
4.7k
Avg merge
21h 12m
Merged PRs (30d)
16

Description

Steps to reproduce the problem:
  1. mitmproxy -p 8888
  2. curl -X POST "http://google.com/upload" -H 'Content-type:multipart/form-data; boundary=----------a8ba1f6ad84944199d5346f69bb14140' --data-binary $'------------a8ba1f6ad84944199d5346f69bb14140/\r\nContent-Disposition: form-data; name="file"; filename="error.log.zip";\r\nContent-Type: application/octet-stream\r\n\r\nx\x9c\xbd\x96\xddR\xab0\x10\xc7\xaf\xedS\xe4\xc2\r\n------------a8ba1f6ad84944199d5346f69bb14140--\r\n' -x localhost:8888
  3. Check request data, only "file" field without filename
System information
Mitmproxy: 4.0.3
Python:    3.6.5
OpenSSL:   OpenSSL 1.1.0h  27 Mar 2018
Platform:  Linux-4.9.4-galliumos-braswell-x86_64-with-Ubuntu-16.04-xenial

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the request with the provided curl command through mitmproxy on port 8888, then inspect how the request data represents the multipart field. Trace the multipart parsing entry point from the observed request data and verify that the filename from Content-Disposition is preserved. Done means the file field exposes error.log.zip while the binary payload remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.