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
F18509151: D18702.id.diff
Fri, Sep 5, 3:15 AM
F18501734: D18702.diff
Thu, Sep 4, 9:56 PM
F18321829: D18702.id.diff
Sun, Aug 24, 5:15 PM
F18307696: D18702.diff
Sun, Aug 24, 2:07 AM
F18292587: D18702.id44907.diff
Sat, Aug 23, 12:22 PM
F18087244: D18702.id44906.diff
Aug 6 2025, 3:11 AM
F17954281: D18702.id44894.diff
Aug 1 2025, 3:57 AM
F17948035: D18702.id44907.diff
Jul 31 2025, 7:54 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.