Page MenuHomePhabricator

Allow Phabricator to run with "enable_post_data_reading" disabled
ClosedPublic

Authored by epriestley on Oct 10 2017, 10:26 PM.
Tags
None
Referenced Files
F13050271: D18702.diff
Fri, Apr 19, 2:43 AM
Unknown Object (File)
Wed, Apr 17, 3:20 PM
Unknown Object (File)
Mar 10 2024, 5:54 AM
Unknown Object (File)
Feb 13 2024, 10:39 AM
Unknown Object (File)
Feb 11 2024, 4:44 PM
Unknown Object (File)
Feb 8 2024, 5:21 AM
Unknown Object (File)
Feb 7 2024, 10:28 PM
Unknown Object (File)
Jan 31 2024, 1:06 PM
Subscribers
None

Details

Summary

Ref T13008. Depends on D18701. The overall goal here is to make turning enable_post_data_reading off not break things, so we can run rate limiting checks before we read file uploads.

The biggest blocker for this is that turning it off stops $_FILES from coming into existence.

This appears to mostly work. Specifically:

  • Skip the max_post_size check when POST is off, since it's meaningless.
  • Don't read or scrub $_POST at startup when POST is off.
  • When we rebuild REQUEST and POST before processing requests, do multipart parsing if we need to and rebuild FILES.
  • Skip the is_uploaded_file() check if we built FILES ourselves.

This probably breaks a couple of small things, like maybe __profile__ and other DarkConsole triggers over POST, and probably some other weird stuff. The parsers may also need more work than they've received so far.

I also need to verify that this actually works (i.e., lets us run code without reading the request body) but I'll include that in the change where I update the actual rate limiting.

Test Plan
  • Disabled enable_post_data_reading.
  • Uploaded a file with a vanilla upload form (project profile image).
  • Uploaded a file with drag and drop.
  • Used DarkConsole.
  • Submitted comments.
  • Created a task.
  • Browsed around.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

amckinley added inline comments.
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
17–18

This comment needs to be updated, no?

This revision is now accepted and ready to land.Oct 13 2017, 7:43 PM
  • Rewrite explanatory comment.
This revision was automatically updated to reflect the committed changes.