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
PATH_INFO incorrectly set with multipart/form-data POST with files #2198
Comments
Can you provide a test case please? |
Here is a live example that reproduces the issue. https://fast-page.it/passenger-issue-2198/a/b/c/ The output for a
The output for a
Note how The .htaccess file is:
The template.html is https://paste.ofcode.org/cLag4HygUNa7x3EdnBwxx5. It seems that there are two issues here:
Thanks. |
Unfortunately I cannot reproduce the issue on my own server, so I suspect this might be a configuration issue with the host you are using. |
What version are you using? |
Hmm, good point. I tested using 6.0.2, I'll redo it using 5.3.7. |
We encountered such a problem and it was caused by one of the rules of the mod_security module. Try to disable it and test the application again. |
@CamJN
Where /etc/test.sh is: Don't forget to do chmod 755 /etc/test.sh. It seems that after the inspectFile processing is performed, the control returns incorrectly from the mod_security to the mod_passenger. Can you try to do it on your test server? |
If mod security is modifying the request data then there's not much we can do about that; unfortunately. |
Actually, there is a solution :) The mod_security does not change anything in the request; it simply adds additional environment variables (such as PATH_INFO and SCRIPT_NAME) that later breaks the application. For example, the variables with which the application will spawn when the rule described above is enabled:
And here is the header data that is passed to the application:
As you can see the values of variables such as PATH_INFO and SCRIPT_NAME are duplicated but with different values. First case:
Second case:
The application itself starts working with values from the second case, which actually breaks it. The following patch can be applied as a solution to that issue.
Here: passenger/src/apache2_module/Hooks.cpp Line 1023 in 83afc89
|
mod_security is setting incorrect values for those env vars, that's something that should be fixed on their end. |
perillo commentedApr 24, 2019
I'm having the same issue as reported at:
https://stackoverflow.com/questions/49594955/django-1-11-on-passenger-wsgi-not-routing-post-request?rq=1.
However in my case PATH_INFO is incorrectly set only with multipart/form-data POST and only when uploading a file.
I'm using Passenger 5.3.7 with Apache on a shared hosting:
Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 Phusion_Passenger/5.3.7
The text was updated successfully, but these errors were encountered: