Opened 16 years ago

Last modified 14 years ago

#60 new enhancement

Replace binfmt_misc with Apache handlers — at Version 1

Reported by: andersk Owned by:
Priority: minor Milestone:
Component: web Keywords:
Cc:

Description (last modified by quentin)

Our AFS patch currently marks every file as executable. This was done to allow the binfmt_misc hack to work for Perl, PHP, Python, and Mono scripts. Previously binfmt_misc was also used for static content, until it became clear that this opens an exploitable security problem with MediaWiki? uploads.

We should be able to completely replace the binfmt_misc hack with a solution based on Apache handlers.

  • I suspect Perl and Python don’t need special handlers at all (since Perl and Python programmers expect to need shebang lines), although we may need some kind of transition period to check whether users are relying on the executable bit.
  • We can wrap PHP in a handler that performs extra security checks, such as that the extension really is .php. This handler could later grow into the FastCGI PHP proxy pony. It could also solve #2.
  • Static content should also become a handler, so that users can add their own static extensions.
  • As for Mono, well, what the fuck. (Maybe keep binfmt_misc but require explicit executable bits for that.)

The hardest problem is how to get these Apache handlers to run with the correct uid. My last proposal was a FUSE filesystem that I have prototyped at /mit/andersk/Public/scripts/scriptswrapfs.c, but I’d be interested in better ideas.

Change History (1)

comment:1 Changed 15 years ago by quentin

  • Description modified (diff)
  • Priority changed from major to minor
  • Summary changed from Replace executable bit and binfmt_misc with Apache handlers to Replace binfmt_misc with Apache handlers
  • Type changed from defect to enhancement

We no longer automatically set +x on files. We still support binfmt_misc. I am downgrading the severity of this bug.

Note: See TracTickets for help on using tickets.